Skip to content

Commit ff7219b

Browse files
committed
Merge branch 'enh/FixMSLDAoutputConsistency'
* enh/FixMSLDAoutputConsistency: Added depracation information. STYLE: Provide consistent input/output names
2 parents b2fc79c + dafe7ce commit ff7219b

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

nipype/interfaces/freesurfer/model.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,14 @@ class MS_LDAInputSpec(FSTraitedSpec):
782782
desc='filename for the LDA weights (input or output)')
783783
output_synth = traits.File(exists=False, argstr='-synth %s',
784784
mandatory=True,
785-
desc='filename for the synthesized output volume')
785+
desc='filename for the synthesized output volume',
786+
deprecated='0.8',
787+
new_name='vol_synth_file',
788+
xor=['vol_synth_file', 'output_synth'])
789+
vol_synth_file = traits.File(exists=False, argstr='-synth %s',
790+
mandatory=True,
791+
desc='filename for the synthesized output volume',
792+
xor=['vol_synth_file', 'output_synth'])
786793
label_file = traits.File(exists=True, argstr='-label %s',
787794
desc='filename of the label volume')
788795
mask_file = traits.File(exists=True, argstr='-mask %s',
@@ -816,11 +823,11 @@ class MS_LDA(FSCommand):
816823
>>> zero_value = 1
817824
>>> optimalWeights = MS_LDA(lda_labels=[grey_label, white_label], \
818825
label_file='label.mgz', weight_file='weights.txt', \
819-
shift=zero_value, output_synth='synth_out.mgz', \
826+
shift=zero_value, vol_synth_file='synth_out.mgz', \
820827
conform=True, use_weights=True, \
821828
images=['FLASH1.mgz', 'FLASH2.mgz', 'FLASH3.mgz'])
822829
>>> optimalWeights.cmdline
823-
'mri_ms_LDA -conform -label label.mgz -lda 2 3 -synth synth_out.mgz -shift 1 -W -weight weights.txt FLASH1.mgz FLASH2.mgz FLASH3.mgz'
830+
'mri_ms_LDA -conform -label label.mgz -lda 2 3 -shift 1 -W -synth synth_out.mgz -weight weights.txt FLASH1.mgz FLASH2.mgz FLASH3.mgz'
824831
"""
825832

826833
_cmd = 'mri_ms_LDA'
@@ -829,7 +836,10 @@ class MS_LDA(FSCommand):
829836

830837
def _list_outputs(self):
831838
outputs = self._outputs().get()
832-
outputs['vol_synth_file'] = os.path.abspath(self.inputs.output_synth)
839+
if isdefined(self.inputs.output_synth):
840+
outputs['vol_synth_file'] = os.path.abspath(self.inputs.output_synth)
841+
else:
842+
outputs['vol_synth_file'] = os.path.abspath(self.inputs.vol_synth_file)
833843
if not isdefined(self.inputs.use_weights) or self.inputs.use_weights is False:
834844
outputs['weight_file'] = os.path.abspath(self.inputs.weight_file)
835845
return outputs

0 commit comments

Comments
 (0)