nltools
nltools copied to clipboard
Error while running Neurovault I/O example
Hello, I am getting an error while running the example for Neurovault I/O-
File "nltools-decomposition.py", line 5, in <module>
data = Brain_Data(files,X=metadata)
File "/home/ssouravsingh12/.local/lib/python2.7/site-packages/nltools/data/brain_data.py", line 116, in __init__
self.mask = nib.load(resolve_mni_path(MNI_Template)['mask'])
File "/home/ssouravsingh12/.local/lib/python2.7/site-packages/nibabel/loadsave.py", line 42, in load
raise FileNotFoundError("No such file or no access: '%s'" % filename)
nibabel.py3k.FileNotFoundError: No such file or no access: '/home/ssouravsingh12/.local/lib/python2.7/site-packages/nltools/resources/MNI152_T1_2mm_brain_mask.nii.gz'
Do we need to download the brain mask through external means?
Hmm... that's strange. It should be installed with the package. Did you use pip or git clone?
I used pip to install the package.
I was able to bypass the problem by importing the brain mask from nilearn.datasets and passing it as a parameter to mask as shown here-
from nltools.datasets import download_collection
from nltools.data import Brain_Data
from nilearn.datasets import load_mni152_brain_mask
metadata,files = download_collection(collection=2099)
data = Brain_Data(files,X=metadata, mask = load_mni152_brain_mask())
Thanks, I'll check and see if something changed in the setup.py file recently.