Hi there,
We're using load_mgh.m to load several individual (single subject) cortical thickness maps (each 1X163842) that we'll use to compute a group-level statistic in matlab. We're not changing the dimensionality or order of the information loaded and we would like to know if there is a matlab script we might use to convert our resulting (1X163842) array of statistical values back into a .mgh file that can be read on FreeSurfer. Thanks!
Lara
Hi Lara
save_mgh should do the trick.
cheers Bruce On Sun, 23 Oct 2011, Lara Foland-Ross wrote:
Hi there,
We're using load_mgh.m to load several individual (single subject) cortical thickness maps (each 1X163842) that we'll use to compute a group-level statistic in matlab. We're not changing the dimensionality or order of the information loaded and we would like to know if there is a matlab script we might use to convert our resulting (1X163842) array of statistical values back into a .mgh file that can be read on FreeSurfer. Thanks!
Lara
Hi Lara,
I would recommend using v = MRIread('fname.mgh'); mat = fast_vol2mat(v.vol); % converts any input "volume" to an Ntime -by- Nvertices matrix % perform operations on mat v2 = v; v2.vol = fast_mat2vol(mat,v2.volsize); MRIwrite('fname2.mgh')
The "fast" commands are in $FREESURFER_HOME/fsfast/toolbox.
The structure read in by MRIread has a "vol" field, but this will hold any type of pixel data (eg, data on the surface).
doug
Lara Foland-Ross wrote:
Hi there,
We're using load_mgh.m to load several individual (single subject) cortical thickness maps (each 1X163842) that we'll use to compute a group-level statistic in matlab. We're not changing the dimensionality or order of the information loaded and we would like to know if there is a matlab script we might use to convert our resulting (1X163842) array of statistical values back into a .mgh file that can be read on FreeSurfer. Thanks!
Lara
freesurfer@nmr.mgh.harvard.edu