Skip to content

Commit 4d6e17d

Browse files
committed
Merge pull request #583 from bpinsard/bug/spm/realign
Bug/spm/realign
2 parents 5af03cb + 1dc479e commit 4d6e17d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nipype/interfaces/spm/preprocess.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,15 @@ def _list_outputs(self):
212212
if resliced_mean:
213213
outputs['mean_image'] = fname_presuffix(first_image, prefix='mean')
214214

215+
index_start = 0
216+
if self.inputs.write_which[0]<2:
217+
index_start = 1
215218
if resliced_all:
216219
outputs['realigned_files'] = []
217220
for imgf in filename_to_list(self.inputs.in_files):
218221
realigned_run = []
219222
if isinstance(imgf,list):
220-
for inner_imgf in filename_to_list(imgf):
223+
for inner_imgf[index_start:] in filename_to_list(imgf):
221224
realigned_run.append(fname_presuffix(inner_imgf, prefix=self.inputs.out_prefix))
222225
else:
223226
realigned_run = fname_presuffix(imgf, prefix=self.inputs.out_prefix)

0 commit comments

Comments
 (0)