Skip to content

Fix various little bugs preventing the insertion of a MINC file without DICOMs #1289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions uploadNeuroDB/minc_insertion.pl
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,6 @@ =head2 Methods
$is_valid = $array[0];
$ArchiveLocation = $array[1];

# create the studyInfo object
%studyInfo = $utility->createTarchiveArray($ArchiveLocation);

} elsif ($tarchive) {
my $mriUploadOB = NeuroDB::objectBroker::MriUploadOB->new(db => $db);
my $mriUploadsRef = $mriUploadOB->getWithTarchive(GET_COLUMNS, $tarchive);
Expand All @@ -383,6 +380,8 @@ =head2 Methods
my %row = %{ $mriUploadsRef->[0] };
$is_valid = $row{'isTarchiveValidated'};
$upload_id = $row{'UploadID'};
$ArchiveLocation = $tarchive;
$ArchiveLocation =~ s/$tarchiveLibraryDir//;
}

} elsif ($hrrt) {
Expand All @@ -403,7 +402,7 @@ =head2 Methods
$is_valid = 1; # if it is HRRT datasets, mark study as valid
}

if (($is_valid == 0) && ($force==0)) {
if (!$is_valid && !$force) {
$message = "\n ERROR: The validation has failed. ".
"Either run the validation again and fix ".
"the problem. Or use -force to force the ".
Expand All @@ -419,8 +418,11 @@ =head2 Methods

## Construct the tarchiveinfo Array and the MINC file object

# Create the study info array
%studyInfo = $utility->createTarchiveArray($ArchiveLocation, $hrrt);
# Create the study info array if ArchiveLocation is defined, otherwise, will populate
# with MINC file header later on
if (defined $ArchiveLocation) {
%studyInfo = $utility->createTarchiveArray($ArchiveLocation, $hrrt);
}

# Create the MINC file object and maps DICOM fields
my $file = $utility->loadAndCreateObjectFile($minc, $upload_id);
Expand Down
Loading