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
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:
1. Convert a curv file from you subject into mgh: mri_convert lh.curv lh.curv.mgh 2. Load in the mgh file to matlab lhcurv = MRIread('lh.curv.mgh'); 3. Replace the pixel data with your data: lhcurv.vol = myvector; 4. Write the result back out: MRIwrite(lhcurv,'lh.myvector.mgh'); 5. Do this for each subject 6. Run mris_preproc with --meas myvector --srcfmt mgh 7. 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
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
Some more precisions:
When I launch mris_preproc with the --srcfmt flag, like that: mris_preproc --fsgd fsgdf.txt --target myaverage --hemi lh --meas myvector --srcfmt mgh --out lh.diagnosis_myvector.mgh it returns: ERROR: cannot find /Applications/freesurfer/subjects/subj1/lh.myvector
So I launched mris_preproc without the --srcfmt flag, i.e.: mris_preproc --fsgd fsgdf.txt --target myaverage--hemi lh --meas myvector.mgh --out lh.diagnosis_myvector.mgh which actually calls: mri_surf2surf --hemi lh --srcsubject subj1 --sval /Applications/ freesurfer/subjects/subj1/surf/lh.myvector.mgh --sfmt curv -- trgsubject myaverage --tval ./tmp.mris_preproc.1281/subj1.mgh -- noreshape
where the --sfmt curv in mri_surf2surf seems key to the problem, because the same mri_surf2surf commandline works fine with --sfmt mgh
... So, could it be that mris_preproc does not accept the format -- srcfmt mgh for a curvature format?
Many thanks!
Marie
On Sep 13, 2006, at 12:13 PM, Marie Schaer wrote:
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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
You may have a slightly older version of mris_preproc (I fixed --srcfmt on June 26). I've put a new version here:
ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/mris_preproc
Can you try it out?
Marie Schaer wrote:
Some more precisions:
When I launch mris_preproc with the --srcfmt flag, like that: mris_preproc --fsgd fsgdf.txt --target myaverage --hemi lh --meas myvector --srcfmt mgh --out lh.diagnosis_myvector.mgh it returns: ERROR: cannot find /Applications/freesurfer/subjects/subj1/lh.myvector
So I launched mris_preproc without the --srcfmt flag, i.e.: mris_preproc --fsgd fsgdf.txt --target myaverage--hemi lh --meas myvector.mgh --out lh.diagnosis_myvector.mgh which actually calls: mri_surf2surf --hemi lh --srcsubject subj1 --sval /Applications/ freesurfer/subjects/subj1/surf/lh.myvector.mgh --sfmt curv -- trgsubject myaverage --tval ./tmp.mris_preproc.1281/subj1.mgh -- noreshape
where the --sfmt curv in mri_surf2surf seems key to the problem, because the same mri_surf2surf commandline works fine with --sfmt mgh
... So, could it be that mris_preproc does not accept the format -- srcfmt mgh for a curvature format?
Many thanks!
Marie
This one is fine!
Thank you very much!!
Marie
On Sep 13, 2006, at 3:55 PM, Doug Greve wrote:
You may have a slightly older version of mris_preproc (I fixed -- srcfmt on June 26). I've put a new version here:
ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/ mris_preproc
Can you try it out?
Marie Schaer wrote:
Some more precisions:
When I launch mris_preproc with the --srcfmt flag, like that: mris_preproc --fsgd fsgdf.txt --target myaverage --hemi lh -- meas myvector --srcfmt mgh --out lh.diagnosis_myvector.mgh it returns: ERROR: cannot find /Applications/freesurfer/subjects/subj1/ lh.myvector
So I launched mris_preproc without the --srcfmt flag, i.e.: mris_preproc --fsgd fsgdf.txt --target myaverage--hemi lh -- meas myvector.mgh --out lh.diagnosis_myvector.mgh which actually calls: mri_surf2surf --hemi lh --srcsubject subj1 --sval / Applications/ freesurfer/subjects/subj1/surf/lh.myvector.mgh -- sfmt curv -- trgsubject myaverage --tval ./tmp.mris_preproc.1281/ subj1.mgh -- noreshape
where the --sfmt curv in mri_surf2surf seems key to the problem, because the same mri_surf2surf commandline works fine with --sfmt mgh
... So, could it be that mris_preproc does not accept the format -- srcfmt mgh for a curvature format?
Many thanks!
Marie
freesurfer@nmr.mgh.harvard.edu