Skip to content

Commit 5ecbbec

Browse files
committed
FIX: update _format_arg to accommodate optimization string and output integer
1 parent 51e5a79 commit 5ecbbec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nipype/interfaces/freesurfer/petsurfer.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ class GTMPVCInputSpec(FSTraitedSpec):
370370

371371
optimization_schema = traits.Enum(
372372
"3D", "2D", "1D", "3D_MB", "2D_MB", "1D_MB", "MBZ", "MB3",
373-
argstr="--opt %i", desc="opt : optimization schema for applying adaptive GTM"
373+
argstr="--opt %s", desc="opt : optimization schema for applying adaptive GTM"
374374
)
375375

376376
opt_tol = traits.Tuple(
@@ -477,6 +477,11 @@ class GTMPVC(FSCommand):
477477
input_spec = GTMPVCInputSpec
478478
output_spec = GTMPVCOutputSpec
479479

480+
def _format_arg(self, name, spec, val):
481+
if name == 'optimization_schema':
482+
return spec.argstr%{"3D":0, "2D":1, "1D":2, "3D_MB":3, "2D_MB":4, "1D_MB":5, "MBZ":6, "MB3":7}[val]
483+
return super(GTMPVC, self)._format_arg(name, spec, val)
484+
480485
def _list_outputs(self):
481486
outputs = self.output_spec().get()
482487
# Get the top-level output directory

0 commit comments

Comments
 (0)