[pymvpa] writing a NIfTI file from PyMVPA

Michael Hanke michael.hanke at gmail.com
Thu Mar 12 15:38:30 UTC 2009


On Thu, Mar 12, 2009 at 04:31:08PM +0100, Jo Etzel wrote:
> Thanks!!
> 
> That works perfectly. I'd found .map2Nifti but not the .save part.

Information about the .save part can be found here, since map2Nifti
yields a 'NiftiImage' object:

  http://niftilib.sourceforge.net/pynifti/modref.html#niftiimage

Cheers,

Michael

> Yaroslav Halchenko wrote:
> > o o -- that example had no magic function exposed...
> > 
> > use
> > 
> > dataset.map2Nifti(sl_map).save('bugi.nii.gz')
> > 
> > or
> > 
> > dataset.map2Nifti(sl_map).save('bugi.img', filetype='ANALYZE')
> > 
> > for analyze iirc
> > 
> > On Thu, 12 Mar 2009, Jo Etzel wrote:
> > 
> >> I would like to write a NifTI (or even better, Analyze img/hdr format; 
> >> but I can convert a NifTI file of course) from within PyMVPA. Is there 
> >> an easy way to do this?
> > 
> >> Specifically, I've been trying some variations of the searchlight_2d.py 
> >> example with my own (3D) images, and would like to view the output 
> >> (sl_map in the example) as a 3D image. I think that the
> > 
> >> orig_sl_map = dataset.mapReverse(N.array(sl_map))
> >> masked_orig_sl_map = N.ma.masked_array(orig_sl_map, mask=orig_sl_map == 0)
> > 
> >> lines from the example put the sl_map into the right space, but I'm not 
> >> sure what to do next.
> > 
> >> Thanks in advance for your help,
> >> Jo
> > 
> >> _______________________________________________
> >> Pkg-ExpPsy-PyMVPA mailing list
> >> Pkg-ExpPsy-PyMVPA at lists.alioth.debian.org
> >> http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pymvpa
> > 
> > 
> 
> _______________________________________________
> Pkg-ExpPsy-PyMVPA mailing list
> Pkg-ExpPsy-PyMVPA at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pymvpa

-- 
GPG key:  1024D/3144BE0F Michael Hanke
http://apsy.gse.uni-magdeburg.de/hanke
ICQ: 48230050



More information about the Pkg-ExpPsy-PyMVPA mailing list