File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -384,16 +384,26 @@ class FEAT(FSLCommand):
384
384
def _list_outputs (self ):
385
385
outputs = self ._outputs ().get ()
386
386
is_ica = False
387
+ outputs ['feat_dir' ]= None
387
388
with open (self .inputs .fsf_file , 'rt' ) as fp :
388
389
text = fp .read ()
389
390
if "set fmri(inmelodic) 1" in text :
390
391
is_ica = True
391
-
392
- if is_ica :
393
- outputs ['feat_dir' ] = glob (os .path .join (os .getcwd (), '*ica' ))[0 ]
394
- else :
395
- outputs ['feat_dir' ] = glob (os .path .join (os .getcwd (), '*feat' ))[0 ]
396
-
392
+ for line in text .split ('\n ' ):
393
+ if line .find ("set fmri(outputdir)" )> - 1 :
394
+ try :
395
+ outputdir_spec = line .split ('"' )[- 2 ]
396
+ if os .path .exists (outputdir_spec ):
397
+ outputs ['feat_dir' ]= outputdir_spec
398
+
399
+ except :
400
+ pass
401
+ if not outputs ['feat_dir' ]:
402
+ if is_ica :
403
+ outputs ['feat_dir' ] = glob (os .path .join (os .getcwd (), '*ica' ))[0 ]
404
+ else :
405
+ outputs ['feat_dir' ] = glob (os .path .join (os .getcwd (), '*feat' ))[0 ]
406
+ print 'Outputs from FEATmodel:' ,outputs
397
407
return outputs
398
408
399
409
You can’t perform that action at this time.
0 commit comments