Skip to content

Commit 3f7253f

Browse files
committed
Conflicts: nipype/interfaces/afni/preprocess.py
2 parents 29a5b6a + 6acfc25 commit 3f7253f

File tree

3 files changed

+60
-2
lines changed

3 files changed

+60
-2
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ class AutoTcorrelateInputSpec(AFNICommandInputSpec):
330330
mask_only_targets = traits.Bool(desc="use mask only on targets voxels",
331331
argstr="-mask_only_targets",
332332
xor=['mask_source'])
333-
333+
argstr="-mask_only_targets")
334334
mask_source = File(exists=True,
335335
desc="mask for source voxels",
336336
argstr="-mask_source %s",

nipype/interfaces/freesurfer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from .base import Info, FSCommand
66
from .preprocess import (ParseDICOMDir, UnpackSDICOMDir, MRIConvert, Resample,
7-
ReconAll, BBRegister, ApplyVolTransform, Smooth,
7+
ReconAll, BBRegister, ApplyVolTransform, Surface2VolTransform, Smooth,
88
DICOMConvert, RobustRegister, FitMSParams,
99
SynthesizeFLASH)
1010
from .model import (MRISPreproc, GLMFit, OneSampleTTest, Binarize, Concatenate,

nipype/interfaces/freesurfer/preprocess.py

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,64 @@ def _gen_filename(self, name):
10211021
return self._get_outfile()
10221022
return None
10231023

1024+
class Surface2VolTransformInputSpec(FSTraitedSpec):
1025+
source_file = File(exists=True, argstr='--surfval %s',
1026+
copyfile=False, mandatory=True,
1027+
desc='This is the source of the surface values')
1028+
hemi = traits.Str(argstr='--hemi %s',desc='hemisphere of data')
1029+
transformed_file = File(desc='Output volume', argstr='--outvol %s', genfile=True)
1030+
reg_file = File(exists=True, argstr='--volreg %s',
1031+
mandatory=True,
1032+
desc='tkRAS-to-tkRAS matrix (tkregister2 format)')
1033+
template_file = File(exists=True, argstr='--template %s',
1034+
desc='Output template volume')
1035+
mkmask = traits.Bool(desc='make a mask instead of loading surfval', argstr='--mkmask')
1036+
vertexvol_file = File(desc='vertex map volume path id', argstr='--vtxvol %s', genfile=True)
1037+
surf_file = File(exists=True, argstr='--surf %s',desc='surfname (default is white)')
1038+
projfrac_file = File(exists=True, argstr='--projfrac %s',desc='thickness fraction')
1039+
subjects_dir = traits.Str(argstr='--sd %s',desc='freesurfer subjects directory defaults to $SUBJECTS_DIR')
1040+
identity = traits.Str(argstr='--identity %s',desc='use identity (must supply subject name)')
1041+
1042+
class Surface2VolTransformOutputSpec(TraitedSpec):
1043+
transformed_file = File(exists=True, desc='Path to output file if used normally')
1044+
vertexvol_file = File(desc='vertex map volume path id. Optional')
1045+
1046+
class Surface2VolTransform(FSCommand):
1047+
"""Use FreeSurfer mri_surf2vol to apply a transform.
1048+
1049+
Examples
1050+
--------
1051+
1052+
>>> from nipype.interfaces.freesurfer import Surface2VolTransform
1053+
>>> xfm2vol = Surface2VolTransform()
1054+
>>> xfm2vol.inputs.source_file = 'surface.nii'
1055+
>>> xfm2vol.inputs.reg_file = 'register.dat'
1056+
>>> xfm2vol.inputs.hemi = 'lh'
1057+
>>> xfm2vol.cmdline
1058+
'mri_surf2vol --volreg register.dat --surfval structural.nii --hemi lh'
1059+
1060+
"""
1061+
1062+
_cmd = 'mri_surf2vol'
1063+
input_spec = Surface2VolTransformInputSpec
1064+
output_spec = Surface2VolTransformOutputSpec
1065+
1066+
def _get_outfile(self):
1067+
outfile = self.inputs.transformed_file
1068+
if not isdefined(outfile):
1069+
outfile = self._gen_fname(self.inputs.source_file,
1070+
suffix='_xfm2vol')
1071+
return outfile
1072+
1073+
def _list_outputs(self):
1074+
outputs = self.output_spec().get()
1075+
outputs['transformed_file'] = self._get_outfile()
1076+
return outputs
1077+
1078+
def _gen_filename(self, name):
1079+
if name == 'transformed_file':
1080+
return self._get_outfile()
1081+
return None
10241082

10251083
class SmoothInputSpec(FSTraitedSpec):
10261084
in_file = File(exists=True, desc='source volume',

0 commit comments

Comments
 (0)