Skip to content

Commit 72b7a34

Browse files
committed
enh: added new options to apply volume transform
1 parent 038b9e9 commit 72b7a34

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

nipype/interfaces/freesurfer/preprocess.py

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,8 @@ class ApplyVolTransformInputSpec(FSTraitedSpec):
784784
desc='Output template volume', mandatory=True)
785785
tal = traits.Bool(argstr='--tal', xor=_targ_xor, mandatory=True,
786786
desc='map to a sub FOV of MNI305 (with --reg only)')
787+
tal_resolution = traits.Float(argstr="--talres %.10f",
788+
desc="Resolution to sample when using tal")
787789
fs_target = traits.Bool(argstr='--fstarg', xor=_targ_xor, mandatory=True,
788790
requires=['reg_file'],
789791
desc='use orig.mgz from subject in regfile as target')
@@ -805,10 +807,30 @@ class ApplyVolTransformInputSpec(FSTraitedSpec):
805807
desc='set matrix = identity and use subject for any templates')
806808
inverse = traits.Bool(desc='sample from target to source',
807809
argstr='--inv')
808-
interp = traits.Enum('trilin', 'nearest', argstr='--interp %s',
810+
interp = traits.Enum('trilin', 'nearest', 'cubic', argstr='--interp %s',
809811
desc='Interpolation method (<trilin> or nearest)')
810812
no_resample = traits.Bool(desc='Do not resample; just change vox2ras matrix',
811813
argstr='--no-resample')
814+
m3z_file = File(argstr="--m3z %s",
815+
desc=('This is the morph to be applied to the volume. '
816+
'Unless the morph is in mri/transforms (eg.: for '
817+
'talairach.m3z computed by reconall), you will need '
818+
'to specify the full path to this morph and use the '
819+
'--noDefM3zPath flag.'))
820+
no_ded_m3z_path = traits.Bool(argstr="--noDefM3zPath",
821+
requires=['m3z_file'],
822+
desc=('To be used with the m3z flag. '
823+
'Instructs the code not to look for the'
824+
'm3z morph in the default location '
825+
'(SUBJECTS_DIR/subj/mri/transforms), '
826+
'but instead just use the path '
827+
'indicated in --m3z.'))
828+
829+
invert_morph = traits.Bool(argstr="--inv-morph",
830+
requires=['m3z_file'],
831+
desc=('Compute and use the inverse of the '
832+
'non-linear morph to resample the input '
833+
'volume. To be used by --m3z.'))
812834

813835

814836
class ApplyVolTransformOutputSpec(TraitedSpec):
@@ -853,7 +875,7 @@ def _get_outfile(self):
853875

854876
def _list_outputs(self):
855877
outputs = self.output_spec().get()
856-
outputs['transformed_file'] = self._get_outfile()
878+
outputs['transformed_file'] = os.path.abspath(self._get_outfile())
857879
return outputs
858880

859881
def _gen_filename(self, name):
@@ -1192,11 +1214,3 @@ def _gen_filename(self, name):
11921214
if name == "out_file":
11931215
return self._list_outputs()["out_file"]
11941216
return None
1195-
1196-
'''
1197-
interfaces to do:
1198-
1199-
mri_vol2surf
1200-
mri_surf2vol
1201-
mri_surf2surf
1202-
'''

0 commit comments

Comments
 (0)