<div>Does the make_average_subject routine guarantee that the surface can be reshaped to fit into Nifti?  If so, it's probably easiest to just stick the timeserieses together in a reshaped nifti and read that in with Nibabel.</div>

<div><br></div><div>Or feel free to just steal the read_scalar_data function from the PySurfer source.  It's quite simple :)</div><div><br></div><div><a href="https://github.com/nipy/PySurfer/blob/master/surfer/io.py#L108">https://github.com/nipy/PySurfer/blob/master/surfer/io.py#L108</a></div>

<div><br></div><div>Best,</div><div>Michael</div><div><br><div class="gmail_quote">On Wed, Oct 5, 2011 at 6:59 PM, Gregory Kirk <span dir="ltr"><<a href="mailto:gkirk@wisc.edu">gkirk@wisc.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
i use the ' old way' in freesurfer, so i made an average surface with make_average_subject, then resampled allmy subjects onto it with mris_preproc and the resulting file is in .mgh format.<br>
<br>
<br>
i know i can load the data into a matlab matrix with a freesurfer matlab script, i am forced to use<br>
the redhat derived scientific linux as that is what is installed by the IT guys for us. so earlier today<br>
i had an e-mail with Yarik about the C++ compile errors i was getting and he was going to get back to me.<br>
so at the moment maybe installing the Pysurfer module may not be as easy for me as i cant just apt-get install<br>
and be sure it will go smooth, so for a first crack<br>
im hoping the load matlab mat  method that i got in an earlier e-mail from the list may be more simple, although<br>
as i get rolling maybethe viewer you suggest sounds interesting.<br>
<br>
<br>
thanks, ill be in touch once i get the basic PyMVPA running<br>
<br>
<br>
cheers<br>
<br>
<br>
Greg<br>
<br>
On 10/05/11, Michael Waskom   wrote:<br>
> As I understand the question, you want to use morphometric data that&#39;s been transformed into some standard space (i.e. you&#39;ve run recon-all -qcache), so actually you wouldn&#39;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&#39;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&#39;re sticking it together into a dataset sample matrix.<br>


<div class="im">><br>
><br>
><br>
><br>
><br>
> The other upside of installing PySurfer is that you can then display pretty MVPA results with a lot more flexibility than tksurfer offers you :)<br>
><br>
><br>
> Best,<br>
> Michael<br>
><br>
><br>
><br>
><br>
><br>
</div>> On Tue, Oct 4, 2011 at 7:02 PM, Yaroslav Halchenko <<a href="mailto:debian@onerussian.com">debian@onerussian.com</a> <<a href="mailto:debian@onerussian.com">debian@onerussian.com</a>>> wrote:<br>
><br>
> ><br>
><br>
> ><br>
><br>
> > another possible (haven&#39;t tried... unfortunately I am still ignorant in<br>
<div class="im">> ><br>
><br>
> > FreeSurfer ;) ) way is<br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> >  sudo apt-get install python-surfer<br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> > and then in python<br>
> ><br>
><br>
> ><br>
> ><br>
><br>
</div>> >   from <a href="http://surfer.io" target="_blank">surfer.io</a>(<a href="http://surfer.io" target="_blank">http://surfer.io</a>) import read_morph_data<br>
<div class="im">> ><br>
><br>
> >   x =  read_morph_data(filename)<br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> > and then combined them into dataset as Per mentioned.<br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> > On Tue, 04 Oct 2011, Per B. Sederberg wrote:<br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> > > Hi Greg:<br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> > > You can save out that big matrix to a mat file from matlab (say the<br>
> ><br>
><br>
> > > matrix is named mymat and you save it to mymatrix.mat) and then read<br>
> ><br>
><br>
> > > it in with:<br>
> ><br>
><br>
> ><br>
> ><br>
><br>
</div>> > > import <a href="http://scipy.io" target="_blank">scipy.io</a>(<a href="http://scipy.io" target="_blank">http://scipy.io</a>)<br>
> ><br>
><br>
> > > x = scipy.io.loadmat(&#39;mymatrix.mat&#39;)[&#39;mymat&#39;]<br>
<div class="im">> ><br>
><br>
> ><br>
> ><br>
><br>
> > > Then in pymvpa (depending on the version you are using) you can get it<br>
> ><br>
><br>
> > > ready for business with:<br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> > > from mvpa.suite import *<br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> > > dat = dataset_wizard(x, targets=cov_of_interest, chunks=range(len(x)))<br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> > > Then you can can start analyzing away...<br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> > > Best,<br>
> ><br>
><br>
> > > Per<br>
> ><br>
><br>
> ><br>
> > --<br>
> ><br>
><br>
> > =------------------------------------------------------------------=<br>
> ><br>
><br>
</div>> > Keep in touch                                     <a href="http://www.onerussian.com" target="_blank">www.onerussian.com</a>(<a href="http://www.onerussian.com" target="_blank">http://www.onerussian.com</a>)<br>


> ><br>
><br>
> > Yaroslav Halchenko                 <a href="http://www.ohloh.net/accounts/yarikoptic(http://www.ohloh.net/accounts/yarikoptic)" target="_blank">www.ohloh.net/accounts/yarikoptic(http://www.ohloh.net/accounts/yarikoptic)</a><br>


> ><br>
><br>
> ><br>
> ><br>
> ><br>
><br>
> > _______________________________________________<br>
> ><br>
><br>
> > Pkg-ExpPsy-PyMVPA mailing list<br>
> ><br>
><br>
> > <a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a> <<a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a>><br>


> ><br>
><br>
> > <a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a><br>
<div><div></div><div class="h5">> ><br>
><br>
> ><br>
> ><br>
> ><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Pkg-ExpPsy-PyMVPA mailing list<br>
> <a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a><br>
> <a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a><br>
<br>
<br>
_______________________________________________<br>
Pkg-ExpPsy-PyMVPA mailing list<br>
<a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a><br>
</div></div></blockquote></div><br></div>