1717import re
1818
1919class Dcm2niiInputSpec (CommandLineInputSpec ):
20- source_names = InputMultiPath (File (exists = True ), argstr = "%s" , position = 10 ,
20+ source_names = InputMultiPath (File (exists = True ), argstr = "%s" , position = - 1 ,
2121 copyfile = False , mandatory = True )
22- gzip_output = traits .Bool (False , argstr = '-g' , position = 0 , usedefault = True )
23- nii_output = traits .Bool (True , argstr = '-n' , position = 1 , usedefault = True )
24- anonymize = traits .Bool (argstr = '-a' , position = 2 )
25- id_in_filename = traits .Bool (False , argstr = '-i' , usedefault = True , position = 3 )
26- reorient = traits .Bool (argstr = '-r' , position = 4 )
27- reorient_and_crop = traits .Bool (argstr = '-x' , position = 5 )
28- output_dir = Directory (exists = True , argstr = '-o %s' , genfile = True , position = 6 )
29- config_file = File (exists = True , argstr = "-b %s" , genfile = True , position = 7 )
30- convert_all_pars = traits .Bool (argstr = '-v' , position = 8 )
31- args = traits .Str (argstr = '%s' , desc = 'Additional parameters to the command' ,
32- position = 9 )
22+ anonymize = traits .Bool (True , argstr = '-a' , usedefault = True )
23+ config_file = File (exists = True , argstr = "-b %s" , genfile = True )
24+ collapse_folders = traits .Bool (True , argstr = '-c' , usedefault = True )
25+ date_in_filename = traits .Bool (True , argstr = '-d' , usedefault = True )
26+ events_in_filename = traits .Bool (True , argstr = '-e' , usedefault = True )
27+ source_in_filename = traits .Bool (False , argstr = '-f' , usedefault = True )
28+ gzip_output = traits .Bool (False , argstr = '-g' , usedefault = True )
29+ id_in_filename = traits .Bool (False , argstr = '-i' , usedefault = True )
30+ nii_output = traits .Bool (True , argstr = '-n' , usedefault = True )
31+ output_dir = Directory (exists = True , argstr = '-o %s' , genfile = True )
32+ protocol_in_filename = traits .Bool (True , argstr = '-p' , usedefault = True )
33+ reorient = traits .Bool (argstr = '-r' )
34+ spm_analyze = traits .Bool (argstr = '-s' , xor = ['nii_output' ])
35+ convert_all_pars = traits .Bool (True , argstr = '-v' , usedefault = True )
36+ reorient_and_crop = traits .Bool (False , argstr = '-x' , usedefault = True )
3337
3438class Dcm2niiOutputSpec (TraitedSpec ):
3539 converted_files = OutputMultiPath (File (exists = True ))
@@ -50,7 +54,7 @@ class Dcm2nii(CommandLine):
5054 >>> converter.inputs.gzip_output = True
5155 >>> converter.inputs.output_dir = '.'
5256 >>> converter.cmdline #doctest: +ELLIPSIS
53- 'dcm2nii -g y -n y -i n -o . -b config.ini functional_1.dcm'
57+ 'dcm2nii -a y -c y -b config.ini -v y -d y -e y -g y - i n -n y - o . -p y -x n -f n functional_1.dcm'
5458 >>> converter.run() # doctest: +SKIP
5559 """
5660
@@ -60,7 +64,10 @@ class Dcm2nii(CommandLine):
6064 _cmd = 'dcm2nii'
6165
6266 def _format_arg (self , opt , spec , val ):
63- if opt in ['gzip_output' , 'nii_output' , 'anonymize' , 'id_in_filename' , 'reorient' , 'reorient_and_crop' , 'convert_all_pars' ]:
67+ if opt in ['anonymize' , 'collapse_folders' , 'date_in_filename' , 'events_in_filename' ,
68+ 'source_in_filename' , 'gzip_output' , 'id_in_filename' , 'nii_output' ,
69+ 'protocol_in_filename' , 'reorient' , 'spm_analyze' , 'convert_all_pars' ,
70+ 'reorient_and_crop' ]:
6471 spec = deepcopy (spec )
6572 if val :
6673 spec .argstr += ' y'
0 commit comments