[pymvpa] Help with map2nifti()

Yaroslav Halchenko debian at onerussian.com
Sat Nov 2 15:02:25 UTC 2013


do in ipython

map2nifti?

and check out its doc:

Definition: map2nifti(dataset, data=None, imghdr=None, imgtype=None)
Docstring:
Maps data(sets) into the original dataspace and wraps it into an Image.

Parameters
----------
dataset : Dataset
  The mapper of this dataset is used to perform the reverse-mapping.
data : ndarray or Dataset, optional
  The data to be wrapped into NiftiImage. If None (default), it
  would wrap samples of the provided dataset. If it is a Dataset
  instance -- takes its samples for mapping.


so if your res[1] doesn't have the mapper, just give as the first argument the
original dataset which had it and which you gave to searchlight call

On Fri, 01 Nov 2013, Taku Ito wrote:

>    Hi again,
>    I'm having issues with saving searchlight maps back to NIFTI format...
>    I've been using the mvpa2.datasets.mri.map2nifti module and I've tried
>    both
>    map2nifti(res[1])�
>    #and�
>    map2nifti(res[1]).save('s1.nii.gz')
>    But both come back with the
>    AttributeError: 'DatasetAttributesCollection' object has no attribute
>    'mapper'
>    It seems that I have no mapper in my data set object - however, all I've
>    done on the original data set is take out some samples, z-score them, and
>    run an mvpa searchlight analysis with a NFoldPartitioner and Balancer
>    (combined into a chainNode). �It seems that the dimensions of the output
>    data set are essentially the same, minus the fact that the number of
>    samples was reduced from 360 to 150 or so.
>    I have, been able to use the h5save() command for hdf5 files, but would
>    like to get it into NIFTI format so I can view the statistical maps in
>    AFNI. �
>    Please let me know if you have any insights! Your help is appreciated.
>    Taku
-- 
Yaroslav O. Halchenko, Ph.D.
http://neuro.debian.net http://www.pymvpa.org http://www.fail2ban.org
Senior Research Associate,     Psychological and Brain Sciences Dept.
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik        



More information about the Pkg-ExpPsy-PyMVPA mailing list