Thank you for your response Doug,
It's almost ok, except that MRIwrite seems to add some strange symbol after .mgh (which I don't see when I prompt "ls"), so that the file extension is not recognized. I am working on a Mac G5 with matlab 7.0 and last stable version of freesurfer.
Here is the output error for two different trials :
MATLAB: MRIwrite(lhcurv,'lh.myvector.mgh'); FREESURFER: Reading curvature file /Applications/freesurfer/subjects/subj1/surf/ lh.myvector.mgh≈H mghRead(/Applications/freesurfer/subjects/subj1/surf/ lh.myvector.mgh≈H, -1): could not open file. Filename extension must be .mgh, .mgh.gz or .mgz ERROR: reading curvature file
MATLAB: MRIwrite(lhcurv,'lh.thickness.mgh'); FREESURFER: Reading curvature file /Applications/freesurfer/subjects/subj1/surf/ lh.thickness.mgh‡≈H mghRead(/Applications/freesurfer/subjects/subj1/surf/ lh.thickness.mgh‡≈H, -1): could not open file. Filename extension must be .mgh, .mgh.gz or .mgz ERROR: reading curvature file
I already tried: mv lh.myvector.mgh lh.myvector.mgh
with no success... and don't have anymore idea how to remove this strange extension...
Many thanks for your help!
Marie
On Sep 13, 2006, at 3:58 AM, Doug Greve wrote:
Hmmm, not sure what the issue with that is. I've been trying to get people to stop using curv, so one thing you can do is to save it in mgh format and then use mris_preproc and mri_glmfit instead of mris_glm.
Here's what you can try:
- Convert a curv file from you subject into mgh: mri_convert lh.curv lh.curv.mgh
- Load in the mgh file to matlab lhcurv = MRIread('lh.curv.mgh');
- Replace the pixel data with your data: lhcurv.vol = myvector;
- Write the result back out: MRIwrite(lhcurv,'lh.myvector.mgh');
- Do this for each subject
- Run mris_preproc with --meas myvector --srcfmt mgh
- Then run mri_glmfit
doug
On Tue, 12 Sep 2006, Marie Schaer wrote:
Hello everybody,
I am using the "write_curv" matlab code posted by Doug Greve on 01/10/2003 to convert a curvature vector back into freesurfer .curv format, using the following syntax in matlab:
write_curv('lh.curv',myvector,facenumber);
and when I try to launch mris_glm --meas curv --hemi lh ..., I get the following reading curvature error:
MRISreadNewCurvature: vals/vertex 3 unsupported (must be 1)
... However, I am sure that my vector has the size "verticesnumber x 1", and I also thought that the line 23 of write_curv "fwrite (fid, 1, 'int32');" will anyway assign only one value per vertex.
Could anyone help me? Many thanks,
Marie Schaer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
In order to help us help you, please follow the steps in: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting