Hello Freesurfer Experts,
I am performing a mass-univariate analyses using the LME toolbox for longitudinal studies.
After running both mris_preproc and mri_surf2surf , I load the lh.thickness_sm10.mgh file using
*[Y,mri] = fs_read_Y('lh.thickness_sm10.mgh');*
Next, I run the following command:
*Qdec = fReadQdec('qdec.table.dat');*
However, it seems that the output is entirely in string format "166 x 1 cell". The first row reads as "'fsid fsid-base years group gender age'" in a single column.
Because of this, I am running into problems when I try to execute the following steps:
*Qdec = rmQdecCol(Qdec,1);* (removes first column)
*sID = Qdec(2:end,1); (grabs the subjects' IDs)*
*Qdec = rmQdecCol(Qdec,1);* (removes the subjects'ID column)
*M = Qdec2num(Qdec);* (converts to a numeric matrix)
*[M,Y,ni] = sortData(M,1,Y,sID);* (sorts the data)
Your help will be greatly appreciated!
Many thanks.
Best Regards,
Elijah
Hi Elijah
This is happening because the columns of your Qdec table file are separated by tabs or something else. You need to use simple spaces instead or properly modify fReadQdec to support tabs. This is something I need to fix on github:
Best -Jorge
De: Elijah Mak fkm24@medschl.cam.ac.uk Para: freesurfer@nmr.mgh.harvard.edu Enviado: Viernes 11 de julio de 2014 17:44 Asunto: [Freesurfer] LME Longitudinal QDEC Table
Hello Freesurfer Experts,
I am performing a mass-univariate analyses using the LME toolbox for longitudinal studies.
After running both mris_preproc and mri_surf2surf , I load the lh.thickness_sm10.mgh file using
[Y,mri] = fs_read_Y('lh.thickness_sm10.mgh');
Next, I run the following command: Qdec = fReadQdec('qdec.table.dat'); However, it seems that the output is entirely in string format "166 x 1 cell". The first row reads as "'fsidfsid-baseyearsgroupgenderage'" in a single column. Because of this, I am running into problems when I try to execute the following steps: Qdec = rmQdecCol(Qdec,1); (removes first column) sID = Qdec(2:end,1); (grabs the subjects' IDs) Qdec = rmQdecCol(Qdec,1); (removes the subjects'ID column) M = Qdec2num(Qdec); (converts to a numeric matrix) [M,Y,ni] = sortData(M,1,Y,sID); (sorts the data) Your help will be greatly appreciated! Many thanks. Best Regards, Elijah
--
Elijah Mak, Gates Scholar PhD Candidate | Psychiatry
University of Cambridge
Trinity College, Cambridge, CB2 1TQ
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 Jorge,
Many thanks for getting back.
What I have done is to create the table in excel (Mac version), before pasting the entire table into a program (gedit) and then saving the file as qdec.table.dat. This has worked for me in the past when I am running QDEC analyses. I have also pasted the table from excel into a text editor (pico) in my Mac terminal.
I have tried to modify the Qdec variable in Matlab by simply pasting the excel table and it appears to work (Please see attached screenshot of the Qdec variable). The resulting sID variable is correct while the Qdec table now only contains the relevant variables and covariates (years, group, gender and age) after I ran these commands:
*Qdec = rmQdecCol(Qdec,1);* (removes first column)
*sID = Qdec(2:end,1); (grabs the subjects' IDs)*
*Qdec = rmQdecCol(Qdec,1);* (removes the subjects'ID column)
However, when I run try to convert Qdec into a numeric matrix with *M = Qdec2num(Qdec); *the resulting M variable only consists of NaNs (Please see 2nd screenshot).
Lastly, for next step (*[M,Y,ni] = sortData(M,1,Y,sID)*, am I supposed to define Y?
Many thanks again for your help!
Best Wishes, Elijah
On Mon, Jul 14, 2014 at 2:18 PM, jorge luis jbernal0019@yahoo.es wrote:
Hi Elijah
This is happening because the columns of your Qdec table file are separated by tabs or something else. You need to use simple spaces instead or properly modify *fReadQdec* to support tabs. This is something I need to fix on github:
Best -Jorge
*De:* Elijah Mak fkm24@medschl.cam.ac.uk *Para:* freesurfer@nmr.mgh.harvard.edu *Enviado:* Viernes 11 de julio de 2014 17:44 *Asunto:* [Freesurfer] LME Longitudinal QDEC Table
Hello Freesurfer Experts,
I am performing a mass-univariate analyses using the LME toolbox for longitudinal studies.
After running both mris_preproc and mri_surf2surf , I load the lh.thickness_sm10.mgh file using
*[Y,mri] = fs_read_Y('lh.thickness_sm10.mgh');*
Next, I run the following command: *Qdec = fReadQdec('qdec.table.dat');* However, it seems that the output is entirely in string format "166 x 1 cell". The first row reads as "'fsid fsid-base years group gender age'" in a single column. Because of this, I am running into problems when I try to execute the following steps: *Qdec = rmQdecCol(Qdec,1);* (removes first column) *sID = Qdec(2:end,1); (grabs the subjects' IDs)* *Qdec = rmQdecCol(Qdec,1);* (removes the subjects'ID column) *M = Qdec2num(Qdec);* (converts to a numeric matrix) *[M,Y,ni] = sortData(M,1,Y,sID);* (sorts the data) Your help will be greatly appreciated! Many thanks. Best Regards, Elijah
-- Elijah Mak, Gates Scholar PhD Candidate *|* Psychiatry University of Cambridge Trinity College, Cambridge, CB2 1TQ
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 Elijah
You are getting NaNs because the rows of your Qdec variable (except the first) are already numeric values instead of strings. You just need to do this:
Qdec = Qdec(2:end,:);
The variable Y has the data that you already read with:
[Y, mri] = fs_read_Y('lh.thickness_sm10.mgh');
Best -Jorge
De: Elijah Mak fkm24@medschl.cam.ac.uk Para: jorge luis jbernal0019@yahoo.es CC: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Enviado: Lunes 14 de julio de 2014 9:35 Asunto: Re: [Freesurfer] LME Longitudinal QDEC Table
Hi Jorge,
Many thanks for getting back.
What I have done is to create the table in excel (Mac version), before pasting the entire table into a program (gedit) and then saving the file as qdec.table.dat. This has worked for me in the past when I am running QDEC analyses. I have also pasted the table from excel into a text editor (pico) in my Mac terminal.
I have tried to modify the Qdec variable in Matlab by simply pasting the excel table and it appears to work (Please see attached screenshot of the Qdec variable). The resulting sID variable is correct while the Qdec table now only contains the relevant variables and covariates (years, group, gender and age) after I ran these commands:
Qdec = rmQdecCol(Qdec,1); (removes first column)
sID = Qdec(2:end,1); (grabs the subjects' IDs) Qdec = rmQdecCol(Qdec,1); (removes the subjects'ID column)
However, when I run try to convert Qdec into a numeric matrix with M = Qdec2num(Qdec); the resulting M variable only consists of NaNs (Please see 2nd screenshot).
Lastly, for next step ([M,Y,ni] = sortData(M,1,Y,sID), am I supposed to define Y?
Many thanks again for your help!
Best Wishes, Elijah
On Mon, Jul 14, 2014 at 2:18 PM, jorge luis jbernal0019@yahoo.es wrote:
Hi Elijah
This is happening because the columns of your Qdec table file are separated by tabs or something else. You need to use simple spaces instead or properly modify fReadQdec to support tabs. This is something I need to fix on github:
Best -Jorge
De: Elijah Mak fkm24@medschl.cam.ac.uk Para: freesurfer@nmr.mgh.harvard.edu Enviado: Viernes 11 de julio de 2014 17:44 Asunto: [Freesurfer] LME Longitudinal QDEC Table
Hello Freesurfer Experts,
I am performing a mass-univariate analyses using the LME toolbox for longitudinal studies.
After running both mris_preproc and mri_surf2surf , I load the lh.thickness_sm10.mgh file using
[Y,mri] = fs_read_Y('lh.thickness_sm10.mgh');
Next, I run the following command: Qdec = fReadQdec('qdec.table.dat'); However, it seems that the output is entirely in string format "166 x 1 cell". The first row reads as "'fsidfsid-baseyearsgroupgenderage'" in a single column. Because of this, I am running into problems when I try to execute the following steps: Qdec = rmQdecCol(Qdec,1); (removes first column) sID = Qdec(2:end,1); (grabs the subjects' IDs) Qdec = rmQdecCol(Qdec,1); (removes the subjects'ID column) M = Qdec2num(Qdec); (converts to a numeric matrix) [M,Y,ni] = sortData(M,1,Y,sID); (sorts the data) Your help will be greatly appreciated! Many thanks. Best Regards, Elijah
--
Elijah Mak, Gates Scholar PhD Candidate | Psychiatry
University of Cambridge
Trinity College, Cambridge, CB2 1TQ
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.
--
Elijah Mak, Gates Scholar PhD Candidate | Psychiatry
University of Cambridge
Trinity College, Cambridge, CB2 1TQ
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.
Sorry, you need to do:
M = Qdec(2:end,:);
Best -Jorge
De: jorge luis jbernal0019@yahoo.es Para: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Enviado: Lunes 14 de julio de 2014 10:06 Asunto: Re: [Freesurfer] LME Longitudinal QDEC Table
Hi Elijah
You are getting NaNs
because the rows of your Qdec variable (except the first) are already numeric values instead of strings. You just need to do this:
Qdec
= Qdec(2:end,:);
The variable Y has
the data that you already read with:
[Y, mri] =
fs_read_Y('lh.thickness_sm10.mgh');
Best -Jorge
De: Elijah Mak fkm24@medschl.cam.ac.uk Para: jorge luis jbernal0019@yahoo.es CC: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Enviado: Lunes 14 de julio de 2014 9:35 Asunto: Re: [Freesurfer] LME Longitudinal QDEC Table
Hi Jorge,
Many thanks for getting back.
What I have done is to create the table in excel (Mac version), before pasting the entire table into a program (gedit) and then saving the file as qdec.table.dat. This has worked for me in the past when I am running QDEC analyses. I have also pasted the table from excel into a text editor (pico) in my Mac terminal.
I have tried to modify the Qdec variable in Matlab by simply pasting the excel table and it appears to work (Please see attached screenshot of the Qdec variable). The resulting sID variable is correct while the Qdec table now only contains the relevant variables and covariates (years, group, gender and age) after I ran these commands:
Qdec = rmQdecCol(Qdec,1); (removes first column)
sID = Qdec(2:end,1); (grabs the subjects' IDs) Qdec = rmQdecCol(Qdec,1); (removes the subjects'ID column)
However, when I run try to convert Qdec into a numeric matrix with M = Qdec2num(Qdec); the resulting M variable only consists of NaNs (Please see 2nd screenshot).
Lastly, for next step ([M,Y,ni] = sortData(M,1,Y,sID), am I supposed to define Y?
Many thanks again for your help!
Best Wishes, Elijah
On Mon, Jul 14, 2014 at 2:18 PM, jorge luis jbernal0019@yahoo.es wrote:
Hi Elijah
This is happening because the columns of your Qdec table file are separated by tabs or something else. You need to use simple spaces instead or properly modify fReadQdec to support tabs. This is something I need to fix on github:
Best -Jorge
De: Elijah Mak fkm24@medschl.cam.ac.uk Para: freesurfer@nmr.mgh.harvard.edu Enviado: Viernes 11 de julio de 2014 17:44 Asunto: [Freesurfer] LME Longitudinal QDEC Table
Hello Freesurfer Experts,
I am performing a mass-univariate analyses using the LME toolbox for longitudinal studies.
After running both mris_preproc and mri_surf2surf , I load the lh.thickness_sm10.mgh file using
[Y,mri] = fs_read_Y('lh.thickness_sm10.mgh');
Next, I run the following command: Qdec = fReadQdec('qdec.table.dat'); However, it seems that the output is entirely in string format "166 x 1 cell". The first row reads as "'fsidfsid-baseyearsgroupgenderage'" in a single column. Because of this, I am running into problems when I try to execute the following steps: Qdec = rmQdecCol(Qdec,1); (removes first column) sID = Qdec(2:end,1); (grabs the subjects' IDs) Qdec = rmQdecCol(Qdec,1); (removes the subjects'ID column) M = Qdec2num(Qdec); (converts to a numeric matrix) [M,Y,ni] = sortData(M,1,Y,sID); (sorts the data) Your help will be greatly appreciated! Many thanks. Best Regards, Elijah
--
Elijah Mak, Gates Scholar PhD Candidate | Psychiatry
University of Cambridge
Trinity College, Cambridge, CB2 1TQ
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.
--
Elijah Mak, Gates Scholar PhD Candidate | Psychiatry
University of Cambridge
Trinity College, Cambridge, CB2 1TQ
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 Jorge,
Thank you again. It works! Now, the M variable only contains the numeric data, without the column headers.
For the last step (sorting the data), I am met with the following error command:
[M,Y,ni] = sortData(M,1,Y,sID)
Error using sort
Input argument must be a cell array of strings. (Isn't M supposedly a numeric matrix?)
Error in sortData (line 59)
[~,time_ind] = sort(time(count+1:count+ni(i)));
Background: I have 3 groups with 2 time-points. However, a number of subjects across the 3 groups only have 1 time-point - which is the main reason for using the LME approach. I will like to test regionally-specific cortical thinning (using the percentage change measure) while taking gender, age, and scan-intervals (years) into account.
Your help is greatly appreciated.
Best Wishes,
Elijah
On Mon, Jul 14, 2014 at 3:10 PM, jorge luis jbernal0019@yahoo.es wrote:
Sorry, you need to do:
M = Qdec(2:end,:);
Best -Jorge
*De:* jorge luis jbernal0019@yahoo.es *Para:* Freesurfer support list freesurfer@nmr.mgh.harvard.edu *Enviado:* Lunes 14 de julio de 2014 10:06 *Asunto:* Re: [Freesurfer] LME Longitudinal QDEC Table
Hi Elijah
You are getting NaNs because the rows of your Qdec variable (except the first) are already numeric values instead of strings. You just need to do this:
Qdec = Qdec(2:end,:);
The variable Y has the data that you already read with:
[Y, mri] = fs_read_Y('lh.thickness_sm10.mgh');
Best -Jorge
*De:* Elijah Mak fkm24@medschl.cam.ac.uk *Para:* jorge luis jbernal0019@yahoo.es *CC:* Freesurfer support list freesurfer@nmr.mgh.harvard.edu *Enviado:* Lunes 14 de julio de 2014 9:35 *Asunto:* Re: [Freesurfer] LME Longitudinal QDEC Table
Hi Jorge,
Many thanks for getting back.
What I have done is to create the table in excel (Mac version), before pasting the entire table into a program (gedit) and then saving the file as qdec.table.dat. This has worked for me in the past when I am running QDEC analyses. I have also pasted the table from excel into a text editor (pico) in my Mac terminal.
I have tried to modify the Qdec variable in Matlab by simply pasting the excel table and it appears to work (Please see attached screenshot of the Qdec variable). The resulting sID variable is correct while the Qdec table now only contains the relevant variables and covariates (years, group, gender and age) after I ran these commands:
*Qdec = rmQdecCol(Qdec,1);* (removes first column) *sID = Qdec(2:end,1); (grabs the subjects' IDs)* *Qdec = rmQdecCol(Qdec,1);* (removes the subjects'ID column)
However, when I run try to convert Qdec into a numeric matrix with *M = Qdec2num(Qdec); *the resulting M variable only consists of NaNs (Please see 2nd screenshot).
Lastly, for next step (*[M,Y,ni] = sortData(M,1,Y,sID)*, am I supposed to define Y?
Many thanks again for your help!
Best Wishes, Elijah
On Mon, Jul 14, 2014 at 2:18 PM, jorge luis jbernal0019@yahoo.es wrote:
Hi Elijah
This is happening because the columns of your Qdec table file are separated by tabs or something else. You need to use simple spaces instead or properly modify *fReadQdec* to support tabs. This is something I need to fix on github:
Best -Jorge
*De:* Elijah Mak fkm24@medschl.cam.ac.uk *Para:* freesurfer@nmr.mgh.harvard.edu *Enviado:* Viernes 11 de julio de 2014 17:44 *Asunto:* [Freesurfer] LME Longitudinal QDEC Table
Hello Freesurfer Experts,
I am performing a mass-univariate analyses using the LME toolbox for longitudinal studies.
After running both mris_preproc and mri_surf2surf , I load the lh.thickness_sm10.mgh file using
*[Y,mri] = fs_read_Y('lh.thickness_sm10.mgh');*
Next, I run the following command: *Qdec = fReadQdec('qdec.table.dat');* However, it seems that the output is entirely in string format "166 x 1 cell". The first row reads as "'fsid fsid-base years group gender age'" in a single column. Because of this, I am running into problems when I try to execute the following steps: *Qdec = rmQdecCol(Qdec,1);* (removes first column) *sID = Qdec(2:end,1); (grabs the subjects' IDs)* *Qdec = rmQdecCol(Qdec,1);* (removes the subjects'ID column) *M = Qdec2num(Qdec);* (converts to a numeric matrix) *[M,Y,ni] = sortData(M,1,Y,sID);* (sorts the data) Your help will be greatly appreciated! Many thanks. Best Regards, Elijah
-- Elijah Mak, Gates Scholar PhD Candidate *|* Psychiatry University of Cambridge Trinity College, Cambridge, CB2 1TQ
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.
-- Elijah Mak, Gates Scholar PhD Candidate *|* Psychiatry University of Cambridge Trinity College, Cambridge, CB2 1TQ
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