External Email - Use Caution
Hello,
I have been looking through tutorials on the website and referencing the freesurfer mail archives, but I am a bit unsure if I am following the correct procedures for my analysis. The main source of confusion on my end stems from trying to apply tutorials (and in some cases the tutorials they reference) to my longitudinal data. I appreciate your help in advance.
I have longitudinal data with scans from two time points. My variables were all collected at time point 1 (TP1). I am interested in change in cortical thickness in relation to these variables as well as interacting effects on cortical thickness; some of these variables are continuous (e.g. suvr) and some are categorical (e.g. alleles). My initial goal was to use QDEC, but I quickly learned that should use glmfit. For the purpose of understanding, I am writing in focusing on age and suvr as my variables. I started with the longitudinal tutorial.
1.) The first point of confusion came near the end of the tutorial at "long_stats_slopes". The command runs for me, but I'd appreciate a second look on whether this is correct:
long_stats_slopes --qdec $SUBJECTS_DIR/long.qdec.table.dat --stats lh.aparc.stats --meas thickness --sd $SUBJECTS_DIR --do-avg --do-rate --do-pc1 --do-spc --do-stack --time years --stack-avg [desired path]/stack-avg --stack-rate [desired path]/stack-rate --stack-pc1 [desired path]/stack-pc1 --stack-spc [desired path]/stack-spc
From there, the tutorial says to run my data through the glm tutorial. I
have several points of confusion here - the first being that I'm concerned that I may not have my data set up correctly.
2.) I looked at the FSGD examples and built my file from them, and I also referenced the mail archives for similar projects to mine. I am unsure as to whether I should be using the [LONG] files created or the [BASE] files created with the longitudinal tutorial in my FSGD file. For example, if I am just looking at age and another factor (suvr) should my FSGD look like this...
GroupDescriptorFile 1
MeasurementName thickness
Class subject
Variables age suvr
Input Subject1_TP1 subject 57 0.93
Input Subject1_TP2 subject 57 0.93
Input Subject2_TP1 subject 64 1.22
Input Subject2_TP2 subject 57 1.22
Or should it point to the directories made during the [BASE] step of the longitudinal tutorial like this?
GroupDescriptorFile 1
MeasurementName thickness
Class subject
Variables age suvr
Input Subject1_base subject 57 0.93
Input Subject2_base subject 56 1.06
3.) From there, I understand that I need an individual contrast matrix for each contrast that I'd like to run. Here is what I have been using:
Age: 0 1 0
Suvr: 0 0 1
Age x Suvr: 0 1 -1
4.) Next, I ran through the rest of the GLM tutorial to assemble the data and run glmfit, followed by a clusterwise comparison for multiple comparisons
mris_preproc --fsgd file_name.fsgd \
--target fsaverage \
--hemi lh \
--meas thickness \
--out lh.file_name.thickness.00.mgh
mri_surf2surf --hemi lh \
--s fsaverage \
--sval lh.file_name.thickness.00.mgh \
--fwhm 10 \
--cortex \
--tval lh.file_name.thickness.10.mgh
mri_glmfit \
--y lh.file_name.10.mgh \
--fsgd file_name.fsgd dods\
--C age.mtx \
--C suvr.mtx \
--C age_suvr.mtx \
--surf fsaverage lh \
--cortex \
--glmdir lh.directory_name.glmdir
mri_glmfit-sim \
--glmdir lh.gender_age.glmdir \
--cache 4 neg \
--cwp 0.05\
--2spaces
5.) My last question is, if I want to run glmfit to analyze my data with other variables, is there anything that I have to delete or re-run on my end? From what I understand, I would only have to run glmfit and its' corrections again.
I appreciate your help - I just want to make sure that I am, and that I am following these tutorials properly.
Vince
On 10/4/2021 7:09 PM, Giuseppe Miranda wrote:
External Email - Use Caution
Hello,
I have been looking through tutorials on the website and referencing the freesurfer mail archives, but I am a bit unsure if I am following the correct procedures for my analysis. The main source of confusion on my end stems from trying to apply tutorials (and in some cases the tutorials they reference) to my longitudinal data. I appreciate your help in advance.
I have longitudinal data with scans from two time points. My variables were all collected at time point 1 (TP1). I am interested in change in cortical thickness in relation to these variables as well as interacting effects on cortical thickness; some of these variables are continuous (e.g. suvr) and some are categorical (e.g. alleles). My initial goal was to use QDEC, but I quickly learned that should use glmfit. For the purpose of understanding, I am writing in focusing on age and suvr as my variables. I started with the longitudinal tutorial.
1.) The first point of confusion came near the end of the tutorial at "long_stats_slopes". The command runs for me, but I'd appreciate a second look on whether this is correct:
long_stats_slopes --qdec $SUBJECTS_DIR/long.qdec.table.dat --stats lh.aparc.stats --meas thickness --sd $SUBJECTS_DIR --do-avg --do-rate --do-pc1 --do-spc --do-stack --time years --stack-avg [desired path]/stack-avg --stack-rate[desired path]/stack-rate --stack-pc1[desired path]/stack-pc1 --stack-spc[desired path]/stack-spc
I'm not sure about this; it is not necessary for your other steps. I'll CC Martin R and Kersten in case they want to weigh in.
From there, the tutorial says to run my data through the glm tutorial. I
have several points of confusion here - the first being that I'm concerned that I may not have my data set up correctly.
2.) I looked at the FSGD examples and built my file from them, and I also referenced the mail archives for similar projects to mine. I am unsure as to whether I should be using the [LONG] files created or the [BASE] files created with the longitudinal tutorial in my FSGD file. For example, if I am just looking at age and another factor (suvr) should my FSGD look like this...
It has to be the long because that is what you want to analyze
GroupDescriptorFile 1
MeasurementName thickness
Class subject
Variables age suvr
Input Subject1_TP1 subject 57 0.93
Input Subject1_TP2 subject 57 0.93
Input Subject2_TP1 subject 64 1.22
Input Subject2_TP2 subject 57 1.22
Or should it point to the directories made during the [BASE] step of the longitudinal tutorial like this?
GroupDescriptorFile 1
MeasurementName thickness
Class subject
Variables age suvr
Input Subject1_base subject 57 0.93
Input Subject2_base subject 56 1.06
3.) From there, I understand that I need an individual contrast matrix for each contrast that I'd like to run. Here is what I have been using:
Age: 0 1 0
Suvr: 0 0 1
Age x Suvr: 0 1 -1
The first two are ok, but the 3rd one will not work. If you want an interaction between two continuous variables, you need to create a 3rd variable where you multiply them together. I would normalize them (subtract the mean, divide by the stddev)
4.) Next, I ran through the rest of the GLM tutorial to assemble the data and run glmfit, followed by a clusterwise comparison for multiple comparisons
mris_preproc --fsgd file_name.fsgd \
--target fsaverage \
--hemi lh \
--meas thickness \
--out lh.file_name.thickness.00.mgh
mri_surf2surf --hemi lh \
--s fsaverage \
--sval lh.file_name.thickness.00.mgh \
--fwhm 10 \
--cortex \
--tval lh.file_name.thickness.10.mgh
Add --prune to this
mri_glmfit \
--y lh.file_name.10.mgh \
--fsgd file_name.fsgd dods\
--C age.mtx \
--C suvr.mtx \
--C age_suvr.mtx \
--surf fsaverage lh \
--cortex \
--glmdir lh.directory_name.glmdir
mri_glmfit-sim \
--glmdir lh.gender_age.glmdir \
--cache 4 neg \
--cwp 0.05\
--2spaces
You will probably need to change the vertex-wise threshold to something lower (currently at 4). The "neg" means you are only looking for negative correlations (probably use abs to make it unsigned).
5.) My last question is, if I want to run glmfit to analyze my data with other variables, is there anything that I have to delete or re-run on my end? From what I understand, I would only have to run glmfit and its' corrections again.
Correct
I appreciate your help - I just want to make sure that I am, and that I am following these tutorials properly.
Vince
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
freesurfer@nmr.mgh.harvard.edu