@@ -387,17 +387,21 @@ class Surface2VolTransformInputSpec(FSTraitedSpec):
387
387
copyfile = False , mandatory = True ,
388
388
desc = 'This is the source of the surface values' )
389
389
hemi = traits .Str (argstr = '--hemi %s' , mandatory = True , desc = 'hemisphere of data' )
390
- transformed_file = File (desc = 'Output volume' , argstr = '--outvol %s' , genfile = True )
390
+ transformed_file = File (name_template = "%s_asVol.nii" , desc = 'Output volume' , argstr = '--outvol %s' ,
391
+ name_source = ['source_file' ], hash_files = False )
391
392
reg_file = File (exists = True , argstr = '--volreg %s' ,
392
393
mandatory = True ,
393
394
desc = 'tkRAS-to-tkRAS matrix (tkregister2 format)' ,
394
- xor = ['subject_id' ])
395
+ xor = ['subject_id' ])
395
396
template_file = File (exists = True , argstr = '--template %s' ,
396
397
desc = 'Output template volume' )
397
398
mkmask = traits .Bool (desc = 'make a mask instead of loading surface values' , argstr = '--mkmask' )
398
- vertexvol_file = File (desc = 'Path name of the vertex output volume, which is the same as output volume except that the value of each voxel is the vertex-id that is mapped to that voxel.' , argstr = '--vtxvol %s' , genfile = True )
399
- surf_file = File (exists = True , argstr = '--surf %s' ,desc = 'surfname (default is white)' )
400
- projfrac_file = traits .Float (exists = True , argstr = '--projfrac %s' ,desc = 'thickness fraction' )
399
+ vertexvol_file = File (name_template = "%s_asVol_vertex.nii" , desc = 'Path name of the vertex output '
400
+ 'volume, which is the same as output volume except that the value of each '
401
+ 'voxel is the vertex-id that is mapped to that voxel.' ,
402
+ argstr = '--vtxvol %s' , name_source = ['source_file' ], hash_files = False )
403
+ surf_name = traits .Str (exists = True , argstr = '--surf %s' ,desc = 'surfname (default is white)' )
404
+ projfrac = traits .Float (exists = True , argstr = '--projfrac %s' ,desc = 'thickness fraction' )
401
405
subjects_dir = traits .Str (argstr = '--sd %s' ,desc = 'freesurfer subjects directory defaults to $SUBJECTS_DIR' )
402
406
subject_id = traits .Str (argstr = '--identity %s' ,desc = 'subject id' , xor = ['reg_file' ])
403
407
@@ -417,6 +421,9 @@ class Surface2VolTransform(FSCommand):
417
421
>>> xfm2vol.inputs.reg_file = 'register.mat'
418
422
>>> xfm2vol.inputs.hemi = 'lh'
419
423
>>> xfm2vol.inputs.template_file = 'cope1.nii.gz'
424
+ >>> xfm2vol.inputs.subjects_dir = '.'
425
+ >>> xfm2vol.cmdline
426
+ 'mri_surf2vol --hemi lh --volreg register.mat --surfval lh.cope1.mgz --sd . --template cope1.nii.gz --outvol lh.cope1_asVol.nii --vtxvol lh.cope1_asVol_vertex.nii'
420
427
>>> res = xfm2vol.run()# doctest: +SKIP
421
428
422
429
"""
@@ -425,23 +432,6 @@ class Surface2VolTransform(FSCommand):
425
432
input_spec = Surface2VolTransformInputSpec
426
433
output_spec = Surface2VolTransformOutputSpec
427
434
428
- def _get_outfile (self ):
429
- outfile = self .inputs .transformed_file
430
- if not isdefined (outfile ):
431
- outfile = self ._gen_fname (self .inputs .source_file ,
432
- suffix = '_asVol' )
433
- return outfile
434
-
435
- def _list_outputs (self ):
436
- outputs = self .output_spec ().get ()
437
- outputs ['transformed_file' ] = self ._get_outfile ()
438
- return outputs
439
-
440
- def _gen_filename (self , name ):
441
- if name == 'transformed_file' :
442
- return self ._get_outfile ()
443
- return None
444
-
445
435
class ApplyMaskInputSpec (FSTraitedSpec ):
446
436
447
437
in_file = File (exists = True , mandatory = True , position = - 3 , argstr = "%s" ,
0 commit comments