guruucsd / lateralized-components

Submission to OHBM 2016 on functional lateralization using the neurovault dataset.
0 stars 2 forks source link

hemi_mask_data TypeError #61

Closed atsuch closed 7 years ago

atsuch commented 7 years ago

When using the hemi_mask.fit in nilearn_ext/masking.py, I get a TypeError;

File "/home/ami/Documents/Work/imaging/RL_ICA/OHBM-2016/image_analysis/sparsity.py", line 60, in get_hemi_sparsity gm_mask = get_mask_by_key(hemi) File "/home/ami/Documents/Work/imaging/RL_ICA/OHBM-2016/nilearn_ext/masking.py", line 131, in get_mask_by_key gm_imgs = split_bilateral_rois(gm_img) File "/home/ami/Documents/Work/imaging/RL_ICA/OHBM-2016/nilearn_ext/masking.py", line 103, in split_bilateral_rois hemi_mask.fit(map_img) File "/home/ami/Documents/Work/imaging/RL_ICA/OHBM-2016/nilearn_ext/masking.py", line 195, in fit hemi_mask_data[other_hemi_slice] = False TypeError: slice indices must be integers or None or have an index method

I vaguely remember getting a deprecation warning before... but anyway wanted to check with you @bcipolli.

bcipolli commented 7 years ago

I didn't hit this in my code, even after upgrading numpy. Can you specify how to replicate?

atsuch commented 7 years ago

So I get this error, simply by calling get_mask_by_key(hemi), where hemi is 'R'. It seems to be fine if the hemisphere key is 'wb'.

I tried this in jupyter notebook. You can see if you can replicate the problem simply by

from nilearn_ext.masking import get_mask_by_key r_mask=get_mask_by_key('R')

bcipolli commented 7 years ago

Fixed in c23ca111d46e5055ed2dcaf7abad1b234dafd0be