[pymvpa] load raw 'not nifti' data

Michael Waskom mwaskom at stanford.edu
Wed Oct 5 22:53:50 UTC 2011


As I understand the question, you want to use morphometric data that's been
transformed into some standard space (i.e. you've run recon-all -qcache), so
actually you wouldn't use read_morph_data (which only applies to the
morphometric data files in the format that gets spit out of recon-all) but
rather read_scalar_data, which will read in either Freesurfer .mg{hz} files
(which is probably the format your data are in) or anything that's readable
by nibabel.  Note that it will always just return a vector of datapoints
matching the vertices in surface the scalar data file, even if the
underlying data is a "reshaped" nifiti file which is probably what you want
anyway if you're sticking it together into a dataset sample matrix.

The other upside of installing PySurfer is that you can then display pretty
MVPA results with a lot more flexibility than tksurfer offers you :)

Best,
Michael

On Tue, Oct 4, 2011 at 7:02 PM, Yaroslav Halchenko <debian at onerussian.com>wrote:

> another possible (haven't tried... unfortunately I am still ignorant in
> FreeSurfer ;) ) way is
>
>  sudo apt-get install python-surfer
>
> and then in python
>
>  from surfer.io import read_morph_data
>  x =  read_morph_data(filename)
>
> and then combined them into dataset as Per mentioned.
>
> On Tue, 04 Oct 2011, Per B. Sederberg wrote:
>
> > Hi Greg:
>
> > You can save out that big matrix to a mat file from matlab (say the
> > matrix is named mymat and you save it to mymatrix.mat) and then read
> > it in with:
>
> > import scipy.io
> > x = scipy.io.loadmat('mymatrix.mat')['mymat']
>
> > Then in pymvpa (depending on the version you are using) you can get it
> > ready for business with:
>
> > from mvpa.suite import *
>
> > dat = dataset_wizard(x, targets=cov_of_interest, chunks=range(len(x)))
>
> > Then you can can start analyzing away...
>
> > Best,
> > Per
> --
> =------------------------------------------------------------------=
> Keep in touch                                     www.onerussian.com
> Yaroslav Halchenko                 www.ohloh.net/accounts/yarikoptic
>
> _______________________________________________
> Pkg-ExpPsy-PyMVPA mailing list
> Pkg-ExpPsy-PyMVPA at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20111005/8f805af9/attachment.html>


More information about the Pkg-ExpPsy-PyMVPA mailing list