Skip to content

Commit 1589ff2

Browse files
committed
address 533
1 parent 1a5d620 commit 1589ff2

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

nipype/interfaces/spm/preprocess.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ def _parse_inputs(self):
187187

188188
def _list_outputs(self):
189189
outputs = self._outputs().get()
190+
resliced_all = self.inputs.write_which[0] > 0
191+
resliced_mean = self.inputs.write_which[1] > 0
190192
if isdefined(self.inputs.in_files):
191193
outputs['realignment_parameters'] = []
192194
for imgf in self.inputs.in_files:
@@ -206,16 +208,19 @@ def _list_outputs(self):
206208
else:
207209
first_image = self.inputs.in_files[0]
208210

209-
outputs['mean_image'] = fname_presuffix(first_image, prefix='mean')
210-
outputs['realigned_files'] = []
211-
for imgf in filename_to_list(self.inputs.in_files):
212-
realigned_run = []
213-
if isinstance(imgf,list):
214-
for inner_imgf in filename_to_list(imgf):
215-
realigned_run.append(fname_presuffix(inner_imgf, prefix=self.inputs.out_prefix))
216-
else:
217-
realigned_run = fname_presuffix(imgf, prefix=self.inputs.out_prefix)
218-
outputs['realigned_files'].append(realigned_run)
211+
if resliced_mean:
212+
outputs['mean_image'] = fname_presuffix(first_image, prefix='mean')
213+
214+
if resliced_all:
215+
outputs['realigned_files'] = []
216+
for imgf in filename_to_list(self.inputs.in_files):
217+
realigned_run = []
218+
if isinstance(imgf,list):
219+
for inner_imgf in filename_to_list(imgf):
220+
realigned_run.append(fname_presuffix(inner_imgf, prefix=self.inputs.out_prefix))
221+
else:
222+
realigned_run = fname_presuffix(imgf, prefix=self.inputs.out_prefix)
223+
outputs['realigned_files'].append(realigned_run)
219224
return outputs
220225

221226

0 commit comments

Comments
 (0)