Skip to content

Commit bf0d2b7

Browse files
author
stymy
committed
custom edits to nipype-afni
1 parent 7412c81 commit bf0d2b7

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ def _format_arg(self, name, trait_spec, value):
11081108
def _list_outputs(self):
11091109
outputs = self.output_spec().get()
11101110
if not isdefined(self.inputs.out_file):
1111-
outputs['out_file'] = self._gen_fname(self.inputs.in_file,
1111+
outputs['out_file'] = self._gen_filename(self.inputs.in_file,
11121112
suffix=self.inputs.suffix)
11131113
else:
11141114
outputs['out_file'] = os.path.abspath(self.inputs.out_file)

nipype/interfaces/afni/svm.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,19 @@ class SVMTrainInputSpec(AFNICommandInputSpec):
3737
copyfile=False)
3838
out_file = File(name_template="%s_vectors",
3939
desc='output sum of weighted linear support vectors file name',
40-
argstr='-bucket %s',
40+
argstr='-bucket %s',
41+
suffix='_bucket',
4142
name_source="in_file")
42-
model = traits.Str(name_template="%s_model",
43-
desc='modname is the basename for the brik containing the SVM model',
44-
argstr='-model %s')
45-
alphas = traits.Str(name_template="%s_alphas",
43+
model = File(name_template="%s_model",
44+
desc='basename for the brik containing the SVM model',
45+
argstr='-model %s',
46+
suffix='_model',
47+
name_source="in_file")
48+
alphas = File(name_template="%s_alphas",
4649
desc='output alphas file name',
47-
argstr='-alpha %s')
50+
argstr='-alpha %s',
51+
suffix='_alphas',
52+
name_source="in_file")
4853
mask = File(desc='byte-format brik file used to mask voxels in the analysis',
4954
argstr='-mask %s',
5055
position=-1,
@@ -66,6 +71,11 @@ class SVMTrainInputSpec(AFNICommandInputSpec):
6671
argstr='-wout')
6772
options = traits.Str(desc='additional options for SVM-light', argstr='%s')
6873

74+
class SVMTrainOutputSpec(TraitedSpec):
75+
out_file = File(desc='sum of weighted linear support vectors file name')
76+
model = File(desc='brik containing the SVM model file name')
77+
alphas = File(desc='output alphas file name')
78+
6979
class SVMTrain(AFNICommand):
7080
"""Temporally predictive modeling with the support vector machine
7181
SVM Train Only
@@ -89,7 +99,11 @@ class SVMTrain(AFNICommand):
8999

90100
_cmd = '3dsvm'
91101
input_spec = SVMTrainInputSpec
92-
output_spec = AFNICommandOutputSpec
102+
output_spec = SVMTrainOutputSpec
103+
_additional_metadata = ['suffix']
104+
105+
def _format_arg(self, name, trait_spec, value):
106+
return super(SVMTrain, self)._format_arg(name, trait_spec, value)
93107

94108
class SVMTestInputSpec(AFNICommandInputSpec):
95109
#testing options

0 commit comments

Comments
 (0)