Dear Freesurfer Community,
Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the following error, Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 104) You requested a minimum of 8 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
Error in lme_mass_fit (line 137) parpool(prs);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
I have researched the forum on how to stop the function from trying to initiate parallel processing but so far haven’t been able figure out how to overcome this.
Any help would be much appreciated.
Mayank Kaushal MD MBA Postdoctoral Fellow Department of Neurosurgery Medical College of Wisconsin
Hi,
you might try supplying an additional command-line argument while calling the 'lme_mass_fit_vw' function:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1)
This will tell Matlab to use only one worker. Further documentation on this additional argument can be obtained by typing 'help lme_mass_fit_vw' at the Matlab prompt.
To get this working with my Matlab installation, I additionally had to deselect the "Automatically create parallel pool (if one doesn't already exist) when parallel keywords (e.g., parfor) are executed." option. This can be found in Matlab's preferences menu (--> see the Parallel Computing toolbox section).
As an alternative, using two workers might also be an option in your case:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2)
To get this alternative approach working, I did not have to change the Matlab preferences.
Hope this helps,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: freesurfer@nmr.mgh.harvard.edu freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Sun, 4 Mar 2018 23:56:03 +0100
Dear Freesurfer Community,
Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the following error, Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 104) You requested a minimum of 8 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
Error in lme_mass_fit (line 137) parpool(prs);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
I have researched the forum on how to stop the function from trying to initiate parallel processing but so far haven’t been able figure out how to overcome this.
Any help would be much appreciated.
Mayank Kaushal MD MBA Postdoctoral Fellow Department of Neurosurgery Medical College of Wisconsin
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Thanks for the quick response Kersten.
I tried all the potential suggestions mentioned in your post but still no luck.
Here’s the summary:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 124) if (matlabpool('size') > 0)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 123) if (prs==1) || (matlabpool('size') ~= prs)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
The "automatically create a parallel pool" was already deselected in my case.
Also, I am using freesurfer 5.3 with LME toolbox downloaded from the freesurfer website.
Mayank
On Mar 5, 2018, at 9:12 AM, Diers, Kersten /DZNE Kersten.Diers@dzne.de wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
you might try supplying an additional command-line argument while calling the 'lme_mass_fit_vw' function:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1)
This will tell Matlab to use only one worker. Further documentation on this additional argument can be obtained by typing 'help lme_mass_fit_vw' at the Matlab prompt.
To get this working with my Matlab installation, I additionally had to deselect the "Automatically create parallel pool (if one doesn't already exist) when parallel keywords (e.g., parfor) are executed." option. This can be found in Matlab's preferences menu (--> see the Parallel Computing toolbox section).
As an alternative, using two workers might also be an option in your case:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2)
To get this alternative approach working, I did not have to change the Matlab preferences.
Hope this helps,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: freesurfer@nmr.mgh.harvard.edu freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Sun, 4 Mar 2018 23:56:03 +0100
Dear Freesurfer Community,
Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the following error, Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 104) You requested a minimum of 8 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
Error in lme_mass_fit (line 137) parpool(prs);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
I have researched the forum on how to stop the function from trying to initiate parallel processing but so far haven’t been able figure out how to overcome this.
Any help would be much appreciated.
Mayank Kaushal MD MBA Postdoctoral Fellow Department of Neurosurgery Medical College of Wisconsin
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_complia... . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
Hi,
thanks for the additional information.
I believe that we are dealing with a version issue now.
Specifically, I have so far been testing with an LME toolbox from a Freesurfer 6.0 version on Matlab R2016a. In that sense, there is no need for a separate download of the LME scripts, since they are already included within the freesurfer directory (e.g. 'freesurfer/matlab/lme').
It is primarily the 'lme_mass_fit.m' script, which throws the current error. Could you please check your version of this script (type 'help lme_mass_fit.m')?
Within my 5.3 installation, the version string is: % $Revision: 1.1.2.2 $ $Date: 2013/02/23 21:08:10 $
Within my 6.0 installation, the version string is: $Revision: 1.3 $ $Date: 2016/04/08 19:39:24 $
Unfortunately, the version string of the 'lme_mass_fit.m' script within a toolbox that I just downloaded from the LME website is the most ancient one: % $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $
When I use the 1.1.1.1 version instead of the one that is included within Freesurfer 6.0, I can replicate the problem reported in your current mail. With the 1.3 version I have no issues.
As far as I know, the 'lme_mass_fit.m' script was updated to accommodate the changes in Matlab's way of doing the parallel processing. In older Matlab versions this was done using the 'matlabpool' command, but this was replaced by 'parpool', which is - to my knowledge - the only way of running parallel processing with recent Matlab versions. The LME toolbox was originally only tailored to the 'matlabpool' command, but has later been adapted to also include the 'parpool' command.
Assuming that you are using a relatively recent Matlab version, the use of earlier vs. later versions of the toolbox would explain our respective observations.
All in all, I currently see no way of getting an older version of the LME toolbox to run with a current Matlab version - except from modifying the code itself. So my suggestion would be to just use the newer LME toolbox that is shipped with Freesurfer 6.0.
Let us know if I am mistaken or if there are further issues.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 16:34:14 +0100
Thanks for the quick response Kersten.
I tried all the potential suggestions mentioned in your post but still no luck.
Here’s the summary:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 124) if (matlabpool('size') > 0)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 123) if (prs==1) || (matlabpool('size') ~= prs)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
The "automatically create a parallel pool" was already deselected in my case.
Also, I am using freesurfer 5.3 with LME toolbox downloaded from the freesurfer website.
Mayank
On Mar 5, 2018, at 9:12 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
you might try supplying an additional command-line argument while calling the 'lme_mass_fit_vw' function:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1)
This will tell Matlab to use only one worker. Further documentation on this additional argument can be obtained by typing 'help lme_mass_fit_vw' at the Matlab prompt.
To get this working with my Matlab installation, I additionally had to deselect the "Automatically create parallel pool (if one doesn't already exist) when parallel keywords (e.g., parfor) are executed." option. This can be found in Matlab's preferences menu (--> see the Parallel Computing toolbox section).
As an alternative, using two workers might also be an option in your case:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2)
To get this alternative approach working, I did not have to change the Matlab preferences.
Hope this helps,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: freesurfer@nmr.mgh.harvard.edu freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Sun, 4 Mar 2018 23:56:03 +0100
Dear Freesurfer Community,
Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the following error, Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 104) You requested a minimum of 8 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
Error in lme_mass_fit (line 137) parpool(prs);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
I have researched the forum on how to stop the function from trying to initiate parallel processing but so far haven’t been able figure out how to overcome this.
Any help would be much appreciated.
Mayank Kaushal MD MBA Postdoctoral Fellow Department of Neurosurgery Medical College of Wisconsin
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=4ORZf53F92dPjiBGXnKHpr- EpQ0EcHphHdwjrXBmi2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
The version string I have been using: $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $ So, it appears that I do indeed have the older version.
I am running Matlab 2017a, which is a relatively newer version.
Before I proceed with using LME toolbox from a freesurfer 6.0, I would appreciate your input on the following.
My understanding is that LME toolbox is used for statistical analysis and is independent of the freesurfer version performing the actual cortical thickness analysis. So, in theory, if I import cortical thickness data processed in version 5.3, I should still be able to run the LME toolbox from a version 6.0. So, can I input the files processed by freesurfer 5.3 (files that have been processed till mris_preproc and mri_surf2surf) and simply use the LME toolbox from a version 6.0 to perform the statistical analysis?
Mayank
On Mar 5, 2018, at 1:29 PM, Diers, Kersten /DZNE Kersten.Diers@dzne.de wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
thanks for the additional information.
I believe that we are dealing with a version issue now.
Specifically, I have so far been testing with an LME toolbox from a Freesurfer 6.0 version on Matlab R2016a. In that sense, there is no need for a separate download of the LME scripts, since they are already included within the freesurfer directory (e.g. 'freesurfer/matlab/lme').
It is primarily the 'lme_mass_fit.m' script, which throws the current error. Could you please check your version of this script (type 'help lme_mass_fit.m')?
Within my 5.3 installation, the version string is: % $Revision: 1.1.2.2 $ $Date: 2013/02/23 21:08:10 $
Within my 6.0 installation, the version string is: $Revision: 1.3 $ $Date: 2016/04/08 19:39:24 $
Unfortunately, the version string of the 'lme_mass_fit.m' script within a toolbox that I just downloaded from the LME website is the most ancient one: % $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $
When I use the 1.1.1.1 version instead of the one that is included within Freesurfer 6.0, I can replicate the problem reported in your current mail. With the 1.3 version I have no issues.
As far as I know, the 'lme_mass_fit.m' script was updated to accommodate the changes in Matlab's way of doing the parallel processing. In older Matlab versions this was done using the 'matlabpool' command, but this was replaced by 'parpool', which is - to my knowledge - the only way of running parallel processing with recent Matlab versions. The LME toolbox was originally only tailored to the 'matlabpool' command, but has later been adapted to also include the 'parpool' command.
Assuming that you are using a relatively recent Matlab version, the use of earlier vs. later versions of the toolbox would explain our respective observations.
All in all, I currently see no way of getting an older version of the LME toolbox to run with a current Matlab version - except from modifying the code itself. So my suggestion would be to just use the newer LME toolbox that is shipped with Freesurfer 6.0.
Let us know if I am mistaken or if there are further issues.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 16:34:14 +0100
Thanks for the quick response Kersten.
I tried all the potential suggestions mentioned in your post but still no luck.
Here’s the summary:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 124) if (matlabpool('size') > 0)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 123) if (prs==1) || (matlabpool('size') ~= prs)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
The "automatically create a parallel pool" was already deselected in my case.
Also, I am using freesurfer 5.3 with LME toolbox downloaded from the freesurfer website.
Mayank
On Mar 5, 2018, at 9:12 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
you might try supplying an additional command-line argument while calling the 'lme_mass_fit_vw' function:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1)
This will tell Matlab to use only one worker. Further documentation on this additional argument can be obtained by typing 'help lme_mass_fit_vw' at the Matlab prompt.
To get this working with my Matlab installation, I additionally had to deselect the "Automatically create parallel pool (if one doesn't already exist) when parallel keywords (e.g., parfor) are executed." option. This can be found in Matlab's preferences menu (--> see the Parallel Computing toolbox section).
As an alternative, using two workers might also be an option in your case:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2)
To get this alternative approach working, I did not have to change the Matlab preferences.
Hope this helps,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: freesurfer@nmr.mgh.harvard.edu freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Sun, 4 Mar 2018 23:56:03 +0100
Dear Freesurfer Community,
Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the following error, Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 104) You requested a minimum of 8 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
Error in lme_mass_fit (line 137) parpool(prs);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
I have researched the forum on how to stop the function from trying to initiate parallel processing but so far haven’t been able figure out how to overcome this.
Any help would be much appreciated.
Mayank Kaushal MD MBA Postdoctoral Fellow Department of Neurosurgery Medical College of Wisconsin
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=4ORZf53F92dPjiBGXnKHpr- EpQ0EcHphHdwjrXBmi2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_complia... . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
Yes,
my understanding is the same.
The LME toolbox can in a way be regarded as a post-processing add-on to Freesurfer. The only interface with Freesurfer are the read/write functions, everything else is to the best of my knowledge independent of Freesurfer. So I cannot see any problems in using the newer version of the LME toolbox with data from Freesurfer 5.3.
Needless to say, this does not affect the usual recommendation, which is that Freesurfer versions should not be mixed in general.
Best,
Kersten
------Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 20:47:36 +0100
The version string I have been using: $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $ So, it appears that I do indeed have the older version.
I am running Matlab 2017a, which is a relatively newer version.
Before I proceed with using LME toolbox from a freesurfer 6.0, I would appreciate your input on the following.
My understanding is that LME toolbox is used for statistical analysis and is independent of the freesurfer version performing the actual cortical thickness analysis. So, in theory, if I import cortical thickness data processed in version 5.3, I should still be able to run the LME toolbox from a version 6.0. So, can I input the files processed by freesurfer 5.3 (files that have been processed till mris_preproc and mri_surf2surf) and simply use the LME toolbox from a version 6.0 to perform the statistical analysis?
Mayank
On Mar 5, 2018, at 1:29 PM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
thanks for the additional information.
I believe that we are dealing with a version issue now.
Specifically, I have so far been testing with an LME toolbox from a Freesurfer 6.0 version on Matlab R2016a. In that sense, there is no need for a separate download of the LME scripts, since they are already included within the freesurfer directory (e.g. 'freesurfer/matlab/lme').
It is primarily the 'lme_mass_fit.m' script, which throws the current error. Could you please check your version of this script (type 'help lme_mass_fit.m')?
Within my 5.3 installation, the version string is: % $Revision: 1.1.2.2 $ $Date: 2013/02/23 21:08:10 $
Within my 6.0 installation, the version string is: $Revision: 1.3 $ $Date: 2016/04/08 19:39:24 $
Unfortunately, the version string of the 'lme_mass_fit.m' script within a toolbox that I just downloaded from the LME website is the most ancient one: % $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $
When I use the 1.1.1.1 version instead of the one that is included within Freesurfer 6.0, I can replicate the problem reported in your current mail. With the 1.3 version I have no issues.
As far as I know, the 'lme_mass_fit.m' script was updated to accommodate the changes in Matlab's way of doing the parallel processing. In older Matlab versions this was done using the 'matlabpool' command, but this was replaced by 'parpool', which is - to my knowledge - the only way of running parallel processing with recent Matlab versions. The LME toolbox was originally only tailored to the 'matlabpool' command, but has later been adapted to also include the 'parpool' command.
Assuming that you are using a relatively recent Matlab version, the use of earlier vs. later versions of the toolbox would explain our respective observations.
All in all, I currently see no way of getting an older version of the LME toolbox to run with a current Matlab version - except from modifying the code itself. So my suggestion would be to just use the newer LME toolbox that is shipped with Freesurfer 6.0.
Let us know if I am mistaken or if there are further issues.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 16:34:14 +0100
Thanks for the quick response Kersten.
I tried all the potential suggestions mentioned in your post but still no luck.
Here’s the summary:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 124) if (matlabpool('size') > 0)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 123) if (prs==1) || (matlabpool('size') ~= prs)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
The "automatically create a parallel pool" was already deselected in my case.
Also, I am using freesurfer 5.3 with LME toolbox downloaded from the freesurfer website.
Mayank
On Mar 5, 2018, at 9:12 AM, Diers, Kersten /DZNE <Kersten.Diers@dzn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
you might try supplying an additional command-line argument while calling the 'lme_mass_fit_vw' function:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1)
This will tell Matlab to use only one worker. Further documentation on this additional argument can be obtained by typing 'help lme_mass_fit_vw' at the Matlab prompt.
To get this working with my Matlab installation, I additionally had to deselect the "Automatically create parallel pool (if one doesn't already exist) when parallel keywords (e.g., parfor) are executed." option. This can be found in Matlab's preferences menu (--> see the Parallel Computing toolbox section).
As an alternative, using two workers might also be an option in your case:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2)
To get this alternative approach working, I did not have to change the Matlab preferences.
Hope this helps,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: freesurfer@nmr.mgh.harvard.edu freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Sun, 4 Mar 2018 23:56:03 +0100
Dear Freesurfer Community,
Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the following error, Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 104) You requested a minimum of 8 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
Error in lme_mass_fit (line 137) parpool(prs);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
I have researched the forum on how to stop the function from trying to initiate parallel processing but so far haven’t been able figure out how to overcome this.
Any help would be much appreciated.
Mayank Kaushal MD MBA Postdoctoral Fellow Department of Neurosurgery Medical College of Wisconsin
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR
cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=4ORZf53F92dPjiBGXnKHpr- EpQ0EcHphHdwjrXBmi2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR
cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3wnuPmKgzUIsDM1jpSeXZ5Vq_ k4&s=l79g5eOp0ctiFMn0i9TPGz-xgQD77NyKMbK1SskWckA&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e=
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
After downloading version 6.0. and running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1), I received the following errors.
Error using parfor_progress (line 17) Do you have write permissions for /?
Error in lme_mass_fit (line 155) fn = parfor_progress('init',nv);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
Thoughts?
Mayank
On Mar 6, 2018, at 7:08 AM, Diers, Kersten /DZNE Kersten.Diers@dzne.de wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Yes,
my understanding is the same.
The LME toolbox can in a way be regarded as a post-processing add-on to Freesurfer. The only interface with Freesurfer are the read/write functions, everything else is to the best of my knowledge independent of Freesurfer. So I cannot see any problems in using the newer version of the LME toolbox with data from Freesurfer 5.3.
Needless to say, this does not affect the usual recommendation, which is that Freesurfer versions should not be mixed in general.
Best,
Kersten
------Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 20:47:36 +0100
The version string I have been using: $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $ So, it appears that I do indeed have the older version.
I am running Matlab 2017a, which is a relatively newer version.
Before I proceed with using LME toolbox from a freesurfer 6.0, I would appreciate your input on the following.
My understanding is that LME toolbox is used for statistical analysis and is independent of the freesurfer version performing the actual cortical thickness analysis. So, in theory, if I import cortical thickness data processed in version 5.3, I should still be able to run the LME toolbox from a version 6.0. So, can I input the files processed by freesurfer 5.3 (files that have been processed till mris_preproc and mri_surf2surf) and simply use the LME toolbox from a version 6.0 to perform the statistical analysis?
Mayank
On Mar 5, 2018, at 1:29 PM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
thanks for the additional information.
I believe that we are dealing with a version issue now.
Specifically, I have so far been testing with an LME toolbox from a Freesurfer 6.0 version on Matlab R2016a. In that sense, there is no need for a separate download of the LME scripts, since they are already included within the freesurfer directory (e.g. 'freesurfer/matlab/lme').
It is primarily the 'lme_mass_fit.m' script, which throws the current error. Could you please check your version of this script (type 'help lme_mass_fit.m')?
Within my 5.3 installation, the version string is: % $Revision: 1.1.2.2 $ $Date: 2013/02/23 21:08:10 $
Within my 6.0 installation, the version string is: $Revision: 1.3 $ $Date: 2016/04/08 19:39:24 $
Unfortunately, the version string of the 'lme_mass_fit.m' script within a toolbox that I just downloaded from the LME website is the most ancient one: % $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $
When I use the 1.1.1.1 version instead of the one that is included within Freesurfer 6.0, I can replicate the problem reported in your current mail. With the 1.3 version I have no issues.
As far as I know, the 'lme_mass_fit.m' script was updated to accommodate the changes in Matlab's way of doing the parallel processing. In older Matlab versions this was done using the 'matlabpool' command, but this was replaced by 'parpool', which is - to my knowledge - the only way of running parallel processing with recent Matlab versions. The LME toolbox was originally only tailored to the 'matlabpool' command, but has later been adapted to also include the 'parpool' command.
Assuming that you are using a relatively recent Matlab version, the use of earlier vs. later versions of the toolbox would explain our respective observations.
All in all, I currently see no way of getting an older version of the LME toolbox to run with a current Matlab version - except from modifying the code itself. So my suggestion would be to just use the newer LME toolbox that is shipped with Freesurfer 6.0.
Let us know if I am mistaken or if there are further issues.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 16:34:14 +0100
Thanks for the quick response Kersten.
I tried all the potential suggestions mentioned in your post but still no luck.
Here’s the summary:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 124) if (matlabpool('size') > 0)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 123) if (prs==1) || (matlabpool('size') ~= prs)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
The "automatically create a parallel pool" was already deselected in my case.
Also, I am using freesurfer 5.3 with LME toolbox downloaded from the freesurfer website.
Mayank
On Mar 5, 2018, at 9:12 AM, Diers, Kersten /DZNE <Kersten.Diers@dzn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
you might try supplying an additional command-line argument while calling the 'lme_mass_fit_vw' function:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1)
This will tell Matlab to use only one worker. Further documentation on this additional argument can be obtained by typing 'help lme_mass_fit_vw' at the Matlab prompt.
To get this working with my Matlab installation, I additionally had to deselect the "Automatically create parallel pool (if one doesn't already exist) when parallel keywords (e.g., parfor) are executed." option. This can be found in Matlab's preferences menu (--> see the Parallel Computing toolbox section).
As an alternative, using two workers might also be an option in your case:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2)
To get this alternative approach working, I did not have to change the Matlab preferences.
Hope this helps,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: freesurfer@nmr.mgh.harvard.edu freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Sun, 4 Mar 2018 23:56:03 +0100
Dear Freesurfer Community,
Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the following error, Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 104) You requested a minimum of 8 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
Error in lme_mass_fit (line 137) parpool(prs);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
I have researched the forum on how to stop the function from trying to initiate parallel processing but so far haven’t been able figure out how to overcome this.
Any help would be much appreciated.
Mayank Kaushal MD MBA Postdoctoral Fellow Department of Neurosurgery Medical College of Wisconsin
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR
cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=4ORZf53F92dPjiBGXnKHpr- EpQ0EcHphHdwjrXBmi2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR
cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3wnuPmKgzUIsDM1jpSeXZ5Vq_ k4&s=l79g5eOp0ctiFMn0i9TPGz-xgQD77NyKMbK1SskWckA&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_complia... . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
The LME toolbox will create a text file ('parfor_progress1.txt') in Matlab's present working directory to indicate its progress in processing each vertex.
To create this file it needs to have write permissions in Matlab's present working directory.
I speculate that your present working directory in Matlab is the root directory '/' where the toolbox cannot create a file.
The solution would be to not run the scripts from '/', but to set the Matlab working directory to another directory where you have write permissions.
Best regards
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Tue, 6 Mar 2018 15:17:31 +0100
After downloading version 6.0. and running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1), I received the following errors.
Error using parfor_progress (line 17) Do you have write permissions for /?
Error in lme_mass_fit (line 155) fn = parfor_progress('init',nv);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
Thoughts?
Mayank
On Mar 6, 2018, at 7:08 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Yes,
my understanding is the same.
The LME toolbox can in a way be regarded as a post-processing add-on to Freesurfer. The only interface with Freesurfer are the read/write functions, everything else is to the best of my knowledge independent of Freesurfer. So I cannot see any problems in using the newer version of the LME toolbox with data from Freesurfer 5.3.
Needless to say, this does not affect the usual recommendation, which is that Freesurfer versions should not be mixed in general.
Best,
Kersten
------Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 20:47:36 +0100
The version string I have been using: $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $ So, it appears that I do indeed have the older version.
I am running Matlab 2017a, which is a relatively newer version.
Before I proceed with using LME toolbox from a freesurfer 6.0, I would appreciate your input on the following.
My understanding is that LME toolbox is used for statistical analysis and is independent of the freesurfer version performing the actual cortical thickness analysis. So, in theory, if I import cortical thickness data processed in version 5.3, I should still be able to run the LME toolbox from a version 6.0. So, can I input the files processed by freesurfer 5.3 (files that have been processed till mris_preproc and mri_surf2surf) and simply use the LME toolbox from a version 6.0 to perform the statistical analysis?
Mayank
On Mar 5, 2018, at 1:29 PM, Diers, Kersten /DZNE <Kersten.Diers@dzn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
thanks for the additional information.
I believe that we are dealing with a version issue now.
Specifically, I have so far been testing with an LME toolbox from a Freesurfer 6.0 version on Matlab R2016a. In that sense, there is no need for a separate download of the LME scripts, since they are already included within the freesurfer directory (e.g. 'freesurfer/matlab/lme').
It is primarily the 'lme_mass_fit.m' script, which throws the current error. Could you please check your version of this script (type 'help lme_mass_fit.m')?
Within my 5.3 installation, the version string is: % $Revision: 1.1.2.2 $ $Date: 2013/02/23 21:08:10 $
Within my 6.0 installation, the version string is: $Revision: 1.3 $ $Date: 2016/04/08 19:39:24 $
Unfortunately, the version string of the 'lme_mass_fit.m' script within a toolbox that I just downloaded from the LME website is the most ancient one: % $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $
When I use the 1.1.1.1 version instead of the one that is included within Freesurfer 6.0, I can replicate the problem reported in your current mail. With the 1.3 version I have no issues.
As far as I know, the 'lme_mass_fit.m' script was updated to accommodate the changes in Matlab's way of doing the parallel processing. In older Matlab versions this was done using the 'matlabpool' command, but this was replaced by 'parpool', which is
to my knowledge - the only way of running parallel processing with recent Matlab versions. The LME toolbox was originally only tailored to the 'matlabpool' command, but has later been adapted to also include the 'parpool' command.
Assuming that you are using a relatively recent Matlab version, the use of earlier vs. later versions of the toolbox would explain our respective observations.
All in all, I currently see no way of getting an older version of the LME toolbox to run with a current Matlab version - except from modifying the code itself. So my suggestion would be to just use the newer LME toolbox that is shipped with Freesurfer 6.0.
Let us know if I am mistaken or if there are further issues.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 16:34:14 +0100
Thanks for the quick response Kersten.
I tried all the potential suggestions mentioned in your post but still no luck.
Here’s the summary:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 124) if (matlabpool('size') > 0)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 123) if (prs==1) || (matlabpool('size') ~= prs)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
The "automatically create a parallel pool" was already deselected in my case.
Also, I am using freesurfer 5.3 with LME toolbox downloaded from the freesurfer website.
Mayank
On Mar 5, 2018, at 9:12 AM, Diers, Kersten /DZNE <Kersten.Diers@d zn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
you might try supplying an additional command-line argument while calling the 'lme_mass_fit_vw' function:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1)
This will tell Matlab to use only one worker. Further documentation on this additional argument can be obtained by typing 'help lme_mass_fit_vw' at the Matlab prompt.
To get this working with my Matlab installation, I additionally had to deselect the "Automatically create parallel pool (if one doesn't already exist) when parallel keywords (e.g., parfor) are executed." option. This can be found in Matlab's preferences menu (--> see the Parallel Computing toolbox section).
As an alternative, using two workers might also be an option in your case:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2)
To get this alternative approach working, I did not have to change the Matlab preferences.
Hope this helps,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu
To: freesurfer@nmr.mgh.harvard.edu <freesurfer@nmr.mgh.harvard.ed u> Subject: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Sun, 4 Mar 2018 23:56:03 +0100
Dear Freesurfer Community,
Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the following error, Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 104) You requested a minimum of 8 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
Error in lme_mass_fit (line 137) parpool(prs);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
I have researched the forum on how to stop the function from trying to initiate parallel processing but so far haven’t been able figure out how to overcome this.
Any help would be much appreciated.
Mayank Kaushal MD MBA Postdoctoral Fellow Department of Neurosurgery Medical College of Wisconsin
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR
cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners. or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgs pw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=4ORZf53F92dPjiBGXnKHpr- EpQ0EcHphHdwjrXBmi2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR
cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3wnuPmKgzUIsDM1jpSeXZ5V q_ k4&s=l79g5eOp0ctiFMn0i9TPGz-xgQD77NyKMbK1SskWckA&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu9m0d_7s53UXt0ZNl0blCKx Ns&s=GexmzGtdEYAmFIlm6hCmI2663Z-CgUy8UHaLR-K7C2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Changing the Matlab directory worked. Thanks for all your inputs, Kersten.
Sorry to prolong the conversation but if possible, I would appreciate input on whether my thought process regarding the LME analysis is on the right track.
I am looking to compare cortical thickness between 3 groups over multiple visits.
The design matrix created by me X = [ones(length(M),1) M M(:,1).*M(:,2)]; Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 intercept time of each scan from base scan age at first scan group (1, 2, or 3) visit (1,2 3, or 4) Column 2 * Column 3
Presently, I am running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) as a test run.
However, I would like to include Columns 1, 4, and 5 as random effects for LME analysis and if possible even include Column 2 as a random effect to have 4 random effects. lhstats = lme_mass_fit_vw(X,[1 4 5],Y,ni,lhcortex,[],1) or lhstats = lme_mass_fit_vw(X,[1 2 4 5],Y,ni,lhcortex,[],1)
Now, I would like to know if having 3 or possibly 4 random effects would be too many random effects.
Mayank On Mar 6, 2018, at 8:57 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne.demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
The LME toolbox will create a text file ('parfor_progress1.txt') in Matlab's present working directory to indicate its progress in processing each vertex.
To create this file it needs to have write permissions in Matlab's present working directory.
I speculate that your present working directory in Matlab is the root directory '/' where the toolbox cannot create a file.
The solution would be to not run the scripts from '/', but to set the Matlab working directory to another directory where you have write permissions.
Best regards
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Tue, 6 Mar 2018 15:17:31 +0100
After downloading version 6.0. and running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1), I received the following errors.
Error using parfor_progress (line 17) Do you have write permissions for /?
Error in lme_mass_fit (line 155) fn = parfor_progress('init',nv);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
Thoughts?
Mayank
On Mar 6, 2018, at 7:08 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Yes,
my understanding is the same.
The LME toolbox can in a way be regarded as a post-processing add-on to Freesurfer. The only interface with Freesurfer are the read/write functions, everything else is to the best of my knowledge independent of Freesurfer. So I cannot see any problems in using the newer version of the LME toolbox with data from Freesurfer 5.3.
Needless to say, this does not affect the usual recommendation, which is that Freesurfer versions should not be mixed in general.
Best,
Kersten
------Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 20:47:36 +0100
The version string I have been using: $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $ So, it appears that I do indeed have the older version.
I am running Matlab 2017a, which is a relatively newer version.
Before I proceed with using LME toolbox from a freesurfer 6.0, I would appreciate your input on the following.
My understanding is that LME toolbox is used for statistical analysis and is independent of the freesurfer version performing the actual cortical thickness analysis. So, in theory, if I import cortical thickness data processed in version 5.3, I should still be able to run the LME toolbox from a version 6.0. So, can I input the files processed by freesurfer 5.3 (files that have been processed till mris_preproc and mri_surf2surf) and simply use the LME toolbox from a version 6.0 to perform the statistical analysis?
Mayank
On Mar 5, 2018, at 1:29 PM, Diers, Kersten /DZNE <Kersten.Diers@dzn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
thanks for the additional information.
I believe that we are dealing with a version issue now.
Specifically, I have so far been testing with an LME toolbox from a Freesurfer 6.0 version on Matlab R2016a. In that sense, there is no need for a separate download of the LME scripts, since they are already included within the freesurfer directory (e.g. 'freesurfer/matlab/lme').
It is primarily the 'lme_mass_fit.m' script, which throws the current error. Could you please check your version of this script (type 'help lme_mass_fit.m')?
Within my 5.3 installation, the version string is: % $Revision: 1.1.2.2 $ $Date: 2013/02/23 21:08:10 $
Within my 6.0 installation, the version string is: $Revision: 1.3 $ $Date: 2016/04/08 19:39:24 $
Unfortunately, the version string of the 'lme_mass_fit.m' script within a toolbox that I just downloaded from the LME website is the most ancient one: % $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $
When I use the 1.1.1.1 version instead of the one that is included within Freesurfer 6.0, I can replicate the problem reported in your current mail. With the 1.3 version I have no issues.
As far as I know, the 'lme_mass_fit.m' script was updated to accommodate the changes in Matlab's way of doing the parallel processing. In older Matlab versions this was done using the 'matlabpool' command, but this was replaced by 'parpool', which is - to my knowledge - the only way of running parallel processing with recent Matlab versions. The LME toolbox was originally only tailored to the 'matlabpool' command, but has later been adapted to also include the 'parpool' command.
Assuming that you are using a relatively recent Matlab version, the use of earlier vs. later versions of the toolbox would explain our respective observations.
All in all, I currently see no way of getting an older version of the LME toolbox to run with a current Matlab version - except from modifying the code itself. So my suggestion would be to just use the newer LME toolbox that is shipped with Freesurfer 6.0.
Let us know if I am mistaken or if there are further issues.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 16:34:14 +0100
Thanks for the quick response Kersten.
I tried all the potential suggestions mentioned in your post but still no luck.
Here’s the summary:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 124) if (matlabpool('size') > 0)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 123) if (prs==1) || (matlabpool('size') ~= prs)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
The "automatically create a parallel pool" was already deselected in my case.
Also, I am using freesurfer 5.3 with LME toolbox downloaded from the freesurfer website.
Mayank
On Mar 5, 2018, at 9:12 AM, Diers, Kersten /DZNE <Kersten.Diers@d zn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
you might try supplying an additional command-line argument while calling the 'lme_mass_fit_vw' function:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1)
This will tell Matlab to use only one worker. Further documentation on this additional argument can be obtained by typing 'help lme_mass_fit_vw' at the Matlab prompt.
To get this working with my Matlab installation, I additionally had to deselect the "Automatically create parallel pool (if one doesn't already exist) when parallel keywords (e.g., parfor) are executed." option. This can be found in Matlab's preferences menu (--> see the Parallel Computing toolbox section).
As an alternative, using two workers might also be an option in your case:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2)
To get this alternative approach working, I did not have to change the Matlab preferences.
Hope this helps,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu
To: freesurfer@nmr.mgh.harvard.edu <freesurfer@nmr.mgh.harvard.ed u> Subject: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Sun, 4 Mar 2018 23:56:03 +0100
Dear Freesurfer Community,
Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the following error, Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 104) You requested a minimum of 8 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
Error in lme_mass_fit (line 137) parpool(prs);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
I have researched the forum on how to stop the function from trying to initiate parallel processing but so far haven’t been able figure out how to overcome this.
Any help would be much appreciated.
Mayank Kaushal MD MBA Postdoctoral Fellow Department of Neurosurgery Medical College of Wisconsin
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR - cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners. or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgs pw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=4ORZf53F92dPjiBGXnKHpr- EpQ0EcHphHdwjrXBmi2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR - cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3wnuPmKgzUIsDM1jpSeXZ5V q_ k4&s=l79g5eOp0ctiFMn0i9TPGz-xgQD77NyKMbK1SskWckA&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu9m0d_7s53UXt0ZNl0blCKx Ns&s=GexmzGtdEYAmFIlm6hCmI2663Z-CgUy8UHaLR-K7C2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_complia... . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
I have tabulated the columns for easier comprehension.
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
intercept
time of each scan from base scan for a given subject
age at first scan for a given subject
group (1, 2, or 3)
visit (1,2 3, or 4)
Column 2 * Column 3
Thanks again.
Mayank On Mar 6, 2018, at 12:05 PM, Kaushal, Mayank <mkaushal@mcw.edumailto:mkaushal@mcw.edu> wrote:
Changing the Matlab directory worked. Thanks for all your inputs, Kersten.
Sorry to prolong the conversation but if possible, I would appreciate input on whether my thought process regarding the LME analysis is on the right track.
I am looking to compare cortical thickness between 3 groups over multiple visits.
The design matrix created by me X = [ones(length(M),1) M M(:,1).*M(:,2)]; Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 intercept time of each scan from base scan age at first scan group (1, 2, or 3) visit (1,2 3, or 4) Column 2 * Column 3
Presently, I am running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) as a test run.
However, I would like to include Columns 1, 4, and 5 as random effects for LME analysis and if possible even include Column 2 as a random effect to have 4 random effects. lhstats = lme_mass_fit_vw(X,[1 4 5],Y,ni,lhcortex,[],1) or lhstats = lme_mass_fit_vw(X,[1 2 4 5],Y,ni,lhcortex,[],1)
Now, I would like to know if having 3 or possibly 4 random effects would be too many random effects.
Mayank On Mar 6, 2018, at 8:57 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne.demailto:Kersten.Diers@dzne.demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
The LME toolbox will create a text file ('parfor_progress1.txt') in Matlab's present working directory to indicate its progress in processing each vertex.
To create this file it needs to have write permissions in Matlab's present working directory.
I speculate that your present working directory in Matlab is the root directory '/' where the toolbox cannot create a file.
The solution would be to not run the scripts from '/', but to set the Matlab working directory to another directory where you have write permissions.
Best regards
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Tue, 6 Mar 2018 15:17:31 +0100
After downloading version 6.0. and running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1), I received the following errors.
Error using parfor_progress (line 17) Do you have write permissions for /?
Error in lme_mass_fit (line 155) fn = parfor_progress('init',nv);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
Thoughts?
Mayank
On Mar 6, 2018, at 7:08 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Yes,
my understanding is the same.
The LME toolbox can in a way be regarded as a post-processing add-on to Freesurfer. The only interface with Freesurfer are the read/write functions, everything else is to the best of my knowledge independent of Freesurfer. So I cannot see any problems in using the newer version of the LME toolbox with data from Freesurfer 5.3.
Needless to say, this does not affect the usual recommendation, which is that Freesurfer versions should not be mixed in general.
Best,
Kersten
------Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 20:47:36 +0100
The version string I have been using: $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $ So, it appears that I do indeed have the older version.
I am running Matlab 2017a, which is a relatively newer version.
Before I proceed with using LME toolbox from a freesurfer 6.0, I would appreciate your input on the following.
My understanding is that LME toolbox is used for statistical analysis and is independent of the freesurfer version performing the actual cortical thickness analysis. So, in theory, if I import cortical thickness data processed in version 5.3, I should still be able to run the LME toolbox from a version 6.0. So, can I input the files processed by freesurfer 5.3 (files that have been processed till mris_preproc and mri_surf2surf) and simply use the LME toolbox from a version 6.0 to perform the statistical analysis?
Mayank
On Mar 5, 2018, at 1:29 PM, Diers, Kersten /DZNE <Kersten.Diers@dzn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
thanks for the additional information.
I believe that we are dealing with a version issue now.
Specifically, I have so far been testing with an LME toolbox from a Freesurfer 6.0 version on Matlab R2016a. In that sense, there is no need for a separate download of the LME scripts, since they are already included within the freesurfer directory (e.g. 'freesurfer/matlab/lme').
It is primarily the 'lme_mass_fit.m' script, which throws the current error. Could you please check your version of this script (type 'help lme_mass_fit.m')?
Within my 5.3 installation, the version string is: % $Revision: 1.1.2.2 $ $Date: 2013/02/23 21:08:10 $
Within my 6.0 installation, the version string is: $Revision: 1.3 $ $Date: 2016/04/08 19:39:24 $
Unfortunately, the version string of the 'lme_mass_fit.m' script within a toolbox that I just downloaded from the LME website is the most ancient one: % $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $
When I use the 1.1.1.1 version instead of the one that is included within Freesurfer 6.0, I can replicate the problem reported in your current mail. With the 1.3 version I have no issues.
As far as I know, the 'lme_mass_fit.m' script was updated to accommodate the changes in Matlab's way of doing the parallel processing. In older Matlab versions this was done using the 'matlabpool' command, but this was replaced by 'parpool', which is - to my knowledge - the only way of running parallel processing with recent Matlab versions. The LME toolbox was originally only tailored to the 'matlabpool' command, but has later been adapted to also include the 'parpool' command.
Assuming that you are using a relatively recent Matlab version, the use of earlier vs. later versions of the toolbox would explain our respective observations.
All in all, I currently see no way of getting an older version of the LME toolbox to run with a current Matlab version - except from modifying the code itself. So my suggestion would be to just use the newer LME toolbox that is shipped with Freesurfer 6.0.
Let us know if I am mistaken or if there are further issues.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 16:34:14 +0100
Thanks for the quick response Kersten.
I tried all the potential suggestions mentioned in your post but still no luck.
Here’s the summary:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 124) if (matlabpool('size') > 0)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 123) if (prs==1) || (matlabpool('size') ~= prs)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
The "automatically create a parallel pool" was already deselected in my case.
Also, I am using freesurfer 5.3 with LME toolbox downloaded from the freesurfer website.
Mayank
On Mar 5, 2018, at 9:12 AM, Diers, Kersten /DZNE <Kersten.Diers@d zn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
you might try supplying an additional command-line argument while calling the 'lme_mass_fit_vw' function:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1)
This will tell Matlab to use only one worker. Further documentation on this additional argument can be obtained by typing 'help lme_mass_fit_vw' at the Matlab prompt.
To get this working with my Matlab installation, I additionally had to deselect the "Automatically create parallel pool (if one doesn't already exist) when parallel keywords (e.g., parfor) are executed." option. This can be found in Matlab's preferences menu (--> see the Parallel Computing toolbox section).
As an alternative, using two workers might also be an option in your case:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2)
To get this alternative approach working, I did not have to change the Matlab preferences.
Hope this helps,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu
To: freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu <freesurfer@nmr.mgh.harvard.edmailto:freesurfer@nmr.mgh.harvard.ed u> Subject: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Sun, 4 Mar 2018 23:56:03 +0100
Dear Freesurfer Community,
Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the following error, Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 104) You requested a minimum of 8 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
Error in lme_mass_fit (line 137) parpool(prs);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
I have researched the forum on how to stop the function from trying to initiate parallel processing but so far haven’t been able figure out how to overcome this.
Any help would be much appreciated.
Mayank Kaushal MD MBA Postdoctoral Fellow Department of Neurosurgery Medical College of Wisconsin
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR - cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners. or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgs pw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=4ORZf53F92dPjiBGXnKHpr- EpQ0EcHphHdwjrXBmi2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR - cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3wnuPmKgzUIsDM1jpSeXZ5V q_ k4&s=l79g5eOp0ctiFMn0i9TPGz-xgQD77NyKMbK1SskWckA&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu9m0d_7s53UXt0ZNl0blCKx Ns&s=GexmzGtdEYAmFIlm6hCmI2663Z-CgUy8UHaLR-K7C2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_complia... . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_complia... . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Hi Mayank,
I may have a few more general considerations before commenting on the number and kind of random effects.
In the current design matrix, column 2 (time from baseline) and column 5 (visit) will be quite redundant. It is one of the advantages of the LME model to be able to deal with unevenly spaced observation intervals and also with possibly missing visits. In that sense, all temporal information is already contained within column 2, and I cannot see a good reason to additionally include column 5. It may even complicate things, due to the redundancy.
If you have 3 groups, you will need two columns in the design matrix to indicate group membership (assuming that an intercept column is also present). Choose one group (say, group 1) as the reference group, which will not explicitly be coded, and then use one of the two group columns to indicate if a person belongs to group 2 (1=yes, 0=no), and the other to indicate if a person belongs to group 3 (1=yes, 0=no).
Please don't code group membership numerically as 1, 2, 3 in a single column, as this will impose a linear relation between group membership and outcome measure (similar to linear regression).
I am not sure about the current meaning of column 6, which multiplies age and time-from-baseline. It would be more important, in my eyes, to multiply time-from-baseline and group membership. Considering my second comment, this will also result in two colums. These will indicate whether or not the effect of time will differ between groups, and this (=different longitudinal trajectory) is often the primary interest in longitudinal studies.
As far as I can see, your overall design is somewhat similar to the univariate example on the Freesurfer LME webpage, except that you have fewer groups and fewer covariates. As it does not matter for the design matrix whether or not the overall study is univariate or mass- univariate (as in your case), one suggestion would be that you construct your design in a similar way as in the given example.
I hope that I have understood your design correctly, otherwise let me know.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Tue, 6 Mar 2018 19:22:57 +0100
I have tabulated the columns for easier comprehension.
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
intercept
time of each scan from base scan for a given subject
age at first scan for a given subject
group (1, 2, or 3)
visit (1,2 3, or 4)
Column 2 * Column 3
Thanks again.
Mayank On Mar 6, 2018, at 12:05 PM, Kaushal, Mayank <mkaushal@mcw.edumailto:m kaushal@mcw.edu> wrote:
Changing the Matlab directory worked. Thanks for all your inputs, Kersten.
Sorry to prolong the conversation but if possible, I would appreciate input on whether my thought process regarding the LME analysis is on the right track.
I am looking to compare cortical thickness between 3 groups over multiple visits.
The design matrix created by me X = [ones(length(M),1) M M(:,1).*M(:,2)]; Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 intercept time of each scan from base scan age at first scan group (1, 2, or 3) visit (1,2 3, or 4) Column 2 * Column 3
Presently, I am running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) as a test run.
However, I would like to include Columns 1, 4, and 5 as random effects for LME analysis and if possible even include Column 2 as a random effect to have 4 random effects. lhstats = lme_mass_fit_vw(X,[1 4 5],Y,ni,lhcortex,[],1) or lhstats = lme_mass_fit_vw(X,[1 2 4 5],Y,ni,lhcortex,[],1)
Now, I would like to know if having 3 or possibly 4 random effects would be too many random effects.
Mayank On Mar 6, 2018, at 8:57 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne.de mailto:Kersten.Diers@dzne.demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
The LME toolbox will create a text file ('parfor_progress1.txt') in Matlab's present working directory to indicate its progress in processing each vertex.
To create this file it needs to have write permissions in Matlab's present working directory.
I speculate that your present working directory in Matlab is the root directory '/' where the toolbox cannot create a file.
The solution would be to not run the scripts from '/', but to set the Matlab working directory to another directory where you have write permissions.
Best regards
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu<mail to:mkaushal@mcw.edu>> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mailt o:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:free surfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Tue, 6 Mar 2018 15:17:31 +0100
After downloading version 6.0. and running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1), I received the following errors.
Error using parfor_progress (line 17) Do you have write permissions for /?
Error in lme_mass_fit (line 155) fn = parfor_progress('init',nv);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
Thoughts?
Mayank
On Mar 6, 2018, at 7:08 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Yes,
my understanding is the same.
The LME toolbox can in a way be regarded as a post-processing add-on to Freesurfer. The only interface with Freesurfer are the read/write functions, everything else is to the best of my knowledge independent of Freesurfer. So I cannot see any problems in using the newer version of the LME toolbox with data from Freesurfer 5.3.
Needless to say, this does not affect the usual recommendation, which is that Freesurfer versions should not be mixed in general.
Best,
Kersten
------Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mailt o:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:free surfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 20:47:36 +0100
The version string I have been using: $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $ So, it appears that I do indeed have the older version.
I am running Matlab 2017a, which is a relatively newer version.
Before I proceed with using LME toolbox from a freesurfer 6.0, I would appreciate your input on the following.
My understanding is that LME toolbox is used for statistical analysis and is independent of the freesurfer version performing the actual cortical thickness analysis. So, in theory, if I import cortical thickness data processed in version 5.3, I should still be able to run the LME toolbox from a version 6.0. So, can I input the files processed by freesurfer 5.3 (files that have been processed till mris_preproc and mri_surf2surf) and simply use the LME toolbox from a version 6.0 to perform the statistical analysis?
Mayank
On Mar 5, 2018, at 1:29 PM, Diers, Kersten /DZNE <Kersten.Diers@dzn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
thanks for the additional information.
I believe that we are dealing with a version issue now.
Specifically, I have so far been testing with an LME toolbox from a Freesurfer 6.0 version on Matlab R2016a. In that sense, there is no need for a separate download of the LME scripts, since they are already included within the freesurfer directory (e.g. 'freesurfer/matlab/lme').
It is primarily the 'lme_mass_fit.m' script, which throws the current error. Could you please check your version of this script (type 'help lme_mass_fit.m')?
Within my 5.3 installation, the version string is: % $Revision: 1.1.2.2 $ $Date: 2013/02/23 21:08:10 $
Within my 6.0 installation, the version string is: $Revision: 1.3 $ $Date: 2016/04/08 19:39:24 $
Unfortunately, the version string of the 'lme_mass_fit.m' script within a toolbox that I just downloaded from the LME website is the most ancient one: % $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $
When I use the 1.1.1.1 version instead of the one that is included within Freesurfer 6.0, I can replicate the problem reported in your current mail. With the 1.3 version I have no issues.
As far as I know, the 'lme_mass_fit.m' script was updated to accommodate the changes in Matlab's way of doing the parallel processing. In older Matlab versions this was done using the 'matlabpool' command, but this was replaced by 'parpool', which is - to my knowledge - the only way of running parallel processing with recent Matlab versions. The LME toolbox was originally only tailored to the 'matlabpool' command, but has later been adapted to also include the 'parpool' command.
Assuming that you are using a relatively recent Matlab version, the use of earlier vs. later versions of the toolbox would explain our respective observations.
All in all, I currently see no way of getting an older version of the LME toolbox to run with a current Matlab version - except from modifying the code itself. So my suggestion would be to just use the newer LME toolbox that is shipped with Freesurfer 6.0.
Let us know if I am mistaken or if there are further issues.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mailt o:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:free surfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 16:34:14 +0100
Thanks for the quick response Kersten.
I tried all the potential suggestions mentioned in your post but still no luck.
Here’s the summary:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 124) if (matlabpool('size') > 0)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 123) if (prs==1) || (matlabpool('size') ~= prs)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
The "automatically create a parallel pool" was already deselected in my case.
Also, I am using freesurfer 5.3 with LME toolbox downloaded from the freesurfer website.
Mayank
On Mar 5, 2018, at 9:12 AM, Diers, Kersten /DZNE <Kersten.Diers@d zn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
you might try supplying an additional command-line argument while calling the 'lme_mass_fit_vw' function:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1)
This will tell Matlab to use only one worker. Further documentation on this additional argument can be obtained by typing 'help lme_mass_fit_vw' at the Matlab prompt.
To get this working with my Matlab installation, I additionally had to deselect the "Automatically create parallel pool (if one doesn't already exist) when parallel keywords (e.g., parfor) are executed." option. This can be found in Matlab's preferences menu (--> see the Parallel Computing toolbox section).
As an alternative, using two workers might also be an option in your case:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2)
To get this alternative approach working, I did not have to change the Matlab preferences.
Hope this helps,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mailt o:freesurfer@nmr.mgh.harvard.edu>
To: freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.ed u <freesurfer@nmr.mgh.harvard.edmailto:freesurfer@nmr.mgh.harvard.ed u> Subject: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Sun, 4 Mar 2018 23:56:03 +0100
Dear Freesurfer Community,
Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the following error, Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 104) You requested a minimum of 8 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
Error in lme_mass_fit (line 137) parpool(prs);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
I have researched the forum on how to stop the function from trying to initiate parallel processing but so far haven’t been able figure out how to overcome this.
Any help would be much appreciated.
Mayank Kaushal MD MBA Postdoctoral Fellow Department of Neurosurgery Medical College of Wisconsin
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR - cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners. or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgs pw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=4ORZf53F92dPjiBGXnKHpr- EpQ0EcHphHdwjrXBmi2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR - cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3wnuPmKgzUIsDM1jpSeXZ5V q_ k4&s=l79g5eOp0ctiFMn0i9TPGz-xgQD77NyKMbK1SskWckA&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu9m0d_7s53UXt0ZNl0blCKx Ns&s=GexmzGtdEYAmFIlm6hCmI2663Z-CgUy8UHaLR-K7C2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harva rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzkt5 1TCVmkFxY2vY-Ag_iM&s=GO_IQm-SiVRVkbf2CjC0vitbE36m5J11HMxymoSucXI&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_co mplianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y&r=R qvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzkt51TCVmkFxY2vY- Ag_iM&s=IjgRll5-M3Zti1umbPJ31L6xeflAsxz9YUcZS2jnsyE&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harva rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzkt5 1TCVmkFxY2vY-Ag_iM&s=GO_IQm-SiVRVkbf2CjC0vitbE36m5J11HMxymoSucXI&e=
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harva rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=JtHeh4F36Zz1ELE7LnYzZXcbl TZGl5bubrruLBAzfrw&s=N7bPtrlGX5UKHsj87HzubSjQ5VXnkSpEuYwo_I-ypJU&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_co mplianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y&r=R qvEwdmcEg_aWsE7PBL80w&m=JtHeh4F36Zz1ELE7LnYzZXcblTZGl5bubrruLBAzfrw&s=4 RDz2B3bkbGv045ePFVlaXOUhwU-3UOmzh11Xp8sYJc&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
I have made the suggested edits and would appreciate if you could take a look at the qdec.table.dat file attached to this conversation.
After going over the univariate example on the Freesurfer LME webpage, I had a couple of questions.
1. How will data be loaded into Matlab? More specifically, what would be the step(s) after the line M = Qdec2num(Qdec);?
2. Given that column named time_base_scan would be multiplied with column named group2 as well as group3, what will be the equation for creating the design matrix? X = [ones(length(M),1) M M(:,).*M(:,)];
Hi,
let me just mention that my previous comments were directed at the design matrix X and not necessarily at the QDEC table. In that sense, it is possible, but not necessary to modify the QDEC table prior to loading it into Matlab. Alternatively, one might do these modifications within Matlab, although this would require some additional manual coding.
For the present analysis, however, the current qdec table looks fine.
About question 1:
If I understood correctly, you have so far loaded the (modified) QDEC table and stored the extracted information within the matlab variable 'M'.
In addition to that you'd also need to sort the data within each subject according to time, and load 'Y', 'lhcortex' and possibly 'lhsphere'. For a description of all of these steps please see the "mass-univariate" section of the example data analysis on the tutorial page.
About question 2:
Just to be precise, I assume that for this particular case the matlab variable 'M' contains the following four columns: time-from-baseline, age-at-baseline, group2, group3; where 'group2' and 'group3' indicate memberships in groups 2 and 3, respectively.
Then, a design matrix can be created as follows:
X = [ones(length(M),1) M M(:,1).*M(:,3) M(:,1).*M(:,4)];
Then the order of the columns of X is: intercept, time-from-baseline, age-at-baseline, group2, group3, time-from-baseline*group2, time-from- baseline*group3.
Let's keep in mind that the order of columns in X is important for the formulation of contrasts at a later stage (and is different from the tutorial example).
Again, this procedure and the matrices M and X are specific for this particular analysis scenario and cannot necessarily be generalized to others.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Wed, 7 Mar 2018 15:48:36 +0100
I have made the suggested edits and would appreciate if you could take a look at the qdec.table.dat file attached to this conversation.
After going over the univariate example on the Freesurfer LME webpage, I had a couple of questions.
1. How will data be loaded into Matlab? More specifically, what would be the step(s) after the line M = Qdec2num(Qdec);?
2. Given that column named time_base_scan would be multiplied with column named group2 as well as group3, what will be the equation for creating the design matrix? X = [ones(length(M),1) M M(:,).*M(:,)];
Mayank
On Mar 7, 2018, at 7:14 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi Mayank,
I may have a few more general considerations before commenting on the number and kind of random effects.
In the current design matrix, column 2 (time from baseline) and column 5 (visit) will be quite redundant. It is one of the advantages of the LME model to be able to deal with unevenly spaced observation intervals and also with possibly missing visits. In that sense, all temporal information is already contained within column 2, and I cannot see a good reason to additionally include column 5. It may even complicate things, due to the redundancy.
If you have 3 groups, you will need two columns in the design matrix to indicate group membership (assuming that an intercept column is also present). Choose one group (say, group 1) as the reference group, which will not explicitly be coded, and then use one of the two group columns to indicate if a person belongs to group 2 (1=yes, 0=no), and the other to indicate if a person belongs to group 3 (1=yes, 0=no).
Please don't code group membership numerically as 1, 2, 3 in a single column, as this will impose a linear relation between group membership and outcome measure (similar to linear regression).
I am not sure about the current meaning of column 6, which multiplies age and time-from-baseline. It would be more important, in my eyes, to multiply time-from-baseline and group membership. Considering my second comment, this will also result in two colums. These will indicate whether or not the effect of time will differ between groups, and this (=different longitudinal trajectory) is often the primary interest in longitudinal studies.
As far as I can see, your overall design is somewhat similar to the univariate example on the Freesurfer LME webpage, except that you have fewer groups and fewer covariates. As it does not matter for the design matrix whether or not the overall study is univariate or mass- univariate (as in your case), one suggestion would be that you construct your design in a similar way as in the given example.
I hope that I have understood your design correctly, otherwise let me know.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Tue, 6 Mar 2018 19:22:57 +0100
I have tabulated the columns for easier comprehension.
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
intercept
time of each scan from base scan for a given subject
age at first scan for a given subject
group (1, 2, or 3)
visit (1,2 3, or 4)
Column 2 * Column 3
Thanks again.
Mayank On Mar 6, 2018, at 12:05 PM, Kaushal, Mayank <mkaushal@mcw.edu<mailto :m kaushal@mcw.edu>> wrote:
Changing the Matlab directory worked. Thanks for all your inputs, Kersten.
Sorry to prolong the conversation but if possible, I would appreciate input on whether my thought process regarding the LME analysis is on the right track.
I am looking to compare cortical thickness between 3 groups over multiple visits.
The design matrix created by me X = [ones(length(M),1) M M(:,1).*M(:,2)]; Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 intercept time of each scan from base scan age at first scan group (1, 2, or 3) visit (1,2 3, or 4) Column 2 * Column 3
Presently, I am running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) as a test run.
However, I would like to include Columns 1, 4, and 5 as random effects for LME analysis and if possible even include Column 2 as a random effect to have 4 random effects. lhstats = lme_mass_fit_vw(X,[1 4 5],Y,ni,lhcortex,[],1) or lhstats = lme_mass_fit_vw(X,[1 2 4 5],Y,ni,lhcortex,[],1)
Now, I would like to know if having 3 or possibly 4 random effects would be too many random effects.
Mayank On Mar 6, 2018, at 8:57 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de mailto:Kersten.Diers@dzne.demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
The LME toolbox will create a text file ('parfor_progress1.txt') in Matlab's present working directory to indicate its progress in processing each vertex.
To create this file it needs to have write permissions in Matlab's present working directory.
I speculate that your present working directory in Matlab is the root directory '/' where the toolbox cannot create a file.
The solution would be to not run the scripts from '/', but to set the Matlab working directory to another directory where you have write permissions.
Best regards
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu<ma il to:mkaushal@mcw.edu>> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lt o:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:fr ee surfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Tue, 6 Mar 2018 15:17:31 +0100
After downloading version 6.0. and running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1), I received the following errors.
Error using parfor_progress (line 17) Do you have write permissions for /?
Error in lme_mass_fit (line 155) fn = parfor_progress('init',nv);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
Thoughts?
Mayank
On Mar 6, 2018, at 7:08 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Yes,
my understanding is the same.
The LME toolbox can in a way be regarded as a post-processing add-on to Freesurfer. The only interface with Freesurfer are the read/write functions, everything else is to the best of my knowledge independent of Freesurfer. So I cannot see any problems in using the newer version of the LME toolbox with data from Freesurfer 5.3.
Needless to say, this does not affect the usual recommendation, which is that Freesurfer versions should not be mixed in general.
Best,
Kersten
------Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lt o:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:fr ee surfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 20:47:36 +0100
The version string I have been using: $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $ So, it appears that I do indeed have the older version.
I am running Matlab 2017a, which is a relatively newer version.
Before I proceed with using LME toolbox from a freesurfer 6.0, I would appreciate your input on the following.
My understanding is that LME toolbox is used for statistical analysis and is independent of the freesurfer version performing the actual cortical thickness analysis. So, in theory, if I import cortical thickness data processed in version 5.3, I should still be able to run the LME toolbox from a version 6.0. So, can I input the files processed by freesurfer 5.3 (files that have been processed till mris_preproc and mri_surf2surf) and simply use the LME toolbox from a version 6.0 to perform the statistical analysis?
Mayank
On Mar 5, 2018, at 1:29 PM, Diers, Kersten /DZNE <Kersten.Diers@dzn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
thanks for the additional information.
I believe that we are dealing with a version issue now.
Specifically, I have so far been testing with an LME toolbox from a Freesurfer 6.0 version on Matlab R2016a. In that sense, there is no need for a separate download of the LME scripts, since they are already included within the freesurfer directory (e.g. 'freesurfer/matlab/lme').
It is primarily the 'lme_mass_fit.m' script, which throws the current error. Could you please check your version of this script (type 'help lme_mass_fit.m')?
Within my 5.3 installation, the version string is: % $Revision: 1.1.2.2 $ $Date: 2013/02/23 21:08:10 $
Within my 6.0 installation, the version string is: $Revision: 1.3 $ $Date: 2016/04/08 19:39:24 $
Unfortunately, the version string of the 'lme_mass_fit.m' script within a toolbox that I just downloaded from the LME website is the most ancient one: % $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $
When I use the 1.1.1.1 version instead of the one that is included within Freesurfer 6.0, I can replicate the problem reported in your current mail. With the 1.3 version I have no issues.
As far as I know, the 'lme_mass_fit.m' script was updated to accommodate the changes in Matlab's way of doing the parallel processing. In older Matlab versions this was done using the 'matlabpool' command, but this was replaced by 'parpool', which is
to my knowledge - the only way of running parallel processing with recent Matlab versions. The LME toolbox was originally only tailored to the 'matlabpool' command, but has later been adapted to also include the 'parpool' command.
Assuming that you are using a relatively recent Matlab version, the use of earlier vs. later versions of the toolbox would explain our respective observations.
All in all, I currently see no way of getting an older version of the LME toolbox to run with a current Matlab version - except from modifying the code itself. So my suggestion would be to just use the newer LME toolbox that is shipped with Freesurfer 6.0.
Let us know if I am mistaken or if there are further issues.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lt o:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:fr ee surfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 16:34:14 +0100
Thanks for the quick response Kersten.
I tried all the potential suggestions mentioned in your post but still no luck.
Here’s the summary:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 124) if (matlabpool('size') > 0)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 123) if (prs==1) || (matlabpool('size') ~= prs)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
The "automatically create a parallel pool" was already deselected in my case.
Also, I am using freesurfer 5.3 with LME toolbox downloaded from the freesurfer website.
Mayank
On Mar 5, 2018, at 9:12 AM, Diers, Kersten /DZNE <Kersten.Diers@d zn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
you might try supplying an additional command-line argument while calling the 'lme_mass_fit_vw' function:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1)
This will tell Matlab to use only one worker. Further documentation on this additional argument can be obtained by typing 'help lme_mass_fit_vw' at the Matlab prompt.
To get this working with my Matlab installation, I additionally had to deselect the "Automatically create parallel pool (if one doesn't already exist) when parallel keywords (e.g., parfor) are executed." option. This can be found in Matlab's preferences menu (--> see the Parallel Computing toolbox section).
As an alternative, using two workers might also be an option in your case:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2)
To get this alternative approach working, I did not have to change the Matlab preferences.
Hope this helps,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lt o:freesurfer@nmr.mgh.harvard.edu>
To: freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard. ed u <freesurfer@nmr.mgh.harvard.edmailto:freesurfer@nmr.mgh.harvard.e d u> Subject: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Sun, 4 Mar 2018 23:56:03 +0100
Dear Freesurfer Community,
Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the following error, Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 104) You requested a minimum of 8 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
Error in lme_mass_fit (line 137) parpool(prs);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
I have researched the forum on how to stop the function from trying to initiate parallel processing but so far haven’t been able figure out how to overcome this.
Any help would be much appreciated.
Mayank Kaushal MD MBA Postdoctoral Fellow Department of Neurosurgery Medical College of Wisconsin
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR
cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners. or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgs pw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=4ORZf53F92dPjiBGXnKHpr- EpQ0EcHphHdwjrXBmi2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR
cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3wnuPmKgzUIsDM1jpSeXZ5V q_ k4&s=l79g5eOp0ctiFMn0i9TPGz-xgQD77NyKMbK1SskWckA&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu9m0d_7s53UXt0ZNl0blCKx Ns&s=GexmzGtdEYAmFIlm6hCmI2663Z-CgUy8UHaLR-K7C2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har va rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0i qF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzk t5 1TCVmkFxY2vY-Ag_iM&s=GO_IQm-SiVRVkbf2CjC0vitbE36m5J11HMxymoSucXI&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ co mplianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y&r =R qvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzkt51TCVmkFxY2vY- Ag_iM&s=IjgRll5-M3Zti1umbPJ31L6xeflAsxz9YUcZS2jnsyE&e= . If the e- mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har va rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0i qF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzk t5 1TCVmkFxY2vY-Ag_iM&s=GO_IQm-SiVRVkbf2CjC0vitbE36m5J11HMxymoSucXI&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har va rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0i qF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=JtHeh4F36Zz1ELE7LnYzZXc bl TZGl5bubrruLBAzfrw&s=N7bPtrlGX5UKHsj87HzubSjQ5VXnkSpEuYwo_I-ypJU&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ co mplianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y&r =R qvEwdmcEg_aWsE7PBL80w&m=JtHeh4F36Zz1ELE7LnYzZXcblTZGl5bubrruLBAzfrw&s =4 RDz2B3bkbGv045ePFVlaXOUhwU-3UOmzh11Xp8sYJc&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=GVM70MOA7CO9xz- DDMXn5Uq1e-YXiQbvHQnZkzH2lg8&s=Kjem-y9X16SRBARNZVRJ4zsVrtJ7BUt- PTmhkGvra68&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=GVM70MOA7CO9xz-DDMXn5Uq1e- YXiQbvHQnZkzH2lg8&s=xNpiFQrEL4qVzqqt4k7lDdv81WoNgalrePcN7qcKFz4&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=GVM70MOA7CO9xz- DDMXn5Uq1e-YXiQbvHQnZkzH2lg8&s=Kjem-y9X16SRBARNZVRJ4zsVrtJ7BUt- PTmhkGvra68&e=
Your inputs have been very helpful.
Looking at the examples on LME webpage, the contrast for both univariate and mass-variate creates 3 rows with 14 columns for univariate and 17 for mass-variate analysis. My understanding is that 3 rows have been created because there are 4 groups being analyzed and applying that rationale to my data would mean that the contrast for my analysis would require 2 rows since I comparing 3 groups. Is my logic correct here?
So, for my analysis if I want to include two random effects, namely, intercept and time_from_base_scan, which are given in Column 1 and 2, respectively, the contrasts based on M having 6 columns would as follows: CM.C = [1 1 ; 1 1] zeros(2,4)]; or CM.C = [1 1 0 0 0 0; 1 1 0 0 0 0]
Mayank On Mar 7, 2018, at 3:33 PM, Diers, Kersten /DZNE <Kersten.Diers@dzne.demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
let me just mention that my previous comments were directed at the design matrix X and not necessarily at the QDEC table. In that sense, it is possible, but not necessary to modify the QDEC table prior to loading it into Matlab. Alternatively, one might do these modifications within Matlab, although this would require some additional manual coding.
For the present analysis, however, the current qdec table looks fine.
About question 1:
If I understood correctly, you have so far loaded the (modified) QDEC table and stored the extracted information within the matlab variable 'M'.
In addition to that you'd also need to sort the data within each subject according to time, and load 'Y', 'lhcortex' and possibly 'lhsphere'. For a description of all of these steps please see the "mass-univariate" section of the example data analysis on the tutorial page.
About question 2:
Just to be precise, I assume that for this particular case the matlab variable 'M' contains the following four columns: time-from-baseline, age-at-baseline, group2, group3; where 'group2' and 'group3' indicate memberships in groups 2 and 3, respectively.
Then, a design matrix can be created as follows:
X = [ones(length(M),1) M M(:,1).*M(:,3) M(:,1).*M(:,4)];
Then the order of the columns of X is: intercept, time-from-baseline, age-at-baseline, group2, group3, time-from-baseline*group2, time-from- baseline*group3.
Let's keep in mind that the order of columns in X is important for the formulation of contrasts at a later stage (and is different from the tutorial example).
Again, this procedure and the matrices M and X are specific for this particular analysis scenario and cannot necessarily be generalized to others.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Wed, 7 Mar 2018 15:48:36 +0100
I have made the suggested edits and would appreciate if you could take a look at the qdec.table.dat file attached to this conversation.
After going over the univariate example on the Freesurfer LME webpage, I had a couple of questions.
1. How will data be loaded into Matlab? More specifically, what would be the step(s) after the line M = Qdec2num(Qdec);?
2. Given that column named time_base_scan would be multiplied with column named group2 as well as group3, what will be the equation for creating the design matrix? X = [ones(length(M),1) M M(:,).*M(:,)];
Mayank On Mar 7, 2018, at 7:14 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi Mayank,
I may have a few more general considerations before commenting on the number and kind of random effects.
In the current design matrix, column 2 (time from baseline) and column 5 (visit) will be quite redundant. It is one of the advantages of the LME model to be able to deal with unevenly spaced observation intervals and also with possibly missing visits. In that sense, all temporal information is already contained within column 2, and I cannot see a good reason to additionally include column 5. It may even complicate things, due to the redundancy.
If you have 3 groups, you will need two columns in the design matrix to indicate group membership (assuming that an intercept column is also present). Choose one group (say, group 1) as the reference group, which will not explicitly be coded, and then use one of the two group columns to indicate if a person belongs to group 2 (1=yes, 0=no), and the other to indicate if a person belongs to group 3 (1=yes, 0=no).
Please don't code group membership numerically as 1, 2, 3 in a single column, as this will impose a linear relation between group membership and outcome measure (similar to linear regression).
I am not sure about the current meaning of column 6, which multiplies age and time-from-baseline. It would be more important, in my eyes, to multiply time-from-baseline and group membership. Considering my second comment, this will also result in two colums. These will indicate whether or not the effect of time will differ between groups, and this (=different longitudinal trajectory) is often the primary interest in longitudinal studies.
As far as I can see, your overall design is somewhat similar to the univariate example on the Freesurfer LME webpage, except that you have fewer groups and fewer covariates. As it does not matter for the design matrix whether or not the overall study is univariate or mass- univariate (as in your case), one suggestion would be that you construct your design in a similar way as in the given example.
I hope that I have understood your design correctly, otherwise let me know.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Tue, 6 Mar 2018 19:22:57 +0100
I have tabulated the columns for easier comprehension.
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
intercept
time of each scan from base scan for a given subject
age at first scan for a given subject
group (1, 2, or 3)
visit (1,2 3, or 4)
Column 2 * Column 3
Thanks again.
Mayank On Mar 6, 2018, at 12:05 PM, Kaushal, Mayank <mkaushal@mcw.edu<mailto :m kaushal@mcw.edu>> wrote:
Changing the Matlab directory worked. Thanks for all your inputs, Kersten.
Sorry to prolong the conversation but if possible, I would appreciate input on whether my thought process regarding the LME analysis is on the right track.
I am looking to compare cortical thickness between 3 groups over multiple visits.
The design matrix created by me X = [ones(length(M),1) M M(:,1).*M(:,2)]; Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 intercept time of each scan from base scan age at first scan group (1, 2, or 3) visit (1,2 3, or 4) Column 2 * Column 3
Presently, I am running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) as a test run.
However, I would like to include Columns 1, 4, and 5 as random effects for LME analysis and if possible even include Column 2 as a random effect to have 4 random effects. lhstats = lme_mass_fit_vw(X,[1 4 5],Y,ni,lhcortex,[],1) or lhstats = lme_mass_fit_vw(X,[1 2 4 5],Y,ni,lhcortex,[],1)
Now, I would like to know if having 3 or possibly 4 random effects would be too many random effects.
Mayank On Mar 6, 2018, at 8:57 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de mailto:Kersten.Diers@dzne.demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
The LME toolbox will create a text file ('parfor_progress1.txt') in Matlab's present working directory to indicate its progress in processing each vertex.
To create this file it needs to have write permissions in Matlab's present working directory.
I speculate that your present working directory in Matlab is the root directory '/' where the toolbox cannot create a file.
The solution would be to not run the scripts from '/', but to set the Matlab working directory to another directory where you have write permissions.
Best regards
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu<ma il to:mkaushal@mcw.edu>> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lt o:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:fr ee surfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Tue, 6 Mar 2018 15:17:31 +0100
After downloading version 6.0. and running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1), I received the following errors.
Error using parfor_progress (line 17) Do you have write permissions for /?
Error in lme_mass_fit (line 155) fn = parfor_progress('init',nv);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
Thoughts?
Mayank
On Mar 6, 2018, at 7:08 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Yes,
my understanding is the same.
The LME toolbox can in a way be regarded as a post-processing add-on to Freesurfer. The only interface with Freesurfer are the read/write functions, everything else is to the best of my knowledge independent of Freesurfer. So I cannot see any problems in using the newer version of the LME toolbox with data from Freesurfer 5.3.
Needless to say, this does not affect the usual recommendation, which is that Freesurfer versions should not be mixed in general.
Best,
Kersten
------Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lt o:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:fr ee surfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 20:47:36 +0100
The version string I have been using: $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $ So, it appears that I do indeed have the older version.
I am running Matlab 2017a, which is a relatively newer version.
Before I proceed with using LME toolbox from a freesurfer 6.0, I would appreciate your input on the following.
My understanding is that LME toolbox is used for statistical analysis and is independent of the freesurfer version performing the actual cortical thickness analysis. So, in theory, if I import cortical thickness data processed in version 5.3, I should still be able to run the LME toolbox from a version 6.0. So, can I input the files processed by freesurfer 5.3 (files that have been processed till mris_preproc and mri_surf2surf) and simply use the LME toolbox from a version 6.0 to perform the statistical analysis?
Mayank
On Mar 5, 2018, at 1:29 PM, Diers, Kersten /DZNE <Kersten.Diers@dzn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
thanks for the additional information.
I believe that we are dealing with a version issue now.
Specifically, I have so far been testing with an LME toolbox from a Freesurfer 6.0 version on Matlab R2016a. In that sense, there is no need for a separate download of the LME scripts, since they are already included within the freesurfer directory (e.g. 'freesurfer/matlab/lme').
It is primarily the 'lme_mass_fit.m' script, which throws the current error. Could you please check your version of this script (type 'help lme_mass_fit.m')?
Within my 5.3 installation, the version string is: % $Revision: 1.1.2.2 $ $Date: 2013/02/23 21:08:10 $
Within my 6.0 installation, the version string is: $Revision: 1.3 $ $Date: 2016/04/08 19:39:24 $
Unfortunately, the version string of the 'lme_mass_fit.m' script within a toolbox that I just downloaded from the LME website is the most ancient one: % $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $
When I use the 1.1.1.1 version instead of the one that is included within Freesurfer 6.0, I can replicate the problem reported in your current mail. With the 1.3 version I have no issues.
As far as I know, the 'lme_mass_fit.m' script was updated to accommodate the changes in Matlab's way of doing the parallel processing. In older Matlab versions this was done using the 'matlabpool' command, but this was replaced by 'parpool', which is - to my knowledge - the only way of running parallel processing with recent Matlab versions. The LME toolbox was originally only tailored to the 'matlabpool' command, but has later been adapted to also include the 'parpool' command.
Assuming that you are using a relatively recent Matlab version, the use of earlier vs. later versions of the toolbox would explain our respective observations.
All in all, I currently see no way of getting an older version of the LME toolbox to run with a current Matlab version - except from modifying the code itself. So my suggestion would be to just use the newer LME toolbox that is shipped with Freesurfer 6.0.
Let us know if I am mistaken or if there are further issues.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lt o:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:fr ee surfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 16:34:14 +0100
Thanks for the quick response Kersten.
I tried all the potential suggestions mentioned in your post but still no luck.
Here’s the summary:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 124) if (matlabpool('size') > 0)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 123) if (prs==1) || (matlabpool('size') ~= prs)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
The "automatically create a parallel pool" was already deselected in my case.
Also, I am using freesurfer 5.3 with LME toolbox downloaded from the freesurfer website.
Mayank
On Mar 5, 2018, at 9:12 AM, Diers, Kersten /DZNE <Kersten.Diers@d zn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
you might try supplying an additional command-line argument while calling the 'lme_mass_fit_vw' function:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1)
This will tell Matlab to use only one worker. Further documentation on this additional argument can be obtained by typing 'help lme_mass_fit_vw' at the Matlab prompt.
To get this working with my Matlab installation, I additionally had to deselect the "Automatically create parallel pool (if one doesn't already exist) when parallel keywords (e.g., parfor) are executed." option. This can be found in Matlab's preferences menu (--> see the Parallel Computing toolbox section).
As an alternative, using two workers might also be an option in your case:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2)
To get this alternative approach working, I did not have to change the Matlab preferences.
Hope this helps,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lt o:freesurfer@nmr.mgh.harvard.edu>
To: freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard. ed u <freesurfer@nmr.mgh.harvard.edmailto:freesurfer@nmr.mgh.harvard.e d u> Subject: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Sun, 4 Mar 2018 23:56:03 +0100
Dear Freesurfer Community,
Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the following error, Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 104) You requested a minimum of 8 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
Error in lme_mass_fit (line 137) parpool(prs);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
I have researched the forum on how to stop the function from trying to initiate parallel processing but so far haven’t been able figure out how to overcome this.
Any help would be much appreciated.
Mayank Kaushal MD MBA Postdoctoral Fellow Department of Neurosurgery Medical College of Wisconsin
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR - cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners. or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgs pw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=4ORZf53F92dPjiBGXnKHpr- EpQ0EcHphHdwjrXBmi2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR - cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3wnuPmKgzUIsDM1jpSeXZ5V q_ k4&s=l79g5eOp0ctiFMn0i9TPGz-xgQD77NyKMbK1SskWckA&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu9m0d_7s53UXt0ZNl0blCKx Ns&s=GexmzGtdEYAmFIlm6hCmI2663Z-CgUy8UHaLR-K7C2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har va rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0i qF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzk t5 1TCVmkFxY2vY-Ag_iM&s=GO_IQm-SiVRVkbf2CjC0vitbE36m5J11HMxymoSucXI&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ co mplianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y&r =R qvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzkt51TCVmkFxY2vY- Ag_iM&s=IjgRll5-M3Zti1umbPJ31L6xeflAsxz9YUcZS2jnsyE&e= . If the e- mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har va rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0i qF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzk t5 1TCVmkFxY2vY-Ag_iM&s=GO_IQm-SiVRVkbf2CjC0vitbE36m5J11HMxymoSucXI&e=
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har va rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0i qF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=JtHeh4F36Zz1ELE7LnYzZXc bl TZGl5bubrruLBAzfrw&s=N7bPtrlGX5UKHsj87HzubSjQ5VXnkSpEuYwo_I-ypJU&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ co mplianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y&r =R qvEwdmcEg_aWsE7PBL80w&m=JtHeh4F36Zz1ELE7LnYzZXcblTZGl5bubrruLBAzfrw&s =4 RDz2B3bkbGv045ePFVlaXOUhwU-3UOmzh11Xp8sYJc&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=GVM70MOA7CO9xz- DDMXn5Uq1e-YXiQbvHQnZkzH2lg8&s=Kjem-y9X16SRBARNZVRJ4zsVrtJ7BUt- PTmhkGvra68&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=GVM70MOA7CO9xz-DDMXn5Uq1e- YXiQbvHQnZkzH2lg8&s=xNpiFQrEL4qVzqqt4k7lDdv81WoNgalrePcN7qcKFz4&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=GVM70MOA7CO9xz- DDMXn5Uq1e-YXiQbvHQnZkzH2lg8&s=Kjem-y9X16SRBARNZVRJ4zsVrtJ7BUt- PTmhkGvra68&e=
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_complia... . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
On Do, 2018-03-08 at 03:56 +0100, Kaushal, Mayank wrote:
Your inputs have been very helpful.
Looking at the examples on LME webpage, the contrast for both univariate and mass-variate creates 3 rows with 14 columns for univariate and 17 for mass-variate analysis. My understanding is that 3 rows have been created because there are 4 groups being analyzed and applying that rationale to my data would mean that the contrast for my analysis would require 2 rows since I comparing 3 groups. Is my logic correct here?
Yes, that's correct.
As a side note, it only applies when you want to include all three groups in a contrast. If you compare only two groups against each other, then a single line could be sufficient also in your design.
So, for my analysis if I want to include two random effects, namely, intercept and time_from_base_scan, which are given in Column 1 and 2, respectively, the contrasts based on M having 6 columns would as follows: CM.C = [1 1 ; 1 1] zeros(2,4)]; or CM.C = [1 1 0 0 0 0; 1 1 0 0 0 0]
This may be more tricky. It is not necessarily / exclusively the random effects that are of interest in a longitudinal study, and in general there are multiple valid contrasts that each test for different effects. In the above example, it would be the combined effect of the overall intercept and the time-from-baseline - I have to admit that I do not know what the interpretation of that effect would be.
So the contrast specification really depends on which question you want to ask to the data. In designs like yours, this could be the effect of group, the effect of time, group differences in the effect of time, or the effect of covariates. You'll then typically set the corresponding entries in the contrast vector to either '1' or '-1', and zero otherwise.
Hope this helps,
Kersten
Mayank On Mar 7, 2018, at 3:33 PM, Diers, Kersten /DZNE <Kersten.Diers@dzne. demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
let me just mention that my previous comments were directed at the design matrix X and not necessarily at the QDEC table. In that sense, it is possible, but not necessary to modify the QDEC table prior to loading it into Matlab. Alternatively, one might do these modifications within Matlab, although this would require some additional manual coding.
For the present analysis, however, the current qdec table looks fine.
About question 1:
If I understood correctly, you have so far loaded the (modified) QDEC table and stored the extracted information within the matlab variable 'M'.
In addition to that you'd also need to sort the data within each subject according to time, and load 'Y', 'lhcortex' and possibly 'lhsphere'. For a description of all of these steps please see the "mass-univariate" section of the example data analysis on the tutorial page.
About question 2:
Just to be precise, I assume that for this particular case the matlab variable 'M' contains the following four columns: time-from-baseline, age-at-baseline, group2, group3; where 'group2' and 'group3' indicate memberships in groups 2 and 3, respectively.
Then, a design matrix can be created as follows:
X = [ones(length(M),1) M M(:,1).*M(:,3) M(:,1).*M(:,4)];
Then the order of the columns of X is: intercept, time-from-baseline, age-at-baseline, group2, group3, time-from-baseline*group2, time- from- baseline*group3.
Let's keep in mind that the order of columns in X is important for the formulation of contrasts at a later stage (and is different from the tutorial example).
Again, this procedure and the matrices M and X are specific for this particular analysis scenario and cannot necessarily be generalized to others.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Wed, 7 Mar 2018 15:48:36 +0100
I have made the suggested edits and would appreciate if you could take a look at the qdec.table.dat file attached to this conversation.
After going over the univariate example on the Freesurfer LME webpage, I had a couple of questions.
- How will data be loaded into Matlab? More specifically, what would
be the step(s) after the line M = Qdec2num(Qdec);?
- Given that column named time_base_scan would be multiplied with
column named group2 as well as group3, what will be the equation for creating the design matrix? X = [ones(length(M),1) M M(:,).*M(:,)];
Mayank On Mar 7, 2018, at 7:14 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi Mayank,
I may have a few more general considerations before commenting on the number and kind of random effects.
In the current design matrix, column 2 (time from baseline) and column 5 (visit) will be quite redundant. It is one of the advantages of the LME model to be able to deal with unevenly spaced observation intervals and also with possibly missing visits. In that sense, all temporal information is already contained within column 2, and I cannot see a good reason to additionally include column 5. It may even complicate things, due to the redundancy.
If you have 3 groups, you will need two columns in the design matrix to indicate group membership (assuming that an intercept column is also present). Choose one group (say, group 1) as the reference group, which will not explicitly be coded, and then use one of the two group columns to indicate if a person belongs to group 2 (1=yes, 0=no), and the other to indicate if a person belongs to group 3 (1=yes, 0=no).
Please don't code group membership numerically as 1, 2, 3 in a single column, as this will impose a linear relation between group membership and outcome measure (similar to linear regression).
I am not sure about the current meaning of column 6, which multiplies age and time-from-baseline. It would be more important, in my eyes, to multiply time-from-baseline and group membership. Considering my second comment, this will also result in two colums. These will indicate whether or not the effect of time will differ between groups, and this (=different longitudinal trajectory) is often the primary interest in longitudinal studies.
As far as I can see, your overall design is somewhat similar to the univariate example on the Freesurfer LME webpage, except that you have fewer groups and fewer covariates. As it does not matter for the design matrix whether or not the overall study is univariate or mass- univariate (as in your case), one suggestion would be that you construct your design in a similar way as in the given example.
I hope that I have understood your design correctly, otherwise let me know.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" mkaushal@mcw.edu Reply-to: Freesurfer support list freesurfer@nmr.mgh.harvard.edu To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Tue, 6 Mar 2018 19:22:57 +0100
I have tabulated the columns for easier comprehension.
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
intercept
time of each scan from base scan for a given subject
age at first scan for a given subject
group (1, 2, or 3)
visit (1,2 3, or 4)
Column 2 * Column 3
Thanks again.
Mayank On Mar 6, 2018, at 12:05 PM, Kaushal, Mayank <mkaushal@mcw.edu<mailto :m kaushal@mcw.edu>> wrote:
Changing the Matlab directory worked. Thanks for all your inputs, Kersten.
Sorry to prolong the conversation but if possible, I would appreciate input on whether my thought process regarding the LME analysis is on the right track.
I am looking to compare cortical thickness between 3 groups over multiple visits.
The design matrix created by me X = [ones(length(M),1) M M(:,1).*M(:,2)]; Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 intercept time of each scan from base scan age at first scan group (1, 2, or 3) visit (1,2 3, or 4) Column 2 * Column 3
Presently, I am running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) as a test run.
However, I would like to include Columns 1, 4, and 5 as random effects for LME analysis and if possible even include Column 2 as a random effect to have 4 random effects. lhstats = lme_mass_fit_vw(X,[1 4 5],Y,ni,lhcortex,[],1) or lhstats = lme_mass_fit_vw(X,[1 2 4 5],Y,ni,lhcortex,[],1)
Now, I would like to know if having 3 or possibly 4 random effects would be too many random effects.
Mayank On Mar 6, 2018, at 8:57 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de mailto:Kersten.Diers@dzne.demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
The LME toolbox will create a text file ('parfor_progress1.txt') in Matlab's present working directory to indicate its progress in processing each vertex.
To create this file it needs to have write permissions in Matlab's present working directory.
I speculate that your present working directory in Matlab is the root directory '/' where the toolbox cannot create a file.
The solution would be to not run the scripts from '/', but to set the Matlab working directory to another directory where you have write permissions.
Best regards
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu<ma il to:mkaushal@mcw.edu>> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lt o:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:fr ee surfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Tue, 6 Mar 2018 15:17:31 +0100
After downloading version 6.0. and running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1), I received the following errors.
Error using parfor_progress (line 17) Do you have write permissions for /?
Error in lme_mass_fit (line 155) fn = parfor_progress('init',nv);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
Thoughts?
Mayank
On Mar 6, 2018, at 7:08 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Yes,
my understanding is the same.
The LME toolbox can in a way be regarded as a post-processing add-on to Freesurfer. The only interface with Freesurfer are the read/write functions, everything else is to the best of my knowledge independent of Freesurfer. So I cannot see any problems in using the newer version of the LME toolbox with data from Freesurfer 5.3.
Needless to say, this does not affect the usual recommendation, which is that Freesurfer versions should not be mixed in general.
Best,
Kersten
------Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lt o:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:fr ee surfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 20:47:36 +0100
The version string I have been using: $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $ So, it appears that I do indeed have the older version.
I am running Matlab 2017a, which is a relatively newer version.
Before I proceed with using LME toolbox from a freesurfer 6.0, I would appreciate your input on the following.
My understanding is that LME toolbox is used for statistical analysis and is independent of the freesurfer version performing the actual cortical thickness analysis. So, in theory, if I import cortical thickness data processed in version 5.3, I should still be able to run the LME toolbox from a version 6.0. So, can I input the files processed by freesurfer 5.3 (files that have been processed till mris_preproc and mri_surf2surf) and simply use the LME toolbox from a version 6.0 to perform the statistical analysis?
Mayank
On Mar 5, 2018, at 1:29 PM, Diers, Kersten /DZNE <Kersten.Diers@dzn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
thanks for the additional information.
I believe that we are dealing with a version issue now.
Specifically, I have so far been testing with an LME toolbox from a Freesurfer 6.0 version on Matlab R2016a. In that sense, there is no need for a separate download of the LME scripts, since they are already included within the freesurfer directory (e.g. 'freesurfer/matlab/lme').
It is primarily the 'lme_mass_fit.m' script, which throws the current error. Could you please check your version of this script (type 'help lme_mass_fit.m')?
Within my 5.3 installation, the version string is: % $Revision: 1.1.2.2 $ $Date: 2013/02/23 21:08:10 $
Within my 6.0 installation, the version string is: $Revision: 1.3 $ $Date: 2016/04/08 19:39:24 $
Unfortunately, the version string of the 'lme_mass_fit.m' script within a toolbox that I just downloaded from the LME website is the most ancient one: % $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $
When I use the 1.1.1.1 version instead of the one that is included within Freesurfer 6.0, I can replicate the problem reported in your current mail. With the 1.3 version I have no issues.
As far as I know, the 'lme_mass_fit.m' script was updated to accommodate the changes in Matlab's way of doing the parallel processing. In older Matlab versions this was done using the 'matlabpool' command, but this was replaced by 'parpool', which is
to my knowledge - the only way of running parallel processing with recent Matlab versions. The LME toolbox was originally only tailored to the 'matlabpool' command, but has later been adapted to also include the 'parpool' command.
Assuming that you are using a relatively recent Matlab version, the use of earlier vs. later versions of the toolbox would explain our respective observations.
All in all, I currently see no way of getting an older version of the LME toolbox to run with a current Matlab version - except from modifying the code itself. So my suggestion would be to just use the newer LME toolbox that is shipped with Freesurfer 6.0.
Let us know if I am mistaken or if there are further issues.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lt o:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:fr ee surfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 16:34:14 +0100
Thanks for the quick response Kersten.
I tried all the potential suggestions mentioned in your post but still no luck.
Here’s the summary:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 124) if (matlabpool('size') > 0)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 123) if (prs==1) || (matlabpool('size') ~= prs)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
The "automatically create a parallel pool" was already deselected in my case.
Also, I am using freesurfer 5.3 with LME toolbox downloaded from the freesurfer website.
Mayank
On Mar 5, 2018, at 9:12 AM, Diers, Kersten /DZNE <Kersten.Diers@d zn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
you might try supplying an additional command-line argument while calling the 'lme_mass_fit_vw' function:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1)
This will tell Matlab to use only one worker. Further documentation on this additional argument can be obtained by typing 'help lme_mass_fit_vw' at the Matlab prompt.
To get this working with my Matlab installation, I additionally had to deselect the "Automatically create parallel pool (if one doesn't already exist) when parallel keywords (e.g., parfor) are executed." option. This can be found in Matlab's preferences menu (--> see the Parallel Computing toolbox section).
As an alternative, using two workers might also be an option in your case:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2)
To get this alternative approach working, I did not have to change the Matlab preferences.
Hope this helps,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lt o:freesurfer@nmr.mgh.harvard.edu>
To: freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard. ed u <freesurfer@nmr.mgh.harvard.edmailto:freesurfer@nmr.mgh.harvard.e d u> Subject: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Sun, 4 Mar 2018 23:56:03 +0100
Dear Freesurfer Community,
Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the following error, Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 104) You requested a minimum of 8 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
Error in lme_mass_fit (line 137) parpool(prs);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
I have researched the forum on how to stop the function from trying to initiate parallel processing but so far haven’t been able figure out how to overcome this.
Any help would be much appreciated.
Mayank Kaushal MD MBA Postdoctoral Fellow Department of Neurosurgery Medical College of Wisconsin
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR
cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners. or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgs pw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=4ORZf53F92dPjiBGXnKHpr- EpQ0EcHphHdwjrXBmi2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR
cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3wnuPmKgzUIsDM1jpSeXZ5V q_ k4&s=l79g5eOp0ctiFMn0i9TPGz-xgQD77NyKMbK1SskWckA&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu9m0d_7s53UXt0ZNl0blCKx Ns&s=GexmzGtdEYAmFIlm6hCmI2663Z-CgUy8UHaLR-K7C2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har va rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0i qF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzk t5 1TCVmkFxY2vY-Ag_iM&s=GO_IQm-SiVRVkbf2CjC0vitbE36m5J11HMxymoSucXI&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ co mplianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y&r =R qvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzkt51TCVmkFxY2vY- Ag_iM&s=IjgRll5-M3Zti1umbPJ31L6xeflAsxz9YUcZS2jnsyE&e= . If the e- mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har va rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0i qF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzk t5 1TCVmkFxY2vY-Ag_iM&s=GO_IQm-SiVRVkbf2CjC0vitbE36m5J11HMxymoSucXI&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har va rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0i qF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=JtHeh4F36Zz1ELE7LnYzZXc bl TZGl5bubrruLBAzfrw&s=N7bPtrlGX5UKHsj87HzubSjQ5VXnkSpEuYwo_I-ypJU&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ co mplianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y&r =R qvEwdmcEg_aWsE7PBL80w&m=JtHeh4F36Zz1ELE7LnYzZXcblTZGl5bubrruLBAzfrw&s =4 RDz2B3bkbGv045ePFVlaXOUhwU-3UOmzh11Xp8sYJc&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=GVM70MOA7CO9xz- DDMXn5Uq1e-YXiQbvHQnZkzH2lg8&s=Kjem-y9X16SRBARNZVRJ4zsVrtJ7BUt- PTmhkGvra68&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=GVM70MOA7CO9xz-DDMXn5Uq1e- YXiQbvHQnZkzH2lg8&s=xNpiFQrEL4qVzqqt4k7lDdv81WoNgalrePcN7qcKFz4&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=GVM70MOA7CO9xz- DDMXn5Uq1e-YXiQbvHQnZkzH2lg8&s=Kjem-y9X16SRBARNZVRJ4zsVrtJ7BUt- PTmhkGvra68&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1elXGyZpDg3IRcgSYzJ pahq0VVW7QvAExb-XcfwTDvs&s=O1jhLDwl3YQyJYlVNH- s7AxkIR7dip7Ix8nzlCAarWE&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=1elXGyZpDg3IRcgSYzJpahq0VVW7QvAExb- XcfwTDvs&s=xGZe-oGipT8llmP0DLD_KiYI97V81Ejc_0BRpcrQnk0&e= . If the e- mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
I created the contrast: CM.C = [1 1 0 0 0 0; 1 1 0 0 0 0]
Then I ran the following: F_lhstats = lme_mass_F(lhstats,CM);
I received the following error message, which kept on repeating in loop.
Warning: Matrix is singular to working precision.
In matlab.internal.math.mpower.viaMtimes (line 35)
In parallel_function>make_general_channel/channel_general (line 914) In remoteParallelFunction (line 38)
Finally, I had to terminate the operation Ctrl + C, which displayed the following:
Operation terminated by user during matlab.internal.math.mpower.viaMtimes (line 35)
In parallel_function>make_general_channel/channel_general (line 914) O = F(C{:});
In remoteParallelFunction (line 38) out = parallel.internal.pool.serialize(feval(channel, channelArgs{:}));
Operation terminated by user during distcomp.remoteparfor/getCompleteIntervals (line 127)
In parallel_function>distributed_execution (line 820) [tags, out] = P.getCompleteIntervals(chunkSize);
In parallel_function (line 587) R = distributed_execution(...
In lme_mass_F (line 92) parfor i=1:nv
Mayank On Mar 8, 2018, at 6:36 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne.demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
On Do, 2018-03-08 at 03:56 +0100, Kaushal, Mayank wrote: Your inputs have been very helpful.
Looking at the examples on LME webpage, the contrast for both univariate and mass-variate creates 3 rows with 14 columns for univariate and 17 for mass-variate analysis. My understanding is that 3 rows have been created because there are 4 groups being analyzed and applying that rationale to my data would mean that the contrast for my analysis would require 2 rows since I comparing 3 groups. Is my logic correct here?
Yes, that's correct.
As a side note, it only applies when you want to include all three groups in a contrast. If you compare only two groups against each other, then a single line could be sufficient also in your design.
So, for my analysis if I want to include two random effects, namely, intercept and time_from_base_scan, which are given in Column 1 and 2, respectively, the contrasts based on M having 6 columns would as follows: CM.C = [1 1 ; 1 1] zeros(2,4)]; or CM.C = [1 1 0 0 0 0; 1 1 0 0 0 0]
This may be more tricky. It is not necessarily / exclusively the random effects that are of interest in a longitudinal study, and in general there are multiple valid contrasts that each test for different effects. In the above example, it would be the combined effect of the overall intercept and the time-from-baseline - I have to admit that I do not know what the interpretation of that effect would be.
So the contrast specification really depends on which question you want to ask to the data. In designs like yours, this could be the effect of group, the effect of time, group differences in the effect of time, or the effect of covariates. You'll then typically set the corresponding entries in the contrast vector to either '1' or '-1', and zero otherwise.
Hope this helps,
Kersten
Mayank On Mar 7, 2018, at 3:33 PM, Diers, Kersten /DZNE <Kersten.Diers@dzne. demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
let me just mention that my previous comments were directed at the design matrix X and not necessarily at the QDEC table. In that sense, it is possible, but not necessary to modify the QDEC table prior to loading it into Matlab. Alternatively, one might do these modifications within Matlab, although this would require some additional manual coding.
For the present analysis, however, the current qdec table looks fine.
About question 1:
If I understood correctly, you have so far loaded the (modified) QDEC table and stored the extracted information within the matlab variable 'M'.
In addition to that you'd also need to sort the data within each subject according to time, and load 'Y', 'lhcortex' and possibly 'lhsphere'. For a description of all of these steps please see the "mass-univariate" section of the example data analysis on the tutorial page.
About question 2:
Just to be precise, I assume that for this particular case the matlab variable 'M' contains the following four columns: time-from-baseline, age-at-baseline, group2, group3; where 'group2' and 'group3' indicate memberships in groups 2 and 3, respectively.
Then, a design matrix can be created as follows:
X = [ones(length(M),1) M M(:,1).*M(:,3) M(:,1).*M(:,4)];
Then the order of the columns of X is: intercept, time-from-baseline, age-at-baseline, group2, group3, time-from-baseline*group2, time- from- baseline*group3.
Let's keep in mind that the order of columns in X is important for the formulation of contrasts at a later stage (and is different from the tutorial example).
Again, this procedure and the matrices M and X are specific for this particular analysis scenario and cannot necessarily be generalized to others.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Wed, 7 Mar 2018 15:48:36 +0100
I have made the suggested edits and would appreciate if you could take a look at the qdec.table.dat file attached to this conversation.
After going over the univariate example on the Freesurfer LME webpage, I had a couple of questions.
1. How will data be loaded into Matlab? More specifically, what would be the step(s) after the line M = Qdec2num(Qdec);?
2. Given that column named time_base_scan would be multiplied with column named group2 as well as group3, what will be the equation for creating the design matrix? X = [ones(length(M),1) M M(:,).*M(:,)];
Mayank On Mar 7, 2018, at 7:14 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi Mayank,
I may have a few more general considerations before commenting on the number and kind of random effects.
In the current design matrix, column 2 (time from baseline) and column 5 (visit) will be quite redundant. It is one of the advantages of the LME model to be able to deal with unevenly spaced observation intervals and also with possibly missing visits. In that sense, all temporal information is already contained within column 2, and I cannot see a good reason to additionally include column 5. It may even complicate things, due to the redundancy.
If you have 3 groups, you will need two columns in the design matrix to indicate group membership (assuming that an intercept column is also present). Choose one group (say, group 1) as the reference group, which will not explicitly be coded, and then use one of the two group columns to indicate if a person belongs to group 2 (1=yes, 0=no), and the other to indicate if a person belongs to group 3 (1=yes, 0=no).
Please don't code group membership numerically as 1, 2, 3 in a single column, as this will impose a linear relation between group membership and outcome measure (similar to linear regression).
I am not sure about the current meaning of column 6, which multiplies age and time-from-baseline. It would be more important, in my eyes, to multiply time-from-baseline and group membership. Considering my second comment, this will also result in two colums. These will indicate whether or not the effect of time will differ between groups, and this (=different longitudinal trajectory) is often the primary interest in longitudinal studies.
As far as I can see, your overall design is somewhat similar to the univariate example on the Freesurfer LME webpage, except that you have fewer groups and fewer covariates. As it does not matter for the design matrix whether or not the overall study is univariate or mass- univariate (as in your case), one suggestion would be that you construct your design in a similar way as in the given example.
I hope that I have understood your design correctly, otherwise let me know.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Tue, 6 Mar 2018 19:22:57 +0100
I have tabulated the columns for easier comprehension.
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
intercept
time of each scan from base scan for a given subject
age at first scan for a given subject
group (1, 2, or 3)
visit (1,2 3, or 4)
Column 2 * Column 3
Thanks again.
Mayank On Mar 6, 2018, at 12:05 PM, Kaushal, Mayank <mkaushal@mcw.edumailto:mkaushal@mcw.edu<mailto :m kaushal@mcw.edumailto:kaushal@mcw.edu>> wrote:
Changing the Matlab directory worked. Thanks for all your inputs, Kersten.
Sorry to prolong the conversation but if possible, I would appreciate input on whether my thought process regarding the LME analysis is on the right track.
I am looking to compare cortical thickness between 3 groups over multiple visits.
The design matrix created by me X = [ones(length(M),1) M M(:,1).*M(:,2)]; Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 intercept time of each scan from base scan age at first scan group (1, 2, or 3) visit (1,2 3, or 4) Column 2 * Column 3
Presently, I am running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) as a test run.
However, I would like to include Columns 1, 4, and 5 as random effects for LME analysis and if possible even include Column 2 as a random effect to have 4 random effects. lhstats = lme_mass_fit_vw(X,[1 4 5],Y,ni,lhcortex,[],1) or lhstats = lme_mass_fit_vw(X,[1 2 4 5],Y,ni,lhcortex,[],1)
Now, I would like to know if having 3 or possibly 4 random effects would be too many random effects.
Mayank On Mar 6, 2018, at 8:57 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de mailto:Kersten.Diers@dzne.demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
The LME toolbox will create a text file ('parfor_progress1.txt') in Matlab's present working directory to indicate its progress in processing each vertex.
To create this file it needs to have write permissions in Matlab's present working directory.
I speculate that your present working directory in Matlab is the root directory '/' where the toolbox cannot create a file.
The solution would be to not run the scripts from '/', but to set the Matlab working directory to another directory where you have write permissions.
Best regards
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edumailto:mkaushal@mcw.edu<ma il to:mkaushal@mcw.edumailto:mkaushal@mcw.edu>> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu<mai lt o:freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu<mailto:fr ee surfer@nmr.mgh.harvard.edumailto:surfer@nmr.mgh.harvard.edu>> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Tue, 6 Mar 2018 15:17:31 +0100
After downloading version 6.0. and running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1), I received the following errors.
Error using parfor_progress (line 17) Do you have write permissions for /?
Error in lme_mass_fit (line 155) fn = parfor_progress('init',nv);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
Thoughts?
Mayank
On Mar 6, 2018, at 7:08 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Yes,
my understanding is the same.
The LME toolbox can in a way be regarded as a post-processing add-on to Freesurfer. The only interface with Freesurfer are the read/write functions, everything else is to the best of my knowledge independent of Freesurfer. So I cannot see any problems in using the newer version of the LME toolbox with data from Freesurfer 5.3.
Needless to say, this does not affect the usual recommendation, which is that Freesurfer versions should not be mixed in general.
Best,
Kersten
------Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu<mai lt o:freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu<mailto:fr ee surfer@nmr.mgh.harvard.edumailto:surfer@nmr.mgh.harvard.edu>> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 20:47:36 +0100
The version string I have been using: $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $ So, it appears that I do indeed have the older version.
I am running Matlab 2017a, which is a relatively newer version.
Before I proceed with using LME toolbox from a freesurfer 6.0, I would appreciate your input on the following.
My understanding is that LME toolbox is used for statistical analysis and is independent of the freesurfer version performing the actual cortical thickness analysis. So, in theory, if I import cortical thickness data processed in version 5.3, I should still be able to run the LME toolbox from a version 6.0. So, can I input the files processed by freesurfer 5.3 (files that have been processed till mris_preproc and mri_surf2surf) and simply use the LME toolbox from a version 6.0 to perform the statistical analysis?
Mayank
On Mar 5, 2018, at 1:29 PM, Diers, Kersten /DZNE <Kersten.Diers@dzn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
thanks for the additional information.
I believe that we are dealing with a version issue now.
Specifically, I have so far been testing with an LME toolbox from a Freesurfer 6.0 version on Matlab R2016a. In that sense, there is no need for a separate download of the LME scripts, since they are already included within the freesurfer directory (e.g. 'freesurfer/matlab/lme').
It is primarily the 'lme_mass_fit.m' script, which throws the current error. Could you please check your version of this script (type 'help lme_mass_fit.m')?
Within my 5.3 installation, the version string is: % $Revision: 1.1.2.2 $ $Date: 2013/02/23 21:08:10 $
Within my 6.0 installation, the version string is: $Revision: 1.3 $ $Date: 2016/04/08 19:39:24 $
Unfortunately, the version string of the 'lme_mass_fit.m' script within a toolbox that I just downloaded from the LME website is the most ancient one: % $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $
When I use the 1.1.1.1 version instead of the one that is included within Freesurfer 6.0, I can replicate the problem reported in your current mail. With the 1.3 version I have no issues.
As far as I know, the 'lme_mass_fit.m' script was updated to accommodate the changes in Matlab's way of doing the parallel processing. In older Matlab versions this was done using the 'matlabpool' command, but this was replaced by 'parpool', which is - to my knowledge - the only way of running parallel processing with recent Matlab versions. The LME toolbox was originally only tailored to the 'matlabpool' command, but has later been adapted to also include the 'parpool' command.
Assuming that you are using a relatively recent Matlab version, the use of earlier vs. later versions of the toolbox would explain our respective observations.
All in all, I currently see no way of getting an older version of the LME toolbox to run with a current Matlab version - except from modifying the code itself. So my suggestion would be to just use the newer LME toolbox that is shipped with Freesurfer 6.0.
Let us know if I am mistaken or if there are further issues.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu<mai lt o:freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu<mailto:fr ee surfer@nmr.mgh.harvard.edumailto:surfer@nmr.mgh.harvard.edu>> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 16:34:14 +0100
Thanks for the quick response Kersten.
I tried all the potential suggestions mentioned in your post but still no luck.
Here’s the summary:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 124) if (matlabpool('size') > 0)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 123) if (prs==1) || (matlabpool('size') ~= prs)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
The "automatically create a parallel pool" was already deselected in my case.
Also, I am using freesurfer 5.3 with LME toolbox downloaded from the freesurfer website.
Mayank
On Mar 5, 2018, at 9:12 AM, Diers, Kersten /DZNE <Kersten.Diers@d zn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
you might try supplying an additional command-line argument while calling the 'lme_mass_fit_vw' function:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1)
This will tell Matlab to use only one worker. Further documentation on this additional argument can be obtained by typing 'help lme_mass_fit_vw' at the Matlab prompt.
To get this working with my Matlab installation, I additionally had to deselect the "Automatically create parallel pool (if one doesn't already exist) when parallel keywords (e.g., parfor) are executed." option. This can be found in Matlab's preferences menu (--> see the Parallel Computing toolbox section).
As an alternative, using two workers might also be an option in your case:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2)
To get this alternative approach working, I did not have to change the Matlab preferences.
Hope this helps,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu<mai lt o:freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu>
To: freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard. ed u <freesurfer@nmr.mgh.harvard.edmailto:freesurfer@nmr.mgh.harvard.edmailto:freesurfer@nmr.mgh.harvard.e d u> Subject: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Sun, 4 Mar 2018 23:56:03 +0100
Dear Freesurfer Community,
Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the following error, Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 104) You requested a minimum of 8 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
Error in lme_mass_fit (line 137) parpool(prs);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
I have researched the forum on how to stop the function from trying to initiate parallel processing but so far haven’t been able figure out how to overcome this.
Any help would be much appreciated.
Mayank Kaushal MD MBA Postdoctoral Fellow Department of Neurosurgery Medical College of Wisconsin
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR - cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners. or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgs pw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=4ORZf53F92dPjiBGXnKHpr- EpQ0EcHphHdwjrXBmi2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR - cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3wnuPmKgzUIsDM1jpSeXZ5V q_ k4&s=l79g5eOp0ctiFMn0i9TPGz-xgQD77NyKMbK1SskWckA&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu9m0d_7s53UXt0ZNl0blCKx Ns&s=GexmzGtdEYAmFIlm6hCmI2663Z-CgUy8UHaLR-K7C2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har va rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0i qF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzk t5 1TCVmkFxY2vY-Ag_iM&s=GO_IQm-SiVRVkbf2CjC0vitbE36m5J11HMxymoSucXI&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ co mplianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y&r =R qvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzkt51TCVmkFxY2vY- Ag_iM&s=IjgRll5-M3Zti1umbPJ31L6xeflAsxz9YUcZS2jnsyE&e= . If the e- mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har va rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0i qF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzk t5 1TCVmkFxY2vY-Ag_iM&s=GO_IQm-SiVRVkbf2CjC0vitbE36m5J11HMxymoSucXI&e=
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har va rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0i qF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=JtHeh4F36Zz1ELE7LnYzZXc bl TZGl5bubrruLBAzfrw&s=N7bPtrlGX5UKHsj87HzubSjQ5VXnkSpEuYwo_I-ypJU&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ co mplianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y&r =R qvEwdmcEg_aWsE7PBL80w&m=JtHeh4F36Zz1ELE7LnYzZXcblTZGl5bubrruLBAzfrw&s =4 RDz2B3bkbGv045ePFVlaXOUhwU-3UOmzh11Xp8sYJc&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=GVM70MOA7CO9xz- DDMXn5Uq1e-YXiQbvHQnZkzH2lg8&s=Kjem-y9X16SRBARNZVRJ4zsVrtJ7BUt- PTmhkGvra68&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=GVM70MOA7CO9xz-DDMXn5Uq1e- YXiQbvHQnZkzH2lg8&s=xNpiFQrEL4qVzqqt4k7lDdv81WoNgalrePcN7qcKFz4&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=GVM70MOA7CO9xz- DDMXn5Uq1e-YXiQbvHQnZkzH2lg8&s=Kjem-y9X16SRBARNZVRJ4zsVrtJ7BUt- PTmhkGvra68&e=
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1elXGyZpDg3IRcgSYzJ pahq0VVW7QvAExb-XcfwTDvs&s=O1jhLDwl3YQyJYlVNH- s7AxkIR7dip7Ix8nzlCAarWE&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=1elXGyZpDg3IRcgSYzJpahq0VVW7QvAExb- XcfwTDvs&s=xGZe-oGipT8llmP0DLD_KiYI97V81Ejc_0BRpcrQnk0&e= . If the e- mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_complia... . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
Hi,
the two rows in the contrast matrix cannot be identical - this is also not the case in the tutorial example, please take a look there.
Actually, how does your current design matrix (X, not M) look like? A contrast vector (or matrix) needs to have as many entries (or columns) as there are columns in the design matrix, so I am wondering why there are just six - and what their order / meaning is.
Remember that a contrast vector (or row of a contrast matrix) will create a linear combination of the estimated model parameters. The contrast will reflect a specific hypothesis that is then evaluated for statistical significance. Assuming that the first column of X is the intercept, and the second one is time, it seems that you are currently combining these two regressors in a single contrast. I do not think that this has a meaningful interpretation.
One possible misunderstanding, but I'm speculating here, is that the contrast vector (or matrix) is not supposed to be used to indicate which effects are random.
Best,
Kersten
On Do, 2018-03-08 at 18:32 +0100, Kaushal, Mayank wrote:
I created the contrast: CM.C = [1 1 0 0 0 0; 1 1 0 0 0 0]
Then I ran the following: F_lhstats = lme_mass_F(lhstats,CM);
I received the following error message, which kept on repeating in loop.
Warning: Matrix is singular to working precision.
In matlab.internal.math.mpower.viaMtimes (line 35)
In parallel_function>make_general_channel/channel_general (line 914) In remoteParallelFunction (line 38)
Finally, I had to terminate the operation Ctrl + C, which displayed the following:
Operation terminated by user during matlab.internal.math.mpower.viaMtimes (line 35)
In parallel_function>make_general_channel/channel_general (line 914) O = F(C{:});
In remoteParallelFunction (line 38) out = parallel.internal.pool.serialize(feval(channel, channelArgs{:}));
Operation terminated by user during distcomp.remoteparfor/getCompleteIntervals (line 127)
In parallel_function>distributed_execution (line 820) [tags, out] = P.getCompleteIntervals(chunkSize);
In parallel_function (line 587) R = distributed_execution(...
In lme_mass_F (line 92) parfor i=1:nv
Mayank On Mar 8, 2018, at 6:36 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
On Do, 2018-03-08 at 03:56 +0100, Kaushal, Mayank wrote: Your inputs have been very helpful.
Looking at the examples on LME webpage, the contrast for both univariate and mass-variate creates 3 rows with 14 columns for univariate and 17 for mass-variate analysis. My understanding is that 3 rows have been created because there are 4 groups being analyzed and applying that rationale to my data would mean that the contrast for my analysis would require 2 rows since I comparing 3 groups. Is my logic correct here?
Yes, that's correct.
As a side note, it only applies when you want to include all three groups in a contrast. If you compare only two groups against each other, then a single line could be sufficient also in your design.
So, for my analysis if I want to include two random effects, namely, intercept and time_from_base_scan, which are given in Column 1 and 2, respectively, the contrasts based on M having 6 columns would as follows: CM.C = [1 1 ; 1 1] zeros(2,4)]; or CM.C = [1 1 0 0 0 0; 1 1 0 0 0 0]
This may be more tricky. It is not necessarily / exclusively the random effects that are of interest in a longitudinal study, and in general there are multiple valid contrasts that each test for different effects. In the above example, it would be the combined effect of the overall intercept and the time-from-baseline - I have to admit that I do not know what the interpretation of that effect would be.
So the contrast specification really depends on which question you want to ask to the data. In designs like yours, this could be the effect of group, the effect of time, group differences in the effect of time, or the effect of covariates. You'll then typically set the corresponding entries in the contrast vector to either '1' or '-1', and zero otherwise.
Hope this helps,
Kersten
Mayank On Mar 7, 2018, at 3:33 PM, Diers, Kersten /DZNE <Kersten.Diers@dzne. demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
let me just mention that my previous comments were directed at the design matrix X and not necessarily at the QDEC table. In that sense, it is possible, but not necessary to modify the QDEC table prior to loading it into Matlab. Alternatively, one might do these modifications within Matlab, although this would require some additional manual coding.
For the present analysis, however, the current qdec table looks fine.
About question 1:
If I understood correctly, you have so far loaded the (modified) QDEC table and stored the extracted information within the matlab variable 'M'.
In addition to that you'd also need to sort the data within each subject according to time, and load 'Y', 'lhcortex' and possibly 'lhsphere'. For a description of all of these steps please see the "mass-univariate" section of the example data analysis on the tutorial page.
About question 2:
Just to be precise, I assume that for this particular case the matlab variable 'M' contains the following four columns: time-from-baseline, age-at-baseline, group2, group3; where 'group2' and 'group3' indicate memberships in groups 2 and 3, respectively.
Then, a design matrix can be created as follows:
X = [ones(length(M),1) M M(:,1).*M(:,3) M(:,1).*M(:,4)];
Then the order of the columns of X is: intercept, time-from-baseline, age-at-baseline, group2, group3, time-from-baseline*group2, time- from- baseline*group3.
Let's keep in mind that the order of columns in X is important for the formulation of contrasts at a later stage (and is different from the tutorial example).
Again, this procedure and the matrices M and X are specific for this particular analysis scenario and cannot necessarily be generalized to others.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu<ma ilto:mkaushal@mcw.edu>> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lto:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:fr eesurfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Wed, 7 Mar 2018 15:48:36 +0100
I have made the suggested edits and would appreciate if you could take a look at the qdec.table.dat file attached to this conversation.
After going over the univariate example on the Freesurfer LME webpage, I had a couple of questions.
- How will data be loaded into Matlab? More specifically, what would
be the step(s) after the line M = Qdec2num(Qdec);?
- Given that column named time_base_scan would be multiplied with
column named group2 as well as group3, what will be the equation for creating the design matrix? X = [ones(length(M),1) M M(:,).*M(:,)];
Mayank On Mar 7, 2018, at 7:14 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi Mayank,
I may have a few more general considerations before commenting on the number and kind of random effects.
In the current design matrix, column 2 (time from baseline) and column 5 (visit) will be quite redundant. It is one of the advantages of the LME model to be able to deal with unevenly spaced observation intervals and also with possibly missing visits. In that sense, all temporal information is already contained within column 2, and I cannot see a good reason to additionally include column 5. It may even complicate things, due to the redundancy.
If you have 3 groups, you will need two columns in the design matrix to indicate group membership (assuming that an intercept column is also present). Choose one group (say, group 1) as the reference group, which will not explicitly be coded, and then use one of the two group columns to indicate if a person belongs to group 2 (1=yes, 0=no), and the other to indicate if a person belongs to group 3 (1=yes, 0=no).
Please don't code group membership numerically as 1, 2, 3 in a single column, as this will impose a linear relation between group membership and outcome measure (similar to linear regression).
I am not sure about the current meaning of column 6, which multiplies age and time-from-baseline. It would be more important, in my eyes, to multiply time-from-baseline and group membership. Considering my second comment, this will also result in two colums. These will indicate whether or not the effect of time will differ between groups, and this (=different longitudinal trajectory) is often the primary interest in longitudinal studies.
As far as I can see, your overall design is somewhat similar to the univariate example on the Freesurfer LME webpage, except that you have fewer groups and fewer covariates. As it does not matter for the design matrix whether or not the overall study is univariate or mass- univariate (as in your case), one suggestion would be that you construct your design in a similar way as in the given example.
I hope that I have understood your design correctly, otherwise let me know.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lto:freesurfer@nmr.mgh.harvard.edu>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:fr eesurfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Tue, 6 Mar 2018 19:22:57 +0100
I have tabulated the columns for easier comprehension.
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
intercept
time of each scan from base scan for a given subject
age at first scan for a given subject
group (1, 2, or 3)
visit (1,2 3, or 4)
Column 2 * Column 3
Thanks again.
Mayank On Mar 6, 2018, at 12:05 PM, Kaushal, Mayank <mkaushal@mcw.edu<mailto :mkaushal@mcw.edu><mailto :m kaushal@mcw.edumailto:kaushal@mcw.edu>> wrote:
Changing the Matlab directory worked. Thanks for all your inputs, Kersten.
Sorry to prolong the conversation but if possible, I would appreciate input on whether my thought process regarding the LME analysis is on the right track.
I am looking to compare cortical thickness between 3 groups over multiple visits.
The design matrix created by me X = [ones(length(M),1) M M(:,1).*M(:,2)]; Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 intercept time of each scan from base scan age at first scan group (1, 2, or 3) visit (1,2 3, or 4) Column 2 * Column 3
Presently, I am running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) as a test run.
However, I would like to include Columns 1, 4, and 5 as random effects for LME analysis and if possible even include Column 2 as a random effect to have 4 random effects. lhstats = lme_mass_fit_vw(X,[1 4 5],Y,ni,lhcortex,[],1) or lhstats = lme_mass_fit_vw(X,[1 2 4 5],Y,ni,lhcortex,[],1)
Now, I would like to know if having 3 or possibly 4 random effects would be too many random effects.
Mayank On Mar 6, 2018, at 8:57 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de mailto:Kersten.Diers@dzne.demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
The LME toolbox will create a text file ('parfor_progress1.txt') in Matlab's present working directory to indicate its progress in processing each vertex.
To create this file it needs to have write permissions in Matlab's present working directory.
I speculate that your present working directory in Matlab is the root directory '/' where the toolbox cannot create a file.
The solution would be to not run the scripts from '/', but to set the Matlab working directory to another directory where you have write permissions.
Best regards
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu<ma ilto:mkaushal@mcw.edu><ma il to:mkaushal@mcw.edumailto:mkaushal@mcw.edu>> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lto:freesurfer@nmr.mgh.harvard.edu><mai lt o:freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.ed u>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:fr eesurfer@nmr.mgh.harvard.edu<mailto:fr ee surfer@nmr.mgh.harvard.edumailto:surfer@nmr.mgh.harvard.edu>> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Tue, 6 Mar 2018 15:17:31 +0100
After downloading version 6.0. and running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1), I received the following errors.
Error using parfor_progress (line 17) Do you have write permissions for /?
Error in lme_mass_fit (line 155) fn = parfor_progress('init',nv);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
Thoughts?
Mayank
On Mar 6, 2018, at 7:08 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Yes,
my understanding is the same.
The LME toolbox can in a way be regarded as a post-processing add-on to Freesurfer. The only interface with Freesurfer are the read/write functions, everything else is to the best of my knowledge independent of Freesurfer. So I cannot see any problems in using the newer version of the LME toolbox with data from Freesurfer 5.3.
Needless to say, this does not affect the usual recommendation, which is that Freesurfer versions should not be mixed in general.
Best,
Kersten
------Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu<ma ilto:mkaushal@mcw.edu>> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lto:freesurfer@nmr.mgh.harvard.edu><mai lt o:freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.ed u>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:fr eesurfer@nmr.mgh.harvard.edu<mailto:fr ee surfer@nmr.mgh.harvard.edumailto:surfer@nmr.mgh.harvard.edu>> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 20:47:36 +0100
The version string I have been using: $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $ So, it appears that I do indeed have the older version.
I am running Matlab 2017a, which is a relatively newer version.
Before I proceed with using LME toolbox from a freesurfer 6.0, I would appreciate your input on the following.
My understanding is that LME toolbox is used for statistical analysis and is independent of the freesurfer version performing the actual cortical thickness analysis. So, in theory, if I import cortical thickness data processed in version 5.3, I should still be able to run the LME toolbox from a version 6.0. So, can I input the files processed by freesurfer 5.3 (files that have been processed till mris_preproc and mri_surf2surf) and simply use the LME toolbox from a version 6.0 to perform the statistical analysis?
Mayank
On Mar 5, 2018, at 1:29 PM, Diers, Kersten /DZNE <Kersten.Diers@dzn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
thanks for the additional information.
I believe that we are dealing with a version issue now.
Specifically, I have so far been testing with an LME toolbox from a Freesurfer 6.0 version on Matlab R2016a. In that sense, there is no need for a separate download of the LME scripts, since they are already included within the freesurfer directory (e.g. 'freesurfer/matlab/lme').
It is primarily the 'lme_mass_fit.m' script, which throws the current error. Could you please check your version of this script (type 'help lme_mass_fit.m')?
Within my 5.3 installation, the version string is: % $Revision: 1.1.2.2 $ $Date: 2013/02/23 21:08:10 $
Within my 6.0 installation, the version string is: $Revision: 1.3 $ $Date: 2016/04/08 19:39:24 $
Unfortunately, the version string of the 'lme_mass_fit.m' script within a toolbox that I just downloaded from the LME website is the most ancient one: % $Revision: 1.1.1.1 $ $Date: 2012/02/02 11:25:52 $
When I use the 1.1.1.1 version instead of the one that is included within Freesurfer 6.0, I can replicate the problem reported in your current mail. With the 1.3 version I have no issues.
As far as I know, the 'lme_mass_fit.m' script was updated to accommodate the changes in Matlab's way of doing the parallel processing. In older Matlab versions this was done using the 'matlabpool' command, but this was replaced by 'parpool', which is
to my knowledge - the only way of running parallel processing with recent Matlab versions. The LME toolbox was originally only tailored to the 'matlabpool' command, but has later been adapted to also include the 'parpool' command.
Assuming that you are using a relatively recent Matlab version, the use of earlier vs. later versions of the toolbox would explain our respective observations.
All in all, I currently see no way of getting an older version of the LME toolbox to run with a current Matlab version - except from modifying the code itself. So my suggestion would be to just use the newer LME toolbox that is shipped with Freesurfer 6.0.
Let us know if I am mistaken or if there are further issues.
Best regards,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu<ma ilto:mkaushal@mcw.edu>> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lto:freesurfer@nmr.mgh.harvard.edu><mai lt o:freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.ed u>> To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:fr eesurfer@nmr.mgh.harvard.edu<mailto:fr ee surfer@nmr.mgh.harvard.edumailto:surfer@nmr.mgh.harvard.edu>> Subject: Re: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Mon, 5 Mar 2018 16:34:14 +0100
Thanks for the quick response Kersten.
I tried all the potential suggestions mentioned in your post but still no luck.
Here’s the summary:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 124) if (matlabpool('size') > 0)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2) Undefined function or variable 'matlabpool'.
Error in lme_mass_fit (line 123) if (prs==1) || (matlabpool('size') ~= prs)
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
The "automatically create a parallel pool" was already deselected in my case.
Also, I am using freesurfer 5.3 with LME toolbox downloaded from the freesurfer website.
Mayank
On Mar 5, 2018, at 9:12 AM, Diers, Kersten /DZNE <Kersten.Diers@d zn e. de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hi,
you might try supplying an additional command-line argument while calling the 'lme_mass_fit_vw' function:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],1)
This will tell Matlab to use only one worker. Further documentation on this additional argument can be obtained by typing 'help lme_mass_fit_vw' at the Matlab prompt.
To get this working with my Matlab installation, I additionally had to deselect the "Automatically create parallel pool (if one doesn't already exist) when parallel keywords (e.g., parfor) are executed." option. This can be found in Matlab's preferences menu (--> see the Parallel Computing toolbox section).
As an alternative, using two workers might also be an option in your case:
lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex,[],2)
To get this alternative approach working, I did not have to change the Matlab preferences.
Hope this helps,
Kersten
-----Original Message----- From: "Kaushal, Mayank" <mkaushal@mcw.edumailto:mkaushal@mcw.edu<ma ilto:mkaushal@mcw.edu>> Reply-to: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu<mai lto:freesurfer@nmr.mgh.harvard.edu><mai lt o:freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.ed u>
To: freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard. edumailto:freesurfer@nmr.mgh.harvard. ed u <freesurfer@nmr.mgh.harvard.edmailto:freesurfer@nmr.mgh.harvard.e dmailto:freesurfer@nmr.mgh.harvard.e d u> Subject: [Freesurfer] Running Linear Mixed Effects (LME) Model Date: Sun, 4 Mar 2018 23:56:03 +0100
Dear Freesurfer Community,
Running lhstats = lme_mass_fit_vw(X,[1 2],Y,ni,lhcortex); gives the following error, Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 104) You requested a minimum of 8 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 2 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine.
Error in lme_mass_fit (line 137) parpool(prs);
Error in lme_mass_fit_vw (line 73) [stats1,st1] = lme_mass_fit(X,[],Xrows,Zcols,Y,ni,prs,e);
I am running Matlab on a personal MacBook Pro, 2.4 GHz Intel Core i5, 8 GB 1600 MHz DDR3.
I have researched the forum on how to stop the function from trying to initiate parallel processing but so far haven’t been able figure out how to overcome this.
Any help would be much appreciated.
Mayank Kaushal MD MBA Postdoctoral Fellow Department of Neurosurgery Medical College of Wisconsin
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu mailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR
cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners. or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgs pw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkfAR- cOnHzq1lBIA47IRaf9HlVhH8c&s=4ORZf53F92dPjiBGXnKHpr- EpQ0EcHphHdwjrXBmi2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=o0oLymaypGqFbkf AR
cOnHzq1lBIA47IRaf9HlVhH8c&s=JDoMa8C- 2GQ4TpMIyRj4xZ0XosQFEMbzwvKLY9s5G9M&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.or g_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw 4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3wnuPmKgzUIsDM1jpSeXZ5V q_ k4&s=l79g5eOp0ctiFMn0i9TPGz-xgQD77NyKMbK1SskWckA&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h ar vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHT MV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=OYRCgY8BRpqstbCR3 wn uPmKgzUIsDM1jpSeXZ5Vq_k4&s=vZuOCZdUz6e6UbqOzq6Wt- CfJpE_fTmXKmRXAEOva_U&e= _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu9m0d_7s53UXt0ZNl0blCKx Ns&s=GexmzGtdEYAmFIlm6hCmI2663Z-CgUy8UHaLR-K7C2M&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1p97jFA3j0xKIWnKfnu 9m0d_7s53UXt0ZNl0blCKxNs&s=hnOncrG2_ylJ3FodlXAbE1EVVhUUtXgGEnkiGlXXh8 c&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har va rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0i qF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzk t5 1TCVmkFxY2vY-Ag_iM&s=GO_IQm-SiVRVkbf2CjC0vitbE36m5J11HMxymoSucXI&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ co mplianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y&r =R qvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzkt51TCVmkFxY2vY- Ag_iM&s=IjgRll5-M3Zti1umbPJ31L6xeflAsxz9YUcZS2jnsyE&e= . If the e- mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har va rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0i qF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=2vVWX9l8uCW6PNDofp_jxzk t5 1TCVmkFxY2vY-Ag_iM&s=GO_IQm-SiVRVkbf2CjC0vitbE36m5J11HMxymoSucXI&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har va rd.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0i qF n3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=JtHeh4F36Zz1ELE7LnYzZXc bl TZGl5bubrruLBAzfrw&s=N7bPtrlGX5UKHsj87HzubSjQ5VXnkSpEuYwo_I-ypJU&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ co mplianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y&r =R qvEwdmcEg_aWsE7PBL80w&m=JtHeh4F36Zz1ELE7LnYzZXcblTZGl5bubrruLBAzfrw&s =4 RDz2B3bkbGv045ePFVlaXOUhwU-3UOmzh11Xp8sYJc&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=GVM70MOA7CO9xz- DDMXn5Uq1e-YXiQbvHQnZkzH2lg8&s=Kjem-y9X16SRBARNZVRJ4zsVrtJ7BUt- PTmhkGvra68&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=GVM70MOA7CO9xz-DDMXn5Uq1e- YXiQbvHQnZkzH2lg8&s=xNpiFQrEL4qVzqqt4k7lDdv81WoNgalrePcN7qcKFz4&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=GVM70MOA7CO9xz- DDMXn5Uq1e-YXiQbvHQnZkzH2lg8&s=Kjem-y9X16SRBARNZVRJ4zsVrtJ7BUt- PTmhkGvra68&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=1elXGyZpDg3IRcgSYzJ pahq0VVW7QvAExb-XcfwTDvs&s=O1jhLDwl3YQyJYlVNH- s7AxkIR7dip7Ix8nzlCAarWE&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=1elXGyZpDg3IRcgSYzJpahq0VVW7QvAExb- XcfwTDvs&s=xGZe-oGipT8llmP0DLD_KiYI97V81Ejc_0BRpcrQnk0&e= . If the e- mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=nJAs2UOC7Mi_7FonJGr 63y1se7bBpSYb1orRCsaenM8&s=ZchZhMqFcSRE5LZQ7b6whY9A_RwrQuh_ftOIgaYvH0 I&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=nJAs2UOC7Mi_7FonJGr63y1se7bBpSYb1orRCsaen M8&s=qhKTkq2_z6C-V4Isuhop84GEKiRJbYkfs7-YFfS1v0s&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=nJAs2UOC7Mi_7FonJGr 63y1se7bBpSYb1orRCsaenM8&s=ZchZhMqFcSRE5LZQ7b6whY9A_RwrQuh_ftOIgaYvH0 I&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Hi Kersten,
Apologies for the delay. I am still in the process of trying to figure out the gaps in my understanding and would appreciate your inputs.
I created the design X from M using: X = [ones(length(M),1) M M(:,1).*M(:,3) M(:,1).*M(:,4)];
The columns in X are as follows: Column 1: intercept Column 2: time_base_scan (This signifies the time elapsed from the base scan in days. Each subject had upto 4 visits with scans undertaken on each visit. For the scan taken on the first visit 0 was entered in the qdec.dat.table file) Column 3: age1stscan (This is the age of the subject at first scan) Column 4: group 1 (Value of 1 entered in this column if the subject belonged to group 1 and value of 0 entered in column 5 that signifies group 2) Column 5: group 2 (Value of 1 entered in this column if the subject belonged to group 2 and value of 0 entered in column 4 that signifies group 1) Column 6: Column 2 (time_base_scan) x Column 4 (group 1) Column 7: Column 2 (time_base_scan) x Column 4 (group 2)
So my understanding is that subjects belonging to group 3 have 0 in both columns 4 and 5 and consequently, columns 6 and 7 would also be 0 for them. This would be translated by matlab lme toolbox while doing spatiotemporal analysis. Is my understanding correct?
I have attached X as well as M as separate excel files for your consideration. In addition, I have attached qdec.dat.table file as well a word doc labeled “workflow” that detail the order of matlab functions I have used to perform the analysis.
My objective is to highlight clusters that are significantly different between the groups over time using spatiotemporal analysis.
The contrasts used by me for the analysis: CM.C = [0 0 0 0 0 1 0; 0 0 0 0 0 -1 1]
Kindly comment on my choice of contrasts. Is this the correct choice for contrasts if I want to find significant clusters based on cortical thickness between all three groups over time?
Mayank
Hello,
please find my responses below.
Best regards,
Kersten
On Do, 2018-03-29 at 00:11 +0200, Kaushal, Mayank wrote:
Hi Kersten,
Apologies for the delay. I am still in the process of trying to figure out the gaps in my understanding and would appreciate your inputs.
I created the design X from M using: X = [ones(length(M),1) M M(:,1).*M(:,3) M(:,1).*M(:,4)];
The columns in X are as follows: Column 1: intercept Column 2: time_base_scan (This signifies the time elapsed from the base scan in days. Each subject had upto 4 visits with scans undertaken on each visit. For the scan taken on the first visit 0 was entered in the qdec.dat.table file) Column 3: age1stscan (This is the age of the subject at first scan) Column 4: group 1 (Value of 1 entered in this column if the subject belonged to group 1 and value of 0 entered in column 5 that signifies group 2) Column 5: group 2 (Value of 1 entered in this column if the subject belonged to group 2 and value of 0 entered in column 4 that signifies group 1) Column 6: Column 2 (time_base_scan) x Column 4 (group 1) Column 7: Column 2 (time_base_scan) x Column 4 (group 2)
So my understanding is that subjects belonging to group 3 have 0 in both columns 4 and 5 and consequently, columns 6 and 7 would also be 0 for them. This would be translated by matlab lme toolbox while doing spatiotemporal analysis. Is my understanding correct?
Yes, this is correct, apart probably from a little typo:
Column 7 should read: " Column 2 (time_base_scan) x Column 5 (group 2)" (group2 is column 5, not 4, in X; please adapt your design matrix if necessary)
Group 3 will be your reference group then, and will implicitly modeled by this design matrix. I speculate this is what you mean by 'translated'.
I have attached X as well as M as separate excel files for your consideration. In addition, I have attached qdec.dat.table file as well a word doc labeled “workflow” that detail the order of matlab functions I have used to perform the analysis.
My objective is to highlight clusters that are significantly different between the groups over time using spatiotemporal analysis.
The contrasts used by me for the analysis: CM.C = [0 0 0 0 0 1 0; 0 0 0 0 0 -1 1]
Kindly comment on my choice of contrasts. Is this the correct choice for contrasts if I want to find significant clusters based on cortical thickness between all three groups over time?
Yes, the contrast is also correct for your purpose. It will identify regions in which cortical thickness changes across time differ between groups.
Mayank
The continuous variable in my analysis is time_base_scan with the time points evaluated by me being of acute and subacute nature. However, due to the small differences in time elapsed between successive visits (duration between visits is a couple of weeks), is it possible to simply model LME analysis around categorical variables without including continuous variables?
More specifically, I want to see the effect of group. Further, I don’t intend to include time_base_scan as a continuous variable. What would the contrasts used by me to evaluate a categorial variable?
Further, my analysis includes three groups. So, my understanding is that evaluating group as a categorical variable would’ve no bearing on the column composition of X and they would remain the same as mentioned in my previous mail.
The columns in X are as follows: Column 1: intercept Column 2: time_base_scan (This signifies the time elapsed from the base scan in days. Each subject had upto 4 visits with scans undertaken on each visit. For the scan taken on the first visit 0 was entered in the qdec.dat.table file) Column 3: age1stscan (This is the age of the subject at first scan) Column 4: group 1 (Value of 1 entered in this column if the subject belonged to group 1 and value of 0 entered in column 5 that signifies group 2) Column 5: group 2 (Value of 1 entered in this column if the subject belonged to group 2 and value of 0 entered in column 4 that signifies group 1)
Mayank On Mar 30, 2018, at 6:30 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne.demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________ Hello,
please find my responses below.
Best regards,
Kersten
On Do, 2018-03-29 at 00:11 +0200, Kaushal, Mayank wrote:
Hi Kersten,
Apologies for the delay. I am still in the process of trying to figure out the gaps in my understanding and would appreciate your inputs.
I created the design X from M using: X = [ones(length(M),1) M M(:,1).*M(:,3) M(:,1).*M(:,4)];
The columns in X are as follows: Column 1: intercept Column 2: time_base_scan (This signifies the time elapsed from the base scan in days. Each subject had upto 4 visits with scans undertaken on each visit. For the scan taken on the first visit 0 was entered in the qdec.dat.table file) Column 3: age1stscan (This is the age of the subject at first scan) Column 4: group 1 (Value of 1 entered in this column if the subject belonged to group 1 and value of 0 entered in column 5 that signifies group 2) Column 5: group 2 (Value of 1 entered in this column if the subject belonged to group 2 and value of 0 entered in column 4 that signifies group 1) Column 6: Column 2 (time_base_scan) x Column 4 (group 1) Column 7: Column 2 (time_base_scan) x Column 4 (group 2)
So my understanding is that subjects belonging to group 3 have 0 in both columns 4 and 5 and consequently, columns 6 and 7 would also be 0 for them. This would be translated by matlab lme toolbox while doing spatiotemporal analysis. Is my understanding correct?
Yes, this is correct, apart probably from a little typo:
Column 7 should read: " Column 2 (time_base_scan) x Column 5 (group 2)" (group2 is column 5, not 4, in X; please adapt your design matrix if necessary)
Group 3 will be your reference group then, and will implicitly modeled by this design matrix. I speculate this is what you mean by 'translated'.
I have attached X as well as M as separate excel files for your consideration. In addition, I have attached qdec.dat.table file as well a word doc labeled “workflow” that detail the order of matlab functions I have used to perform the analysis.
My objective is to highlight clusters that are significantly different between the groups over time using spatiotemporal analysis.
The contrasts used by me for the analysis: CM.C = [0 0 0 0 0 1 0; 0 0 0 0 0 -1 1]
Kindly comment on my choice of contrasts. Is this the correct choice for contrasts if I want to find significant clusters based on cortical thickness between all three groups over time?
Yes, the contrast is also correct for your purpose. It will identify regions in which cortical thickness changes across time differ between groups.
Mayank
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_complia... . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Hello,
this is somewhat difficult to answer, so the following is a personal opinion.
I think the first question is whether your would like to go for a) a cross-sectional design or b) a longitudinal design.
If a), you'd have a single scan per subject (e.g., baseline) and could discard the temporal information. So if you do not have a longitudinal research question and your goal is to model group differences at a single time-point, it is not necessary (and overly complicated, actually) to use a LME model.
If b), you'd have multiple scans per subject, and would therefore use the LME model. I would not recommend to exclude the timing information from the model / design matrix in this case, no matter how close the temporal spacing may be. It is still possible to test for effects other than time, e.g. for group differences at baseline.
Best regards,
Kersten
On Mi, 2018-04-04 at 23:37 +0200, Kaushal, Mayank wrote:
The continuous variable in my analysis is time_base_scan with the time points evaluated by me being of acute and subacute nature. However, due to the small differences in time elapsed between successive visits (duration between visits is a couple of weeks), is it possible to simply model LME analysis around categorical variables without including continuous variables?
More specifically, I want to see the effect of group. Further, I don’t intend to include time_base_scan as a continuous variable. What would the contrasts used by me to evaluate a categorial variable?
Further, my analysis includes three groups. So, my understanding is that evaluating group as a categorical variable would’ve no bearing on the column composition of X and they would remain the same as mentioned in my previous mail.
The columns in X are as follows: Column 1: intercept Column 2: time_base_scan (This signifies the time elapsed from the base scan in days. Each subject had upto 4 visits with scans undertaken on each visit. For the scan taken on the first visit 0 was entered in the qdec.dat.table file) Column 3: age1stscan (This is the age of the subject at first scan) Column 4: group 1 (Value of 1 entered in this column if the subject belonged to group 1 and value of 0 entered in column 5 that signifies group 2) Column 5: group 2 (Value of 1 entered in this column if the subject belonged to group 2 and value of 0 entered in column 4 that signifies group 1)
Mayank On Mar 30, 2018, at 6:30 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne .demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________ Hello,
please find my responses below.
Best regards,
Kersten
On Do, 2018-03-29 at 00:11 +0200, Kaushal, Mayank wrote:
Hi Kersten,
Apologies for the delay. I am still in the process of trying to figure out the gaps in my understanding and would appreciate your inputs.
I created the design X from M using: X = [ones(length(M),1) M M(:,1).*M(:,3) M(:,1).*M(:,4)];
The columns in X are as follows: Column 1: intercept Column 2: time_base_scan (This signifies the time elapsed from the base scan in days. Each subject had upto 4 visits with scans undertaken on each visit. For the scan taken on the first visit 0 was entered in the qdec.dat.table file) Column 3: age1stscan (This is the age of the subject at first scan) Column 4: group 1 (Value of 1 entered in this column if the subject belonged to group 1 and value of 0 entered in column 5 that signifies group 2) Column 5: group 2 (Value of 1 entered in this column if the subject belonged to group 2 and value of 0 entered in column 4 that signifies group 1) Column 6: Column 2 (time_base_scan) x Column 4 (group 1) Column 7: Column 2 (time_base_scan) x Column 4 (group 2)
So my understanding is that subjects belonging to group 3 have 0 in both columns 4 and 5 and consequently, columns 6 and 7 would also be 0 for them. This would be translated by matlab lme toolbox while doing spatiotemporal analysis. Is my understanding correct?
Yes, this is correct, apart probably from a little typo:
Column 7 should read: " Column 2 (time_base_scan) x Column 5 (group 2)" (group2 is column 5, not 4, in X; please adapt your design matrix if necessary)
Group 3 will be your reference group then, and will implicitly modeled by this design matrix. I speculate this is what you mean by 'translated'.
I have attached X as well as M as separate excel files for your consideration. In addition, I have attached qdec.dat.table file as well a word doc labeled “workflow” that detail the order of matlab functions I have used to perform the analysis.
My objective is to highlight clusters that are significantly different between the groups over time using spatiotemporal analysis.
The contrasts used by me for the analysis: CM.C = [0 0 0 0 0 1 0; 0 0 0 0 0 -1 1]
Kindly comment on my choice of contrasts. Is this the correct choice for contrasts if I want to find significant clusters based on cortical thickness between all three groups over time?
Yes, the contrast is also correct for your purpose. It will identify regions in which cortical thickness changes across time differ between groups.
Mayank
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIBAg&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=jz6TYzDc4SmT6ar1_JE w5rF4JCOlAxM5KmH1GK_SDNc&s=9INo1YCHATevCPV_UsV08YkkiXAOEcUSw7nvJLvyBa g&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIBAg&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=jz6TYzDc4SmT6ar1_JEw5rF4JCOlAxM5KmH1GK_SD Nc&s=guYHSBVwZaPkOne0blcYjP_gI5nw3ZybG4nnnHojJKk&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
I am indeed considering LME model since I have multiple visits (4) for each subject and multiple groups (3).
Based on your response, I am inclined to include the following.
Intercept - random variable Slope (time_base_scan) - random variable
As I am including time_base_scan as the random variable, this should take care of the timing information. Am I correct in making this assumption?
Moving on to the categorical variables - group and visit. I want to evaluate the following effects 1. group 2. visit 3. group and visit
My concern here is how do I design the contrast matrix for this?
I am aware that I have asked more than my fair share of questions and very grateful to you for being exceedingly patient in answering them.
Mayank
On Apr 9, 2018, at 12:15 PM, Diers, Kersten /DZNE Kersten.Diers@dzne.de wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hello,
this is somewhat difficult to answer, so the following is a personal opinion.
I think the first question is whether your would like to go for a) a cross-sectional design or b) a longitudinal design.
If a), you'd have a single scan per subject (e.g., baseline) and could discard the temporal information. So if you do not have a longitudinal research question and your goal is to model group differences at a single time-point, it is not necessary (and overly complicated, actually) to use a LME model.
If b), you'd have multiple scans per subject, and would therefore use the LME model. I would not recommend to exclude the timing information from the model / design matrix in this case, no matter how close the temporal spacing may be. It is still possible to test for effects other than time, e.g. for group differences at baseline.
Best regards,
Kersten
On Mi, 2018-04-04 at 23:37 +0200, Kaushal, Mayank wrote:
The continuous variable in my analysis is time_base_scan with the time points evaluated by me being of acute and subacute nature. However, due to the small differences in time elapsed between successive visits (duration between visits is a couple of weeks), is it possible to simply model LME analysis around categorical variables without including continuous variables?
More specifically, I want to see the effect of group. Further, I don’t intend to include time_base_scan as a continuous variable. What would the contrasts used by me to evaluate a categorial variable?
Further, my analysis includes three groups. So, my understanding is that evaluating group as a categorical variable would’ve no bearing on the column composition of X and they would remain the same as mentioned in my previous mail.
The columns in X are as follows: Column 1: intercept Column 2: time_base_scan (This signifies the time elapsed from the base scan in days. Each subject had upto 4 visits with scans undertaken on each visit. For the scan taken on the first visit 0 was entered in the qdec.dat.table file) Column 3: age1stscan (This is the age of the subject at first scan) Column 4: group 1 (Value of 1 entered in this column if the subject belonged to group 1 and value of 0 entered in column 5 that signifies group 2) Column 5: group 2 (Value of 1 entered in this column if the subject belonged to group 2 and value of 0 entered in column 4 that signifies group 1)
Mayank On Mar 30, 2018, at 6:30 AM, Diers, Kersten /DZNE <Kersten.Diers@dzne .demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________ Hello,
please find my responses below.
Best regards,
Kersten
On Do, 2018-03-29 at 00:11 +0200, Kaushal, Mayank wrote:
Hi Kersten,
Apologies for the delay. I am still in the process of trying to figure out the gaps in my understanding and would appreciate your inputs.
I created the design X from M using: X = [ones(length(M),1) M M(:,1).*M(:,3) M(:,1).*M(:,4)];
The columns in X are as follows: Column 1: intercept Column 2: time_base_scan (This signifies the time elapsed from the base scan in days. Each subject had upto 4 visits with scans undertaken on each visit. For the scan taken on the first visit 0 was entered in the qdec.dat.table file) Column 3: age1stscan (This is the age of the subject at first scan) Column 4: group 1 (Value of 1 entered in this column if the subject belonged to group 1 and value of 0 entered in column 5 that signifies group 2) Column 5: group 2 (Value of 1 entered in this column if the subject belonged to group 2 and value of 0 entered in column 4 that signifies group 1) Column 6: Column 2 (time_base_scan) x Column 4 (group 1) Column 7: Column 2 (time_base_scan) x Column 4 (group 2)
So my understanding is that subjects belonging to group 3 have 0 in both columns 4 and 5 and consequently, columns 6 and 7 would also be 0 for them. This would be translated by matlab lme toolbox while doing spatiotemporal analysis. Is my understanding correct?
Yes, this is correct, apart probably from a little typo:
Column 7 should read: " Column 2 (time_base_scan) x Column 5 (group 2)" (group2 is column 5, not 4, in X; please adapt your design matrix if necessary)
Group 3 will be your reference group then, and will implicitly modeled by this design matrix. I speculate this is what you mean by 'translated'.
I have attached X as well as M as separate excel files for your consideration. In addition, I have attached qdec.dat.table file as well a word doc labeled “workflow” that detail the order of matlab functions I have used to perform the analysis.
My objective is to highlight clusters that are significantly different between the groups over time using spatiotemporal analysis.
The contrasts used by me for the analysis: CM.C = [0 0 0 0 0 1 0; 0 0 0 0 0 -1 1]
Kindly comment on my choice of contrasts. Is this the correct choice for contrasts if I want to find significant clusters based on cortical thickness between all three groups over time?
Yes, the contrast is also correct for your purpose. It will identify regions in which cortical thickness changes across time differ between groups.
Mayank
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.har vard.edu_mailman_listinfo_freesurfer&d=DwIBAg&c=aFamLAsxMIDYjNglYHTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=jz6TYzDc4SmT6ar1_JE w5rF4JCOlAxM5KmH1GK_SDNc&s=9INo1YCHATevCPV_UsV08YkkiXAOEcUSw7nvJLvyBa g&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_ complianceline&d=DwIBAg&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgspw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=jz6TYzDc4SmT6ar1_JEw5rF4JCOlAxM5KmH1GK_SD Nc&s=guYHSBVwZaPkOne0blcYjP_gI5nw3ZybG4nnnHojJKk&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_complia... . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
On Mo, 2018-04-09 at 19:53 +0200, Kaushal, Mayank wrote:
I am indeed considering LME model since I have multiple visits (4) for each subject and multiple groups (3).
Based on your response, I am inclined to include the following.
Intercept - random variable Slope (time_base_scan) - random variable
As I am including time_base_scan as the random variable, this should take care of the timing information. Am I correct in making this assumption?
Moving on to the categorical variables - group and visit. I want to evaluate the following effects
- group
- visit
- group and visit
My concern here is how do I design the contrast matrix for this?
Let's consider the model first:
I would not recommend to include both 'visit' and 'time_from_baseline' in the same model. This is because these two variables should be highly correlated, and such a redundancy may make the estimation and interpretation of the model difficult. Therefore it is better to include just one of them, but not both.
So the basic decision would be whether to treat time 1) as continuous (then use 'time_from_baseline') or 2) as categorical (then use 'visit'):
In my eyes, there are advantages and disadvantages to both, see below. Regardless of that, in both cases it will be possible to assess the effects of group, time/visit, and their combination (e.g. different slopes between groups, or presence of group differences only at some visits but not all).
Option 1)
Using 'time_from_baseline', and hence treating time as continuous, gives the LME model that we have been discussing so far. So there is no need to create a new model, and as far as I can see, your research questions can already be answered with the current model.
Although it will not be possible to directly contrast, say, visit 1 and 2 with this approach, you will still be able to make statements like 'Per 1 year (or 2 years, or 1 month, or whatever unit of time, depending on your observation period), we expect changes of magnitude X (or 2*X, or X/12, ...) , according to this model', and this may even be more accurate than expressing change in units of visits. Note, though, that these changes will be modeled as linear changes across time (unless you include additional e.g. quadratic terms in the model).
Option 2)
Using 'visit', and hence treating time as categorical, would result in a model like a repeated-measures ANOVA. The main advantages, in my eyes, would be that you could explicitly compare between, say, visit 1 and 2, or 1 and 4, etc. So, the categorical model may be a little bit easier to interpret, which is possibly another advantage.
A disadvantage of this option is that you'd need to specify a new model. As far as I can see, the LME framework can also cover the categorical scenario, but I'd need to check how. Otherwise, one could use a classical repeated-measures ANOVA (https://surfer.nmr.mgh.harvard .edu/fswiki/RepeatedMeasuresAnova). Another disadvantage is that the categorical approach discards information about the precise timing, and that it makes the assumption that the visits occurred at comparable time intervals across subjects.
I thought it would be good to lay out the two main modeling options, as they appear to me now, before proceeding.
Best,
Kersten
I am aware that I have asked more than my fair share of questions and very grateful to you for being exceedingly patient in answering them.
Mayank
On Apr 9, 2018, at 12:15 PM, Diers, Kersten /DZNE <Kersten.Diers@dz ne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hello,
this is somewhat difficult to answer, so the following is a personal opinion.
I think the first question is whether your would like to go for a) a cross-sectional design or b) a longitudinal design.
If a), you'd have a single scan per subject (e.g., baseline) and could discard the temporal information. So if you do not have a longitudinal research question and your goal is to model group differences at a single time-point, it is not necessary (and overly complicated, actually) to use a LME model.
If b), you'd have multiple scans per subject, and would therefore use the LME model. I would not recommend to exclude the timing information from the model / design matrix in this case, no matter how close the temporal spacing may be. It is still possible to test for effects other than time, e.g. for group differences at baseline.
Best regards,
Kersten
On Mi, 2018-04-04 at 23:37 +0200, Kaushal, Mayank wrote:
The continuous variable in my analysis is time_base_scan with the time points evaluated by me being of acute and subacute nature. However, due to the small differences in time elapsed between successive visits (duration between visits is a couple of weeks), is it possible to simply model LME analysis around categorical variables without including continuous variables?
More specifically, I want to see the effect of group. Further, I don’t intend to include time_base_scan as a continuous variable. What would the contrasts used by me to evaluate a categorial variable?
Further, my analysis includes three groups. So, my understanding is that evaluating group as a categorical variable would’ve no bearing on the column composition of X and they would remain the same as mentioned in my previous mail.
The columns in X are as follows: Column 1: intercept Column 2: time_base_scan (This signifies the time elapsed from the base scan in days. Each subject had upto 4 visits with scans undertaken on each visit. For the scan taken on the first visit 0 was entered in the qdec.dat.table file) Column 3: age1stscan (This is the age of the subject at first scan) Column 4: group 1 (Value of 1 entered in this column if the subject belonged to group 1 and value of 0 entered in column 5 that signifies group 2) Column 5: group 2 (Value of 1 entered in this column if the subject belonged to group 2 and value of 0 entered in column 4 that signifies group 1)
Mayank On Mar 30, 2018, at 6:30 AM, Diers, Kersten /DZNE <Kersten.Diers@ dzne .demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________ Hello,
please find my responses below.
Best regards,
Kersten
On Do, 2018-03-29 at 00:11 +0200, Kaushal, Mayank wrote:
Hi Kersten,
Apologies for the delay. I am still in the process of trying to figure out the gaps in my understanding and would appreciate your inputs.
I created the design X from M using: X = [ones(length(M),1) M M(:,1).*M(:,3) M(:,1).*M(:,4)];
The columns in X are as follows: Column 1: intercept Column 2: time_base_scan (This signifies the time elapsed from the base scan in days. Each subject had upto 4 visits with scans undertaken on each visit. For the scan taken on the first visit 0 was entered in the qdec.dat.table file) Column 3: age1stscan (This is the age of the subject at first scan) Column 4: group 1 (Value of 1 entered in this column if the subject belonged to group 1 and value of 0 entered in column 5 that signifies group 2) Column 5: group 2 (Value of 1 entered in this column if the subject belonged to group 2 and value of 0 entered in column 4 that signifies group 1) Column 6: Column 2 (time_base_scan) x Column 4 (group 1) Column 7: Column 2 (time_base_scan) x Column 4 (group 2)
So my understanding is that subjects belonging to group 3 have 0 in both columns 4 and 5 and consequently, columns 6 and 7 would also be 0 for them. This would be translated by matlab lme toolbox while doing spatiotemporal analysis. Is my understanding correct?
Yes, this is correct, apart probably from a little typo:
Column 7 should read: " Column 2 (time_base_scan) x Column 5 (group 2)" (group2 is column 5, not 4, in X; please adapt your design matrix if necessary)
Group 3 will be your reference group then, and will implicitly modeled by this design matrix. I speculate this is what you mean by 'translated'.
I have attached X as well as M as separate excel files for your consideration. In addition, I have attached qdec.dat.table file as well a word doc labeled “workflow” that detail the order of matlab functions I have used to perform the analysis.
My objective is to highlight clusters that are significantly different between the groups over time using spatiotemporal analysis.
The contrasts used by me for the analysis: CM.C = [0 0 0 0 0 1 0; 0 0 0 0 0 -1 1]
Kindly comment on my choice of contrasts. Is this the correct choice for contrasts if I want to find significant clusters based on cortical thickness between all three groups over time?
Yes, the contrast is also correct for your purpose. It will identify regions in which cortical thickness changes across time differ between groups.
Mayank
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard. edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .har vard.edu_mailman_listinfo_freesurfer&d=DwIBAg&c=aFamLAsxMIDYjNglY HTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=jz6TYzDc4SmT6ar 1_JE w5rF4JCOlAxM5KmH1GK_SDNc&s=9INo1YCHATevCPV_UsV08YkkiXAOEcUSw7nvJL vyBa g&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners. org_ complianceline&d=DwIBAg&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgs pw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=jz6TYzDc4SmT6ar1_JEw5rF4JCOlAxM5KmH1G K_SD Nc&s=guYHSBVwZaPkOne0blcYjP_gI5nw3ZybG4nnnHojJKk&e= . If the e- mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .harvard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYj NglYHTMV0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=oogcc8F CLuvkkltLtZP70UyiCeWTP_CLDrmHvxx_yj4&s=0jhKXk4zw3- V7Oms3DoEZzo8oSM9ney-DW5Wj3QtvDI&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners. org_complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQ kjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=oogcc8FCLuvkkltLtZP70UyiCeWTP _CLDrmHvxx_yj4&s=I3HTqixlvSUyAOJrD5diLImtXBNte1CuOp0YWct5roU&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h arvard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HTMV0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=oogcc8FCLuvkk ltLtZP70UyiCeWTP_CLDrmHvxx_yj4&s=0jhKXk4zw3-V7Oms3DoEZzo8oSM9ney- DW5Wj3QtvDI&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
I appreciate your providing the pros and cons associated with both options.
Lets say for now we want to pursue option 2.
My understating is that since you recommend not to include ‘visit’ and 'time_from_baseline’ in the same model, one of the steps in creating MLE model for option 2 would be to not include ‘time_from_baseline’ as a random variable.
As for any other considerations to be kept in mind while creating the LME model for option 2, kindly provide your thoughts on the matter.
Mayank
On Apr 10, 2018, at 8:56 AM, Diers, Kersten /DZNE Kersten.Diers@dzne.de wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
On Mo, 2018-04-09 at 19:53 +0200, Kaushal, Mayank wrote:
I am indeed considering LME model since I have multiple visits (4) for each subject and multiple groups (3).
Based on your response, I am inclined to include the following.
Intercept - random variable Slope (time_base_scan) - random variable
As I am including time_base_scan as the random variable, this should take care of the timing information. Am I correct in making this assumption?
Moving on to the categorical variables - group and visit. I want to evaluate the following effects
- group
- visit
- group and visit
My concern here is how do I design the contrast matrix for this?
Let's consider the model first:
I would not recommend to include both 'visit' and 'time_from_baseline' in the same model. This is because these two variables should be highly correlated, and such a redundancy may make the estimation and interpretation of the model difficult. Therefore it is better to include just one of them, but not both.
So the basic decision would be whether to treat time 1) as continuous (then use 'time_from_baseline') or 2) as categorical (then use 'visit'):
In my eyes, there are advantages and disadvantages to both, see below. Regardless of that, in both cases it will be possible to assess the effects of group, time/visit, and their combination (e.g. different slopes between groups, or presence of group differences only at some visits but not all).
Option 1)
Using 'time_from_baseline', and hence treating time as continuous, gives the LME model that we have been discussing so far. So there is no need to create a new model, and as far as I can see, your research questions can already be answered with the current model.
Although it will not be possible to directly contrast, say, visit 1 and 2 with this approach, you will still be able to make statements like 'Per 1 year (or 2 years, or 1 month, or whatever unit of time, depending on your observation period), we expect changes of magnitude X (or 2*X, or X/12, ...) , according to this model', and this may even be more accurate than expressing change in units of visits. Note, though, that these changes will be modeled as linear changes across time (unless you include additional e.g. quadratic terms in the model).
Option 2)
Using 'visit', and hence treating time as categorical, would result in a model like a repeated-measures ANOVA. The main advantages, in my eyes, would be that you could explicitly compare between, say, visit 1 and 2, or 1 and 4, etc. So, the categorical model may be a little bit easier to interpret, which is possibly another advantage.
A disadvantage of this option is that you'd need to specify a new model. As far as I can see, the LME framework can also cover the categorical scenario, but I'd need to check how. Otherwise, one could use a classical repeated-measures ANOVA (https://urldefense.proofpoint.com/v2/url?u=https-3A__surfer.nmr.mgh.harvard&... .edu/fswiki/RepeatedMeasuresAnova). Another disadvantage is that the categorical approach discards information about the precise timing, and that it makes the assumption that the visits occurred at comparable time intervals across subjects.
I thought it would be good to lay out the two main modeling options, as they appear to me now, before proceeding.
Best,
Kersten
I am aware that I have asked more than my fair share of questions and very grateful to you for being exceedingly patient in answering them.
Mayank
On Apr 9, 2018, at 12:15 PM, Diers, Kersten /DZNE <Kersten.Diers@dz ne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hello,
this is somewhat difficult to answer, so the following is a personal opinion.
I think the first question is whether your would like to go for a) a cross-sectional design or b) a longitudinal design.
If a), you'd have a single scan per subject (e.g., baseline) and could discard the temporal information. So if you do not have a longitudinal research question and your goal is to model group differences at a single time-point, it is not necessary (and overly complicated, actually) to use a LME model.
If b), you'd have multiple scans per subject, and would therefore use the LME model. I would not recommend to exclude the timing information from the model / design matrix in this case, no matter how close the temporal spacing may be. It is still possible to test for effects other than time, e.g. for group differences at baseline.
Best regards,
Kersten
On Mi, 2018-04-04 at 23:37 +0200, Kaushal, Mayank wrote:
The continuous variable in my analysis is time_base_scan with the time points evaluated by me being of acute and subacute nature. However, due to the small differences in time elapsed between successive visits (duration between visits is a couple of weeks), is it possible to simply model LME analysis around categorical variables without including continuous variables?
More specifically, I want to see the effect of group. Further, I don’t intend to include time_base_scan as a continuous variable. What would the contrasts used by me to evaluate a categorial variable?
Further, my analysis includes three groups. So, my understanding is that evaluating group as a categorical variable would’ve no bearing on the column composition of X and they would remain the same as mentioned in my previous mail.
The columns in X are as follows: Column 1: intercept Column 2: time_base_scan (This signifies the time elapsed from the base scan in days. Each subject had upto 4 visits with scans undertaken on each visit. For the scan taken on the first visit 0 was entered in the qdec.dat.table file) Column 3: age1stscan (This is the age of the subject at first scan) Column 4: group 1 (Value of 1 entered in this column if the subject belonged to group 1 and value of 0 entered in column 5 that signifies group 2) Column 5: group 2 (Value of 1 entered in this column if the subject belonged to group 2 and value of 0 entered in column 4 that signifies group 1)
Mayank On Mar 30, 2018, at 6:30 AM, Diers, Kersten /DZNE <Kersten.Diers@ dzne .demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________ Hello,
please find my responses below.
Best regards,
Kersten
On Do, 2018-03-29 at 00:11 +0200, Kaushal, Mayank wrote:
Hi Kersten,
Apologies for the delay. I am still in the process of trying to figure out the gaps in my understanding and would appreciate your inputs.
I created the design X from M using: X = [ones(length(M),1) M M(:,1).*M(:,3) M(:,1).*M(:,4)];
The columns in X are as follows: Column 1: intercept Column 2: time_base_scan (This signifies the time elapsed from the base scan in days. Each subject had upto 4 visits with scans undertaken on each visit. For the scan taken on the first visit 0 was entered in the qdec.dat.table file) Column 3: age1stscan (This is the age of the subject at first scan) Column 4: group 1 (Value of 1 entered in this column if the subject belonged to group 1 and value of 0 entered in column 5 that signifies group 2) Column 5: group 2 (Value of 1 entered in this column if the subject belonged to group 2 and value of 0 entered in column 4 that signifies group 1) Column 6: Column 2 (time_base_scan) x Column 4 (group 1) Column 7: Column 2 (time_base_scan) x Column 4 (group 2)
So my understanding is that subjects belonging to group 3 have 0 in both columns 4 and 5 and consequently, columns 6 and 7 would also be 0 for them. This would be translated by matlab lme toolbox while doing spatiotemporal analysis. Is my understanding correct?
Yes, this is correct, apart probably from a little typo:
Column 7 should read: " Column 2 (time_base_scan) x Column 5 (group 2)" (group2 is column 5, not 4, in X; please adapt your design matrix if necessary)
Group 3 will be your reference group then, and will implicitly modeled by this design matrix. I speculate this is what you mean by 'translated'.
I have attached X as well as M as separate excel files for your consideration. In addition, I have attached qdec.dat.table file as well a word doc labeled “workflow” that detail the order of matlab functions I have used to perform the analysis.
My objective is to highlight clusters that are significantly different between the groups over time using spatiotemporal analysis.
The contrasts used by me for the analysis: CM.C = [0 0 0 0 0 1 0; 0 0 0 0 0 -1 1]
Kindly comment on my choice of contrasts. Is this the correct choice for contrasts if I want to find significant clusters based on cortical thickness between all three groups over time?
Yes, the contrast is also correct for your purpose. It will identify regions in which cortical thickness changes across time differ between groups.
Mayank
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard. edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .har vard.edu_mailman_listinfo_freesurfer&d=DwIBAg&c=aFamLAsxMIDYjNglY HTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=jz6TYzDc4SmT6ar 1_JE w5rF4JCOlAxM5KmH1GK_SDNc&s=9INo1YCHATevCPV_UsV08YkkiXAOEcUSw7nvJL vyBa g&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners. org_ complianceline&d=DwIBAg&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQkjgs pw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=jz6TYzDc4SmT6ar1_JEw5rF4JCOlAxM5KmH1G K_SD Nc&s=guYHSBVwZaPkOne0blcYjP_gI5nw3ZybG4nnnHojJKk&e= . If the e- mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .harvard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYj NglYHTMV0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=oogcc8F CLuvkkltLtZP70UyiCeWTP_CLDrmHvxx_yj4&s=0jhKXk4zw3- V7Oms3DoEZzo8oSM9ney-DW5Wj3QtvDI&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners. org_complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQ kjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=oogcc8FCLuvkkltLtZP70UyiCeWTP _CLDrmHvxx_yj4&s=I3HTqixlvSUyAOJrD5diLImtXBNte1CuOp0YWct5roU&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h arvard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HTMV0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=oogcc8FCLuvkk ltLtZP70UyiCeWTP_CLDrmHvxx_yj4&s=0jhKXk4zw3-V7Oms3DoEZzo8oSM9ney- DW5Wj3QtvDI&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners.org_complia... . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.ed...
On Di, 2018-04-10 at 16:09 +0200, Kaushal, Mayank wrote:
I appreciate your providing the pros and cons associated with both options.
Lets say for now we want to pursue option 2.
My understating is that since you recommend not to include ‘visit’ and 'time_from_baseline’ in the same model, one of the steps in creating MLE model for option 2 would be to not include ‘time_from_baseline’ as a random variable.
Yes.
As for any other considerations to be kept in mind while creating the LME model for option 2, kindly provide your thoughts on the matter.
The rules for coding the design matrix are the same as before, i.e. you will now treat not only group, but also visit as categorical. So I'd choose one visit as the reference category, and add columns consisting of ones or zeros for the remaining visits. For group-by-visit effects, multiply each group (except reference group) column with each visit (except reference visit) column. In the end, your design matrix will just contain ones and zeros.
Best,
Kersten
Mayank
On Apr 10, 2018, at 8:56 AM, Diers, Kersten /DZNE <Kersten.Diers@dz ne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
On Mo, 2018-04-09 at 19:53 +0200, Kaushal, Mayank wrote:
I am indeed considering LME model since I have multiple visits (4) for each subject and multiple groups (3).
Based on your response, I am inclined to include the following.
Intercept - random variable Slope (time_base_scan) - random variable
As I am including time_base_scan as the random variable, this should take care of the timing information. Am I correct in making this assumption?
Moving on to the categorical variables - group and visit. I want to evaluate the following effects
- group
- visit
- group and visit
My concern here is how do I design the contrast matrix for this?
Let's consider the model first:
I would not recommend to include both 'visit' and 'time_from_baseline' in the same model. This is because these two variables should be highly correlated, and such a redundancy may make the estimation and interpretation of the model difficult. Therefore it is better to include just one of them, but not both.
So the basic decision would be whether to treat time 1) as continuous (then use 'time_from_baseline') or 2) as categorical (then use 'visit'):
In my eyes, there are advantages and disadvantages to both, see below. Regardless of that, in both cases it will be possible to assess the effects of group, time/visit, and their combination (e.g. different slopes between groups, or presence of group differences only at some visits but not all).
Option 1)
Using 'time_from_baseline', and hence treating time as continuous, gives the LME model that we have been discussing so far. So there is no need to create a new model, and as far as I can see, your research questions can already be answered with the current model.
Although it will not be possible to directly contrast, say, visit 1 and 2 with this approach, you will still be able to make statements like 'Per 1 year (or 2 years, or 1 month, or whatever unit of time, depending on your observation period), we expect changes of magnitude X (or 2*X, or X/12, ...) , according to this model', and this may even be more accurate than expressing change in units of visits. Note, though, that these changes will be modeled as linear changes across time (unless you include additional e.g. quadratic terms in the model).
Option 2)
Using 'visit', and hence treating time as categorical, would result in a model like a repeated-measures ANOVA. The main advantages, in my eyes, would be that you could explicitly compare between, say, visit 1 and 2, or 1 and 4, etc. So, the categorical model may be a little bit easier to interpret, which is possibly another advantage.
A disadvantage of this option is that you'd need to specify a new model. As far as I can see, the LME framework can also cover the categorical scenario, but I'd need to check how. Otherwise, one could use a classical repeated-measures ANOVA (https://urldefense.proofpo int.com/v2/url?u=https- 3A__surfer.nmr.mgh.harvard&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4 pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=- Af3jZoZfdj4DqYkb4qhihYoKqoeJSRABuMScq6Q2QU&s=2PGnRH6- RPzAAOmDaTj8n8GWK1AH-vVxIKYjvQubYTg&e= .edu/fswiki/RepeatedMeasuresAnova). Another disadvantage is that the categorical approach discards information about the precise timing, and that it makes the assumption that the visits occurred at comparable time intervals across subjects.
I thought it would be good to lay out the two main modeling options, as they appear to me now, before proceeding.
Best,
Kersten
I am aware that I have asked more than my fair share of questions and very grateful to you for being exceedingly patient in answering them.
Mayank
On Apr 9, 2018, at 12:15 PM, Diers, Kersten /DZNE <Kersten.Dier s@dz ne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________
Hello,
this is somewhat difficult to answer, so the following is a personal opinion.
I think the first question is whether your would like to go for a) a cross-sectional design or b) a longitudinal design.
If a), you'd have a single scan per subject (e.g., baseline) and could discard the temporal information. So if you do not have a longitudinal research question and your goal is to model group differences at a single time-point, it is not necessary (and overly complicated, actually) to use a LME model.
If b), you'd have multiple scans per subject, and would therefore use the LME model. I would not recommend to exclude the timing information from the model / design matrix in this case, no matter how close the temporal spacing may be. It is still possible to test for effects other than time, e.g. for group differences at baseline.
Best regards,
Kersten
On Mi, 2018-04-04 at 23:37 +0200, Kaushal, Mayank wrote:
The continuous variable in my analysis is time_base_scan with the time points evaluated by me being of acute and subacute nature. However, due to the small differences in time elapsed between successive visits (duration between visits is a couple of weeks), is it possible to simply model LME analysis around categorical variables without including continuous variables?
More specifically, I want to see the effect of group. Further, I don’t intend to include time_base_scan as a continuous variable. What would the contrasts used by me to evaluate a categorial variable?
Further, my analysis includes three groups. So, my understanding is that evaluating group as a categorical variable would’ve no bearing on the column composition of X and they would remain the same as mentioned in my previous mail.
The columns in X are as follows: Column 1: intercept Column 2: time_base_scan (This signifies the time elapsed from the base scan in days. Each subject had upto 4 visits with scans undertaken on each visit. For the scan taken on the first visit 0 was entered in the qdec.dat.table file) Column 3: age1stscan (This is the age of the subject at first scan) Column 4: group 1 (Value of 1 entered in this column if the subject belonged to group 1 and value of 0 entered in column 5 that signifies group 2) Column 5: group 2 (Value of 1 entered in this column if the subject belonged to group 2 and value of 0 entered in column 4 that signifies group 1)
Mayank On Mar 30, 2018, at 6:30 AM, Diers, Kersten /DZNE <Kersten.Diers@ dzne .demailto:Kersten.Diers@dzne.de> wrote:
ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________ Hello,
please find my responses below.
Best regards,
Kersten
On Do, 2018-03-29 at 00:11 +0200, Kaushal, Mayank wrote:
Hi Kersten,
Apologies for the delay. I am still in the process of trying to figure out the gaps in my understanding and would appreciate your inputs.
I created the design X from M using: X = [ones(length(M),1) M M(:,1).*M(:,3) M(:,1).*M(:,4)];
The columns in X are as follows: Column 1: intercept Column 2: time_base_scan (This signifies the time elapsed from the base scan in days. Each subject had upto 4 visits with scans undertaken on each visit. For the scan taken on the first visit 0 was entered in the qdec.dat.table file) Column 3: age1stscan (This is the age of the subject at first scan) Column 4: group 1 (Value of 1 entered in this column if the subject belonged to group 1 and value of 0 entered in column 5 that signifies group 2) Column 5: group 2 (Value of 1 entered in this column if the subject belonged to group 2 and value of 0 entered in column 4 that signifies group 1) Column 6: Column 2 (time_base_scan) x Column 4 (group 1) Column 7: Column 2 (time_base_scan) x Column 4 (group 2)
So my understanding is that subjects belonging to group 3 have 0 in both columns 4 and 5 and consequently, columns 6 and 7 would also be 0 for them. This would be translated by matlab lme toolbox while doing spatiotemporal analysis. Is my understanding correct?
Yes, this is correct, apart probably from a little typo:
Column 7 should read: " Column 2 (time_base_scan) x Column 5 (group 2)" (group2 is column 5, not 4, in X; please adapt your design matrix if necessary)
Group 3 will be your reference group then, and will implicitly modeled by this design matrix. I speculate this is what you mean by 'translated'.
I have attached X as well as M as separate excel files for your consideration. In addition, I have attached qdec.dat.table file as well a word doc labeled “workflow” that detail the order of matlab functions I have used to perform the analysis.
My objective is to highlight clusters that are significantly different between the groups over time using spatiotemporal analysis.
The contrasts used by me for the analysis: CM.C = [0 0 0 0 0 1 0; 0 0 0 0 0 -1 1]
Kindly comment on my choice of contrasts. Is this the correct choice for contrasts if I want to find significant clusters based on cortical thickness between all three groups over time?
Yes, the contrast is also correct for your purpose. It will identify regions in which cortical thickness changes across time differ between groups.
Mayank
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harv ard. edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr .mgh .har vard.edu_mailman_listinfo_freesurfer&d=DwIBAg&c=aFamLAsxMIDYj NglY HTMV 0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=jz6TYzDc4Sm T6ar 1_JE w5rF4JCOlAxM5KmH1GK_SDNc&s=9INo1YCHATevCPV_UsV08YkkiXAOEcUSw7 nvJL vyBa g&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partn ers. org_ complianceline&d=DwIBAg&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQ kjgs pw4Y &r=RqvEwdmcEg_aWsE7PBL80w&m=jz6TYzDc4SmT6ar1_JEw5rF4JCOlAxM5K mH1G K_SD Nc&s=guYHSBVwZaPkOne0blcYjP_gI5nw3ZybG4nnnHojJKk&e= . If the e- mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr .mgh .harvard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxM IDYj NglYHTMV0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=oog cc8F CLuvkkltLtZP70UyiCeWTP_CLDrmHvxx_yj4&s=0jhKXk4zw3- V7Oms3DoEZzo8oSM9ney-DW5Wj3QtvDI&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partn ers. org_complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pV FYPQ kjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=oogcc8FCLuvkkltLtZP70UyiC eWTP _CLDrmHvxx_yj4&s=I3HTqixlvSUyAOJrD5diLImtXBNte1CuOp0YWct5roU& e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.m gh.h arvard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYj NglY HTMV0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=oogcc8FCL uvkk ltLtZP70UyiCeWTP_CLDrmHvxx_yj4&s=0jhKXk4zw3- V7Oms3DoEZzo8oSM9ney- DW5Wj3QtvDI&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh .harvard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYj NglYHTMV0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=- Af3jZoZfdj4DqYkb4qhihYoKqoeJSRABuMScq6Q2QU&s=VS1dR4orlUf6SXHqVBaw u00l78g65dnkzHx35Nnd7Ro&e=
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.partners. org_complianceline&d=DwIGaQ&c=aFamLAsxMIDYjNglYHTMV0iqFn3z4pVFYPQ kjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=- Af3jZoZfdj4DqYkb4qhihYoKqoeJSRABuMScq6Q2QU&s=I1clduHjaiugPIaCcKe2 RYJBGAydGScY3sbOHzYul0o&e= . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.h arvard.edu_mailman_listinfo_freesurfer&d=DwIGaQ&c=aFamLAsxMIDYjNglY HTMV0iqFn3z4pVFYPQkjgspw4Y&r=RqvEwdmcEg_aWsE7PBL80w&m=- Af3jZoZfdj4DqYkb4qhihYoKqoeJSRABuMScq6Q2QU&s=VS1dR4orlUf6SXHqVBawu0 0l78g65dnkzHx35Nnd7Ro&e=
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
freesurfer@nmr.mgh.harvard.edu