Skip to content

Commit 7ba99dc

Browse files
committed
FIX: Check for multi-dim array before adding headers
1 parent d6ae63d commit 7ba99dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nipype/algorithms/confounds.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@ def _run_interface(self, runtime):
449449
pre_filter_file = self._list_outputs()['pre_filter_file']
450450
ftype = {'polynomial': 'poly',
451451
'cosine': 'cos'}[self.inputs.pre_filter]
452-
header = ['{}{:02d}'.format(ftype, i)
453-
for i in range(filter_basis.shape[1])]
452+
ncols = filter_basis.shape[1] if filter_basis.size > 0 else 0
453+
header = ['{}{:02d}'.format(ftype, i) for i in range(ncols)]
454454
np.savetxt(pre_filter_file, filter_basis, fmt=b'%.10f',
455455
delimiter='\t', header='\t'.join(header), comments='')
456456

0 commit comments

Comments
 (0)