External Email - Use Caution
Hello Freesurfer Experts,
I am trying to plot the ${meas} values at the maximum vertex in a significant cluster found by the group analysis pipeline (mri_glmfit).
I created an .mgh file with mris_preproc, rh.cbd7.area.10.mgh. I read this file into matlab using MRIread. (mgh=MRIread(${path}/rh.cbd7.area.10.mgh);) After running mri_glmfit and mri_glmfit-sim, I found a significant cluster with maximum at vertex 53263. I read the values at this vertex using matlab again (values=mgh.vol(1,53263,1,:)). I then tried to duplicate the p value that mri_glmfit gave me at that vertex in R, and was unsuccessful (the p values did not match, and were actually quite different).
I had assumed that mri_glmfit ran a glm at every vertex of the smoothed mgh file created by mris_preproc, and that the p values of that glm were assembled into sig.mgh. Was this assumption wrong?
Thanks, -Eric
Do you have a 1-off error? Ie, FS starts counting at 0 and matlab starts counting at 1. So vertex 53263 is vertex 53264 in matlab.
On 8/12/2020 5:31 PM, Eric Cunningham wrote:
External Email - Use Caution
Hello Freesurfer Experts,
I am trying to plot the ${meas} values at the maximum vertex in a significant cluster found by the group analysis pipeline (mri_glmfit).
I created an .mgh file with mris_preproc, rh.cbd7.area.10.mgh. I read this file into matlab using MRIread. (mgh=MRIread(${path}/rh.cbd7.area.10.mgh);) After running mri_glmfit and mri_glmfit-sim, I found a significant cluster with maximum at vertex 53263. I read the values at this vertex using matlab again (values=mgh.vol(1,53263,1,:)). I then tried to duplicate the p value that mri_glmfit gave me at that vertex in R, and was unsuccessful (the p values did not match, and were actually quite different).
I had assumed that mri_glmfit ran a glm at every vertex of the smoothed mgh file created by mris_preproc, and that the p values of that glm were assembled into sig.mgh. Was this assumption wrong?
Thanks, -Eric
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
External Email - Use Caution
Firstly, yes. I was making that error, and many thanks for catching it! Unfortunately, even after applying that fix, the problem remains, but it does explain why some of my earlier attempts to figure things out on my own failed. I will try to duplicate a simpler model and see if that works.
Follow up question. If I have a 2-level factor that I want to include as a nuisance variable, (e.g. gender), would I be able to define that as a numeric variable with values 0 and 1, rather than splitting up my other categories?
Thank you for your help, -Eric
On Thu, Aug 13, 2020 at 9:42 AM Douglas N. Greve dgreve@mgh.harvard.edu wrote:
Do you have a 1-off error? Ie, FS starts counting at 0 and matlab starts counting at 1. So vertex 53263 is vertex 53264 in matlab.
On 8/12/2020 5:31 PM, Eric Cunningham wrote:
External Email - Use CautionHello Freesurfer Experts,
I am trying to plot the ${meas} values at the maximum vertex in a significant cluster found by the group analysis pipeline (mri_glmfit).
I created an .mgh file with mris_preproc, rh.cbd7.area.10.mgh. I read this file into matlab using MRIread. (mgh=MRIread(${path}/rh.cbd7.area.10.mgh);) After running mri_glmfit and mri_glmfit-sim, I found a significant cluster with maximum at vertex 53263. I read the values at this vertex using matlab again (values=mgh.vol(1,53263,1,:)). I then tried to duplicate the p value that mri_glmfit gave me at that vertex in R, and was unsuccessful (the p values did not match, and were actually quite different).
I had assumed that mri_glmfit ran a glm at every vertex of the smoothed mgh file created by mris_preproc, and that the p values of that glm were assembled into sig.mgh. Was this assumption wrong?
Thanks, -Eric
Freesurfer mailing listFreesurfer@nmr.mgh.harvard.eduhttps://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Probably your model in R is not the same as the model in FS. First, see if you can replicate using
X = load('Xg.dat') C = load('contrast/C.dat'); [beta rvar] = fast_glmfit(X,y); % y is the data at your vertex [F p] = fast_fratio(beta,X,rvar,C); p should be the same as in the .sig file
Generally, gender should be separate groups. In some simple cases it works to simulate it as a covariate.
On 8/13/2020 11:43 AM, Eric Cunningham wrote:
External Email - Use Caution
Firstly, yes. I was making that error, and many thanks for catching it! Unfortunately, even after applying that fix, the problem remains, but it does explain why some of my earlier attempts to figure things out on my own failed. I will try to duplicate a simpler model and see if that works.
Follow up question. If I have a 2-level factor that I want to include as a nuisance variable, (e.g. gender), would I be able to define that as a numeric variable with values 0 and 1, rather than splitting up my other categories?
Thank you for your help, -Eric
On Thu, Aug 13, 2020 at 9:42 AM Douglas N. Greve <dgreve@mgh.harvard.edu mailto:dgreve@mgh.harvard.edu> wrote:
Do you have a 1-off error? Ie, FS starts counting at 0 and matlab starts counting at 1. So vertex 53263 is vertex 53264 in matlab. On 8/12/2020 5:31 PM, Eric Cunningham wrote:External Email - Use Caution Hello Freesurfer Experts, I am trying to plot the ${meas} values at the maximum vertex in a significant cluster found by the group analysis pipeline (mri_glmfit). I created an .mgh file with mris_preproc, rh.cbd7.area.10.mgh. I read this file into matlab using MRIread. (mgh=MRIread(${path}/rh.cbd7.area.10.mgh);) After running mri_glmfit and mri_glmfit-sim, I found a significant cluster with maximum at vertex 53263. I read the values at this vertex using matlab again (values=mgh.vol(1,53263,1,:)). I then tried to duplicate the p value that mri_glmfit gave me at that vertex in R, and was unsuccessful (the p values did not match, and were actually quite different). I had assumed that mri_glmfit ran a glm at every vertex of the smoothed mgh file created by mris_preproc, and that the p values of that glm were assembled into sig.mgh. Was this assumption wrong? Thanks, -Eric _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu <mailto:Freesurfer@nmr.mgh.harvard.edu> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu <mailto:Freesurfer@nmr.mgh.harvard.edu> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
External Email - Use Caution
There's a minor bit of confusion with the code you sent. [F p] = fast_fratio(beta,X,rvar,C); gives the error "inner error dimensions must agree" on the line "ces= C*beta". size(C) = [1 9] size(beta) = [1 9] should this be [F p] = fast_fratio(beta',X,rvar,C); ? when I run that, size(p) = [1 9], so I'm not sure if that's the intent.
Thanks -E
On Thu, Aug 13, 2020 at 11:50 AM Douglas N. Greve dgreve@mgh.harvard.edu wrote:
Probably your model in R is not the same as the model in FS. First, see if you can replicate using
X = load('Xg.dat') C = load('contrast/C.dat'); [beta rvar] = fast_glmfit(X,y); % y is the data at your vertex [F p] = fast_fratio(beta,X,rvar,C); p should be the same as in the .sig file
Generally, gender should be separate groups. In some simple cases it works to simulate it as a covariate.
On 8/13/2020 11:43 AM, Eric Cunningham wrote:
External Email - Use CautionFirstly, yes. I was making that error, and many thanks for catching it! Unfortunately, even after applying that fix, the problem remains, but it does explain why some of my earlier attempts to figure things out on my own failed. I will try to duplicate a simpler model and see if that works.
Follow up question. If I have a 2-level factor that I want to include as a nuisance variable, (e.g. gender), would I be able to define that as a numeric variable with values 0 and 1, rather than splitting up my other categories?
Thank you for your help, -Eric
On Thu, Aug 13, 2020 at 9:42 AM Douglas N. Greve dgreve@mgh.harvard.edu wrote:
Do you have a 1-off error? Ie, FS starts counting at 0 and matlab starts counting at 1. So vertex 53263 is vertex 53264 in matlab.
On 8/12/2020 5:31 PM, Eric Cunningham wrote:
External Email - Use CautionHello Freesurfer Experts,
I am trying to plot the ${meas} values at the maximum vertex in a significant cluster found by the group analysis pipeline (mri_glmfit).
I created an .mgh file with mris_preproc, rh.cbd7.area.10.mgh. I read this file into matlab using MRIread. (mgh=MRIread(${path}/rh.cbd7.area.10.mgh);) After running mri_glmfit and mri_glmfit-sim, I found a significant cluster with maximum at vertex 53263. I read the values at this vertex using matlab again (values=mgh.vol(1,53263,1,:)). I then tried to duplicate the p value that mri_glmfit gave me at that vertex in R, and was unsuccessful (the p values did not match, and were actually quite different).
I had assumed that mri_glmfit ran a glm at every vertex of the smoothed mgh file created by mris_preproc, and that the p values of that glm were assembled into sig.mgh. Was this assumption wrong?
Thanks, -Eric
Freesurfer mailing listFreesurfer@nmr.mgh.harvard.eduhttps://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing listFreesurfer@nmr.mgh.harvard.eduhttps://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
you have a typo in fast_fratio. The first argument (beta) should not be transposed
On 8/13/2020 3:40 PM, Eric Cunningham wrote:
External Email - Use Caution
There's a minor bit of confusion with the code you sent. [F p] = fast_fratio(beta,X,rvar,C); gives the error "inner error dimensions must agree" on the line "ces= C*beta". size(C) = [1 9] size(beta) = [1 9] should this be [F p] = fast_fratio(beta',X,rvar,C); ? when I run that, size(p) = [1 9], so I'm not sure if that's the intent.
Thanks -E
On Thu, Aug 13, 2020 at 11:50 AM Douglas N. Greve <dgreve@mgh.harvard.edu mailto:dgreve@mgh.harvard.edu> wrote:
Probably your model in R is not the same as the model in FS. First, see if you can replicate using X = load('Xg.dat') C = load('contrast/C.dat'); [beta rvar] = fast_glmfit(X,y); % y is the data at your vertex [F p] = fast_fratio(beta,X,rvar,C); p should be the same as in the .sig file Generally, gender should be separate groups. In some simple cases it works to simulate it as a covariate. On 8/13/2020 11:43 AM, Eric Cunningham wrote:External Email - Use Caution Firstly, yes. I was making that error, and many thanks for catching it! Unfortunately, even after applying that fix, the problem remains, but it does explain why some of my earlier attempts to figure things out on my own failed. I will try to duplicate a simpler model and see if that works. Follow up question. If I have a 2-level factor that I want to include as a nuisance variable, (e.g. gender), would I be able to define that as a numeric variable with values 0 and 1, rather than splitting up my other categories? Thank you for your help, -Eric On Thu, Aug 13, 2020 at 9:42 AM Douglas N. Greve <dgreve@mgh.harvard.edu <mailto:dgreve@mgh.harvard.edu>> wrote: Do you have a 1-off error? Ie, FS starts counting at 0 and matlab starts counting at 1. So vertex 53263 is vertex 53264 in matlab. On 8/12/2020 5:31 PM, Eric Cunningham wrote:External Email - Use Caution Hello Freesurfer Experts, I am trying to plot the ${meas} values at the maximum vertex in a significant cluster found by the group analysis pipeline (mri_glmfit). I created an .mgh file with mris_preproc, rh.cbd7.area.10.mgh. I read this file into matlab using MRIread. (mgh=MRIread(${path}/rh.cbd7.area.10.mgh);) After running mri_glmfit and mri_glmfit-sim, I found a significant cluster with maximum at vertex 53263. I read the values at this vertex using matlab again (values=mgh.vol(1,53263,1,:)). I then tried to duplicate the p value that mri_glmfit gave me at that vertex in R, and was unsuccessful (the p values did not match, and were actually quite different). I had assumed that mri_glmfit ran a glm at every vertex of the smoothed mgh file created by mris_preproc, and that the p values of that glm were assembled into sig.mgh. Was this assumption wrong? Thanks, -Eric _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu <mailto:Freesurfer@nmr.mgh.harvard.edu> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu <mailto:Freesurfer@nmr.mgh.harvard.edu> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu <mailto:Freesurfer@nmr.mgh.harvard.edu> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu <mailto:Freesurfer@nmr.mgh.harvard.edu> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
freesurfer@nmr.mgh.harvard.edu