Skip to content

Commit 31b4927

Browse files
committed
output center of mass always as a list
1 parent 46c4fc6 commit 31b4927

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

nipype/interfaces/afni/utils.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -694,10 +694,8 @@ class CenterMassOutputSpec(TraitedSpec):
694694
desc='output file')
695695
cm_file = File(
696696
desc='file with the center of mass coordinates')
697-
cm = traits.Either(
697+
cm = traits.List(
698698
traits.Tuple(traits.Float(), traits.Float(), traits.Float()),
699-
traits.List(traits.Tuple(traits.Float(), traits.Float(),
700-
traits.Float())),
701699
desc='center of mass')
702700

703701

@@ -735,10 +733,7 @@ def _list_outputs(self):
735733
outputs['out_file'] = os.path.abspath(self.inputs.in_file)
736734
outputs['cm_file'] = os.path.abspath(self.inputs.cm_file)
737735
sout = np.loadtxt(outputs['cm_file'], ndmin=2) # pylint: disable=E1101
738-
if len(sout) > 1:
739-
outputs['cm'] = [tuple(s) for s in sout]
740-
else:
741-
outputs['cm'] = tuple(sout[0])
736+
outputs['cm'] = [tuple(s) for s in sout]
742737
return outputs
743738

744739

0 commit comments

Comments
 (0)