Skip to content

Commit f380f5b

Browse files
committed
ref: use info in fsf file to get output directory
1 parent 5fb85ef commit f380f5b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

nipype/interfaces/fsl/model.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,17 @@ class FEAT(FSLCommand):
383383

384384
def _list_outputs(self):
385385
outputs = self._outputs().get()
386-
try:
387-
outputs['feat_dir'] = glob(os.path.join(os.getcwd(), '*feat'))[0]
388-
except:
389-
# in case FEAT was used to run an ICA job
386+
is_ica = False
387+
with open(self.inputs.fsf_file, 'rt') as fp:
388+
text = fp.read()
389+
if "set fmri(inmelodic) 1" in text:
390+
is_ica = True
391+
392+
if is_ica:
390393
outputs['feat_dir'] = glob(os.path.join(os.getcwd(), '*ica'))[0]
391-
394+
else:
395+
outputs['feat_dir'] = glob(os.path.join(os.getcwd(), '*feat'))[0]
396+
392397
return outputs
393398

394399

0 commit comments

Comments
 (0)