Hi,
I am trying to run a decoding analysis and as far as I can tell I've been matching the tutorial:
import neurosynth as ns
import numpy
from neurosynth.base.dataset import Dataset
from neurosynth.analysis import decode
baseDir = '/Volumes/rtpinf/'
nsDir = '/Volumes/pinfadol/behavReplication/neurosynthData/'
saveLoc = baseDir+'nsDecodeResults/modelResults.txt'
dataset = Dataset.load(nsDir+'dataset.pkl')
decoder = decode.Decoder(dataset, features=['social'])
result = decoder.decode('social.nii.gz', save=saveLoc)
, but I keep getting these warnings/errors:
/Users/maorloff/.pyenv/versions/2.7.7/lib/python2.7/site-packages/neurosynth/analysis/meta.py:136: RuntimeWarning: invalid value encountered in divide
pFgA = pAgF * pF / pA
/Users/maorloff/.pyenv/versions/2.7.7/lib/python2.7/site-packages/neurosynth/analysis/meta.py:141: RuntimeWarning: invalid value encountered in divide
pFgA_prior = pAgF * prior / pA_prior
Traceback (most recent call last):
File "decodeFromNeurosynth.py", line 19, in <module>
result = decoder.decode('social.nii.gz', save=saveLoc)
File "/Users/maorloff/.pyenv/versions/2.7.7/lib/python2.7/site-packages/neurosynth/analysis/decode.py", line 90, in decode
imgs_to_decode = imageutils.load_imgs(images, self.masker)
File "/Users/maorloff/.pyenv/versions/2.7.7/lib/python2.7/site-packages/neurosynth/base/imageutils.py", line 57, in load_imgs
data[:, i] = masker.mask(f, nan_to_num)
File "/Users/maorloff/.pyenv/versions/2.7.7/lib/python2.7/site-packages/neurosynth/base/mask.py", line 162, in mask
masked_data = image[self.current_mask]
IndexError: boolean index did not match indexed array along dimension 0; dimension is 153594 but corresponding boolean dimension is 902629
Any idea what is going on? I've tried the current version as well as the version on the github repo. I've also tried with Python 2.7 (as shown above) and Python 3.5.
Thanks!
Mark