Skip to content

Commit 17151d6

Browse files
authored
Merge pull request #2352 from oesteban/fix/vol2surf
[FIX] Fix surf_reg input trait
2 parents 9be816e + 2daabf0 commit 17151d6

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

nipype/interfaces/freesurfer/tests/test_auto_SampleToSurface.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def test_SampleToSurface_inputs():
9393
),
9494
subject_id=dict(),
9595
subjects_dir=dict(),
96-
surf_reg=dict(argstr='--surfreg',
96+
surf_reg=dict(argstr='--surfreg %s',
9797
requires=['target_subject'],
9898
),
9999
surface=dict(argstr='--surf %s',

nipype/interfaces/freesurfer/utils.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,9 @@ class SampleToSurfaceInputSpec(FSTraitedSpec):
139139
subject_id = traits.String(desc="subject id")
140140
target_subject = traits.String(argstr="--trgsubject %s",
141141
desc="sample to surface of different subject than source")
142-
surf_reg = traits.Bool(argstr="--surfreg", requires=["target_subject"],
143-
desc="use surface registration to target subject")
142+
surf_reg = traits.Either(traits.Bool, traits.Str(),
143+
argstr="--surfreg %s", requires=["target_subject"],
144+
desc="use surface registration to target subject")
144145
ico_order = traits.Int(argstr="--icoorder %d", requires=["target_subject"],
145146
desc="icosahedron order when target_subject is 'ico'")
146147

@@ -238,6 +239,10 @@ def _format_arg(self, name, spec, value):
238239

239240
if value in implicit_filetypes:
240241
return ""
242+
if name == 'surf_reg':
243+
if value is True:
244+
return spec.argstr % 'sphere.reg'
245+
241246
return super(SampleToSurface, self)._format_arg(name, spec, value)
242247

243248
def _get_outfilename(self, opt="out_file"):

0 commit comments

Comments
 (0)