[pymvpa] "TypeError: save() takes exactly 3 arguments (2 given)" under pympva 0.6
Yaroslav Halchenko
debian at onerussian.com
Sun Mar 27 17:22:36 UTC 2011
On Sun, 27 Mar 2011, Meng Liang wrote:
> I am trying to save the sensitivity map into a nifti file (nii.gz)
> using map2nifti().save(filename), however, the following error appears:
> ========
> >>>map2nifti(ds, N.mean(sensmap_cv, axis=0)).save('test.nii.gz')
> TypeError: save() takes exactly 3 arguments (2 given)
> ========
> I am working with pymvpa 0.6 in Neurodebian virtual machine (64bit
> windows 7). By the way, the similar function used to work when I was
> using pymvpa 0.4.7.
sorry -- many things have changed from 0.4 to 0.6, in particular instead
of PyNIFTI we rely on nibabel now.
and there is .save available but it is a "class method" thus
requires both class (takes your generated nifti) and then requires
actual instance (you would need to provide it again)...
proper workaround would be to replace use of .save with .to_filename,
which is defined at instance level and would work as the pynifti's save.
so just do .to_filename('test.nii.gz').
sorry about that
--
=------------------------------------------------------------------=
Keep in touch www.onerussian.com
Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic
More information about the Pkg-ExpPsy-PyMVPA
mailing list