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

Crash due to missing axis #145

Closed mih closed 5 years ago

mih commented 5 years ago

This is what I see:

% nidmfsl sub-01/2ndlvl.gfeat -g controls 3
Exporting NIDM results from /home/mih/forrest/collection/visloc/sub-01/2ndlvl.gfeat
/home/mih/hacking/datalad/nidmresults-fsl/nidmfsl/fsl_exporter/fsl_exporter.py:552: UserWarning: Log file feat4_post not found, connectivity information will not be reported
  "connectivity information will not be reported")
Traceback (most recent call last):
  File "/home/mih/env/datalad3-dev/bin/nidmfsl", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/mih/hacking/datalad/nidmresults-fsl/bin/nidmfsl", line 46, in <module>
    fslnidm.parse()
  File "/home/mih/hacking/datalad/nidmresults-fsl/nidmfsl/fsl_exporter/fsl_exporter.py", line 150, in parse
    super(FSLtoNIDMExporter, self).parse()
  File "/home/mih/env/datalad3-dev/lib/python3.6/site-packages/nidmresults/exporter.py", line 114, in parse
    self.inferences = self._find_inferences()
  File "/home/mih/hacking/datalad/nidmresults-fsl/nidmfsl/fsl_exporter/fsl_exporter.py", line 645, in _find_inferences
    cluster_mm = cluster_mm_tab[:, xcol:(xcol+3)]
IndexError: too many indices for array

Digging in:

ipdb> cluster_mm_tab
array([ 1.00e+00,  2.84e+02,  2.11e-02,  1.68e+00,  2.63e+00,  3.97e+01,
       -4.76e+01, -2.36e+01,  3.99e+01, -5.25e+01, -2.62e+01,  1.88e+02,
        4.22e+01, -5.76e+01, -2.61e+01,  6.68e+01])
ipdb> xcol
5
ipdb> cluster_mm_tab.shape
(16,)
ipdb> cluster_file
['/home/mih/forrest/collection/visloc/sub-01/2ndlvl.gfeat/cope12.feat/cluster_zstat1_std.txt']

and this file looks like this:

% cat /home/mih/forrest/collection/visloc/sub-01/2ndlvl.gfeat/cope12.feat/cluster_zstat1_std.txt
Cluster Index   Voxels  P       -log10(P)       Z-MAX   Z-MAX X (mm)    Z-MAX Y (mm)    Z-MAX Z (mm) Z-COG X (mm)    Z-COG Y (mm)    Z-COG Z (mm)    COPE-MAX        COPE-MAX X (mm) COPE-MAX Y (mm)      COPE-MAX Z (mm) COPE-MEAN
1       284     0.0211  1.68    2.63    39.7    -47.6   -23.6   39.9    -52.5   -26.2   188 42.2     -57.6   -26.1   66.8

Is this possibly triggered by only one cluster being reported?

This analysis output was generated three years ago using 5.0.x