Skip to content

Commit 8ec1560

Browse files
committed
use glob to be tolerant with output naming
1 parent a6ff630 commit 8ec1560

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nipype/interfaces/fsl/preprocess.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import os
1515
import os.path as op
1616
import warnings
17+
import glob
1718

1819
import numpy as np
1920

@@ -1593,9 +1594,11 @@ def _gen_fname(self, name):
15931594

15941595

15951596
if name == 'original_segmentations':
1596-
return op.abspath('%s_all_none_origsegs.nii.gz' % outname)
1597+
fnames = glob.glob(op.abspath('%s_all_*_origsegs.nii.gz' % outname))
1598+
return op.abspath(fnames[0])
15971599
if name == 'segmentation_file':
1598-
return op.abspath('%s_all_none_firstseg.nii.gz' % outname)
1600+
fnames = glob.glob(op.abspath('%s_all_*_firstseg.nii.gz' % outname))
1601+
return op.abspath(fnames[0])
15991602

16001603
return None
16011604

0 commit comments

Comments
 (0)