@@ -263,15 +263,18 @@ class Dcm2niixInputSpec(CommandLineInputSpec):
263
263
argstr = "%s" ,
264
264
position = - 1 ,
265
265
copyfile = False ,
266
- deprecated = '1.0.2' ,
267
- new_name = 'source_dir' ,
268
266
mandatory = True ,
267
+ desc = ('A set of filenames to be converted. Note that the current '
268
+ 'version (1.0.20180328) of dcm2niix converts any files in the '
269
+ 'directory. To only convert specific files they should be in an '
270
+ 'isolated directory' ),
269
271
xor = ['source_dir' ])
270
272
source_dir = Directory (
271
273
exists = True ,
272
274
argstr = "%s" ,
273
275
position = - 1 ,
274
276
mandatory = True ,
277
+ desc = 'A directory containing dicom files to be converted' ,
275
278
xor = ['source_names' ])
276
279
out_filename = traits .Str (
277
280
argstr = "-f %s" ,
@@ -378,6 +381,18 @@ class Dcm2niix(CommandLine):
378
381
>>> converter.cmdline
379
382
'dcm2niix -b y -z y -5 -x n -t n -m n -o ds005 -s n -v n dicomdir'
380
383
>>> converter.run() # doctest: +SKIP
384
+
385
+ # In the example below, we note that the current version of dcm2niix
386
+ # converts any files in the directory containing the files in the list. We
387
+ # also do not support nested filenames with this option. Thus all files
388
+ # should have a common root directory.
389
+ >>> converter = Dcm2niix()
390
+ >>> converter.inputs.source_names = ['functional_1.dcm', 'functional_2.dcm']
391
+ >>> converter.inputs.compression = 5
392
+ >>> converter.inputs.output_dir = 'ds005'
393
+ >>> converter.cmdline
394
+ 'dcm2niix -b y -z y -5 -x n -t n -m n -o ds005 -s n -v n .'
395
+ >>> converter.run() # doctest: +SKIP
381
396
"""
382
397
383
398
input_spec = Dcm2niixInputSpec
@@ -399,7 +414,7 @@ def _format_arg(self, opt, spec, val):
399
414
spec .argstr += ' n'
400
415
val = True
401
416
if opt == 'source_names' :
402
- return spec .argstr % val [0 ]
417
+ return spec .argstr % ( os . path . dirname ( val [0 ]) or '.' )
403
418
return super (Dcm2niix , self )._format_arg (opt , spec , val )
404
419
405
420
def _run_interface (self , runtime ):
0 commit comments