[pymvpa] problem with reverse mapper

Serin Atiani, Dr serin.atiani at mail.mcgill.ca
Wed Apr 22 13:22:30 UTC 2015

Hello all, 

I am doing basic analysis, mostly following the steps of the tutorial. I am trying to reverse the mappers in order to project the features I am interested in back into Nifti file. I am getting the error below. Any thoughts what I am doing wrong?


>>> print fds_p.a.mapper
<Chain: <Flatten>-<StaticFeatureSelection>-<PolyDetrend: ord=1>-<ZScore>-<Fx: fx=mean>>
>>> fds_p.nfeatures
>>> revtest=np.arange(100, 100+fds_p.nfeatures)
>>> rmapped=fds_p.a.mapper.reverse1(revtest)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/mvpa2/mappers/base.py", line 343, in reverse1
    mp = self[:-1 * i].reverse(mp)
  File "/usr/lib/python2.7/dist-packages/mvpa2/mappers/base.py", line 308, in reverse
    mp = m.reverse(mp)
  File "/usr/lib/python2.7/dist-packages/mvpa2/mappers/base.py", line 238, in reverse
    return self._reverse_data(data)
  File "/usr/lib/python2.7/dist-packages/mvpa2/featsel/base.py", line 149, in _reverse_data
    mapped[:, self._slicearg] = data
ValueError: array is not broadcastable to correct shape

More information about the Pkg-ExpPsy-PyMVPA mailing list