Skip to content

Commit 2c42ff4

Browse files
committed
Call super for all SPM _format_args()
1 parent 0852855 commit 2c42ff4

File tree

2 files changed

+11
-21
lines changed

2 files changed

+11
-21
lines changed

nipype/interfaces/spm/model.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def _format_arg(self, opt, spec, val):
117117
return [val]
118118
else:
119119
return val
120-
return val
120+
return super(Level1Design, self)._format_arg(opt, spec, val)
121121

122122
def _parse_inputs(self):
123123
"""validate spm realign options if set to None ignore
@@ -200,7 +200,7 @@ def _format_arg(self, opt, spec, val):
200200
return {'%s' % val: 1}
201201
else:
202202
return val
203-
return val
203+
return super(EstimateModel, self)._format_arg(opt, spec, val)
204204

205205
def _parse_inputs(self):
206206
"""validate spm realign options if set to None ignore
@@ -747,7 +747,7 @@ def _format_arg(self, opt, spec, val):
747747
outdict[mapping[key]] = keyval
748748
outlist.append(outdict)
749749
return outlist
750-
return val
750+
return super(FactorialDesign, self)._format_arg(opt, spec, val)
751751

752752
def _parse_inputs(self):
753753
"""validate spm realign options if set to None ignore
@@ -893,8 +893,6 @@ def _format_arg(self, opt, spec, val):
893893
"""
894894
if opt in ['in_files']:
895895
return np.array(val, dtype=object)
896-
if opt in ['include_intercept']:
897-
return int(val)
898896
if opt in ['user_covariates']:
899897
outlist = []
900898
mapping = {'name': 'cname', 'vector': 'c',

nipype/interfaces/spm/preprocess.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def _format_arg(self, opt, spec, val):
8787
return scans_for_fnames(filename_to_list(val),
8888
keep4d=False,
8989
separate_sessions=True)
90-
return val
90+
return super(SliceTiming, self)._format_arg(opt, spec, val)
9191

9292
def _list_outputs(self):
9393
outputs = self._outputs().get()
@@ -177,9 +177,7 @@ def _format_arg(self, opt, spec, val):
177177
return scans_for_fnames(val,
178178
keep4d=True,
179179
separate_sessions=True)
180-
if opt == 'register_to_mean': # XX check if this is necessary
181-
return int(val)
182-
return val
180+
return super(Realign, self)._format_arg(opt, spec, val)
183181

184182
def _parse_inputs(self):
185183
"""validate spm realign options if set to None ignore
@@ -296,7 +294,7 @@ def _format_arg(self, opt, spec, val):
296294
return scans_for_fnames(val+self.inputs.apply_to_files)
297295
else:
298296
return scans_for_fnames(val)
299-
return val
297+
return super(Coregister, self)._format_arg(opt, spec, val)
300298

301299
def _parse_inputs(self):
302300
"""validate spm coregister options if set to None ignore
@@ -560,13 +558,11 @@ def _format_arg(self, opt, spec, val):
560558
return scans_for_fname(val)
561559
if 'output_type' in opt:
562560
return [int(v) for v in val]
563-
if opt == 'save_bias_corrected':
564-
return int(val)
565561
if opt == 'mask_image':
566562
return scans_for_fname(val)
567563
if opt == 'clean_masks':
568564
return clean_masks_dict[val]
569-
return val
565+
return super(Segment, self)._format_arg(opt, spec, val)
570566

571567
def _list_outputs(self):
572568
outputs = self._outputs().get()
@@ -785,10 +781,8 @@ def _format_arg(self, opt, spec, val):
785781
return [val[0], val[0], val[0]]
786782
else:
787783
return val
788-
if opt == 'implicit_masking':
789-
return int(val)
790784

791-
return val
785+
return super(Smooth, self)._format_arg(opt, spec, val)
792786

793787
def _list_outputs(self):
794788
outputs = self._outputs().get()
@@ -879,7 +873,7 @@ def _format_arg(self, opt, spec, val):
879873
new_param['its'] = val[2]
880874
return [new_param]
881875
else:
882-
return val
876+
return super(DARTEL, self)._format_arg(opt, spec, val)
883877

884878
def _list_outputs(self):
885879
outputs = self._outputs().get()
@@ -965,10 +959,8 @@ def _format_arg(self, opt, spec, val):
965959
return val
966960
else:
967961
return [val, val, val]
968-
elif opt == 'modulate':
969-
return int(val)
970962
else:
971-
return val
963+
return super(DARTELNorm2MNI, self)._format_arg(opt, spec, val)
972964

973965
def _list_outputs(self):
974966
outputs = self._outputs().get()
@@ -1040,7 +1032,7 @@ def _format_arg(self, opt, spec, val):
10401032
if opt in ['flowfield_files']:
10411033
return scans_for_fnames(val, keep4d=True)
10421034
else:
1043-
return val
1035+
return super(CreateWarped, self)._format_arg(opt, spec, val)
10441036

10451037
def _list_outputs(self):
10461038
outputs = self._outputs().get()

0 commit comments

Comments
 (0)