Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F-Contrasts are not recorded properly #118

Open
TomMaullin opened this issue Feb 27, 2018 · 0 comments
Open

F-Contrasts are not recorded properly #118

TomMaullin opened this issue Feb 27, 2018 · 0 comments

Comments

@TomMaullin
Copy link
Contributor

TomMaullin commented Feb 27, 2018

Error details:

The command run was:

nidmfsl . -g groupname 4

It was run on this directory.

Error message:

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 "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 719, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1504, in run_script
    exec(code, namespace, namespace)
  File "/usr/local/lib/python3.5/dist-packages/nidmfsl-1.2.1-py3.5.egg/EGG-INFO/scripts/nidmfsl", line 46, in <module>
    fslnidm.parse()
  File "/usr/local/lib/python3.5/dist-packages/nidmfsl-1.2.1-py3.5.egg/nidmfsl/fsl_exporter/fsl_exporter.py", line 143, in parse
    super(FSLtoNIDMExporter, self).parse()
  File "/usr/local/lib/python3.5/dist-packages/nidmresults-1.2.1-py3.5.egg/nidmresults/exporter.py", line 104, in parse
    self.contrasts = self._find_contrasts()
  File "/usr/local/lib/python3.5/dist-packages/nidmfsl-1.2.1-py3.5.egg/nidmfsl/fsl_exporter/fsl_exporter.py", line 251, in _find_contrasts
    contrast_name = self._search_in_fsf(name_re)
  File "/usr/local/lib/python3.5/dist-packages/nidmfsl-1.2.1-py3.5.egg/nidmfsl/fsl_exporter/fsl_exporter.py", line 939, in _search_in_fsf
    info = info_found.group('info')
AttributeError: 'NoneType' object has no attribute 'group' 

Suspected Cause:

When looking for contrasts, the FSL viewer looks in the analysis directory (see line 241 of the main exporter code) and counts the number of thresholded maps (i.e. all maps starting with ‘thresh_z’. There are 3 F statistic maps and 2 T statistic maps in this directory so this will result in 5 maps/contrasts recorded.

It then searches the ‘design.fsf’ file looking for the names corresponding to each contrast. It does this by taking the number given in the statistic map filename and looking for a contrast indexed with the same number (e.g. for ‘thresh_zstat2.nii.gz’ it will look for ‘contrast_real 2’ in the ‘design.fsf’ and will find this). It does this with the ‘_search_in_fsf’ in line 251.

This is where we think the bug is as the F contrasts are not listed as ‘contrast_real’ in the ‘design.fsf’. The contrasts corresponding to the thresholded statistic maps ’thresh_zstat2.nii.gz’ and ‘thresh_zfstat2.nii.gz’ will both be exported with the same name and details as they both contain the number 2 in their name. These details will be of the second T contrast not the second F contrast. This is confirmed in the example data pack ‘fsl_con_f’.

The reason for seeing this runtime error in the above we think is that, as there are more F contrasts than T contrasts in this directory, when looking for the 3rd F contrast it can’t find any contrast at all with the number 3 in the ‘design.fsf’.

(Reported by @TomMaullin and @AlexBowring )

@TomMaullin TomMaullin mentioned this issue Mar 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant