Skip to content

Commit

Permalink
Ability to convert multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed May 2, 2016
1 parent cddbd60 commit 7a46eaf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions console/main_console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ int main(int argc, const char * argv[])
showHelp(argv, opts);
return 0;
}
strcpy(opts.indir,argv[argc-1]);
strcpy(opts.outdir,opts.indir);
int i = 1;
int lastCommandArg = -1;
int lastCommandArg = 0;
while (i < (argc)) { //-1 as final parameter is DICOM directory
if ((strlen(argv[i]) > 1) && (argv[i][0] == '-')) { //command
if (argv[i][1] == 'h')
Expand Down Expand Up @@ -162,7 +160,6 @@ int main(int argc, const char * argv[])
strcpy(opts.outdir,argv[i]);
}
lastCommandArg = i;

} //if parameter is a command
i ++; //read next parameter
} //while parameters to read
Expand All @@ -177,7 +174,11 @@ int main(int argc, const char * argv[])
}
#endif
clock_t start = clock();
nii_loadDir(&opts);
for (i = (lastCommandArg+1); i < argc; i++) {
strcpy(opts.indir,argv[i]); // [argc-1]
strcpy(opts.outdir,opts.indir);
nii_loadDir(&opts);
}
printf ("Conversion required %f seconds.\n",((float)(clock()-start))/CLOCKS_PER_SEC);
saveIniFile(opts);
return EXIT_SUCCESS;
Expand Down
6 changes: 3 additions & 3 deletions console/nii_dicom.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ extern "C" {
#endif

#ifdef myEnableJasper
#define kDCMvers "22Apr2016j" //JASPER for JPEG2000
#define kDCMvers "30Apr2016j" //JASPER for JPEG2000
#else
#ifdef myDisableOpenJPEG
#define kDCMvers "22Apr2016" //no decompressor
#define kDCMvers "30Apr2016" //no decompressor
#else
#define kDCMvers "22Apr2016o" //OPENJPEG for JPEG2000
#define kDCMvers "30Apr2016o" //OPENJPEG for JPEG2000
#endif
#endif

Expand Down

0 comments on commit 7a46eaf

Please sign in to comment.