From f0fa3adc1e10149f2c591ea0564a62d16ee7f312 Mon Sep 17 00:00:00 2001 From: cmadjar Date: Thu, 22 May 2025 14:15:48 -0400 Subject: [PATCH 1/2] fix bug --- uploadNeuroDB/minc_insertion.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uploadNeuroDB/minc_insertion.pl b/uploadNeuroDB/minc_insertion.pl index 7462361a5..b0f4bdd62 100755 --- a/uploadNeuroDB/minc_insertion.pl +++ b/uploadNeuroDB/minc_insertion.pl @@ -403,7 +403,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 ". From 9c51c90344b66b7b196d4a566e0e2a7811925894 Mon Sep 17 00:00:00 2001 From: cmadjar Date: Thu, 22 May 2025 14:40:01 -0400 Subject: [PATCH 2/2] more bug fix --- uploadNeuroDB/minc_insertion.pl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/uploadNeuroDB/minc_insertion.pl b/uploadNeuroDB/minc_insertion.pl index b0f4bdd62..cb888accc 100755 --- a/uploadNeuroDB/minc_insertion.pl +++ b/uploadNeuroDB/minc_insertion.pl @@ -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); @@ -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) { @@ -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);