incf-nidash / nidmresults-fsl

A python library to export FSL's feat results to NIDM-Results
http://nidm.nidash.org/specs/nidm-results.html
MIT License
3 stars 10 forks source link

Exporter looks for sigmasquareds.nii.gz for 2nd level F-test analyses #119

Open TomMaullin opened 6 years ago

TomMaullin commented 6 years ago

Error details:

fsl_exporter.py looks forsigmasquareds.nii.gz image in the stats directory, but this does not exist for 2nd level F-test analyses.

Problematic lines in fsl_exporter.py:

Line 343 onwards in the _find_contrasts function.

Error message:

Untitled:pytreat_nidmrandomise maullz$ nidmfsl -g control 4 level2_one_f_test.gfeat/
Exporting NIDM results from /Users/maullz/Desktop/pytreat_nidmrandomise/level2_one_f_test.gfeat
Traceback (most recent call last):
  File "/usr/local/bin/nidmfsl", line 4, in <module>
    __import__('pkg_resources').run_script('nidmfsl==1.2.1', 'nidmfsl')
  File "/Users/maullz/anaconda2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 748, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/Users/maullz/anaconda2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1517, in run_script
    exec(code, namespace, namespace)
  File "/Users/maullz/anaconda2/lib/python2.7/site-packages/nidmfsl-1.2.1-py2.7.egg/EGG-INFO/scripts/nidmfsl", line 47, in <module>
    output_path = fslnidm.export()
  File "/Users/maullz/anaconda2/lib/python2.7/site-packages/nidmresults-1.2.1-py2.7.egg/nidmresults/exporter.py", line 261, in export
    self.add_object(contrast.stderr_or_expl_mean_sq_map)
  File "/Users/maullz/anaconda2/lib/python2.7/site-packages/nidmresults-1.2.1-py2.7.egg/nidmresults/exporter.py", line 124, in add_object
    nidm_object.export(self.version)
  File "/Users/maullz/anaconda2/lib/python2.7/site-packages/nidmresults-1.2.1-py2.7.egg/nidmresults/objects/contrast.py", line 137, in export
    sigma_sq_img = nib.load(self.sigma_sq_file)
  File "/Users/maullz/.local/lib/python2.7/site-packages/nibabel/loadsave.py", line 40, in load
    raise FileNotFoundError("No such file: '%s'" % filename)
nibabel.py3k.FileNotFoundError: No such file: '/Users/maullz/Desktop/pytreat_nidmrandomise/level2_one_f_test.gfeat/cope1.feat/stats/sigmasquareds.nii.gz'

.gfeat directory used to generate error message

Command Run:

nidmfsl -g control 4 level2_one_f_test.gfeat

(Reported by @AlexBowring and @Tommaullin)