Skip to content

Commit 0990a26

Browse files
authored
Fix batch_uploads_tarchive to redirect to dcm2bids pipeline when dcm2niix is set as a converter in the Configs (#804)
* modify batch_uploads_tarchive so that it can run dcm2bids or dcm2mnc pipeline depending on the converter mentioned in the Config module
1 parent ef27bea commit 0990a26

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

batch_uploads_tarchive.pl

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ =head1 AUTHORS
186186
my $tarchiveLibraryDir = $configOB->getTarchiveLibraryDir();
187187
my $mail_user = $configOB->getMailUser();
188188
my $is_qsub = $configOB->getIsQsub();
189-
189+
my $converter = $configOB->getConverter();
190+
my $bin_dirPath = $configOB->getMriCodePath();
190191

191192

192193
# define project space
@@ -237,14 +238,25 @@ =head1 AUTHORS
237238
## this is where the subprocesses are created...
238239
## should basically run processor script with study directory as argument.
239240
## processor will do all the real magic
240-
241241
my $tarchive_path = "$tarchiveLibraryDir/$tarchive";
242-
my $command = sprintf(
243-
"tarchiveLoader.pl -profile %s -uploadID %s %s",
244-
$profile,
245-
quotemeta($upload_id),
246-
quotemeta($tarchive_path)
247-
);
242+
my $command;
243+
if ($converter =~ m/dcm2mnc/i) {
244+
$command = sprintf(
245+
"tarchiveLoader.pl -profile %s -uploadID %s %s",
246+
$profile,
247+
quotemeta($upload_id),
248+
quotemeta($tarchive_path)
249+
);
250+
} elsif ($converter =~ m/dcm2niix/i) {
251+
my $python_config = $configOB->getPythonConfigFile();
252+
$command = sprintf(
253+
"%s/python/run_dicom_archive_loader.py -p %s -t %s",
254+
quotemeta($bin_dirPath),
255+
$python_config,
256+
quotemeta($tarchive_path)
257+
);
258+
}
259+
248260
##if qsub is enabled use it
249261
if ($is_qsub) {
250262
open QSUB, "| qsub -V -e $stderr -o $stdout -N process_tarchive_${counter}";

0 commit comments

Comments
 (0)