User Tools

Site Tools


neuroimagen:fs_group_analysis

This is an old revision of the document!


FreeSurfer Group Analysis

FSDG

https://surfer.nmr.mgh.harvard.edu/fswiki/FsgdExamples

https://surfer.nmr.mgh.harvard.edu/fswiki/FsgdFormat

Primero hay que construir el archivo de diseño del experimento,

[osotolongo@detritus fsdg]$ head codes.csv
Subject,PSubject
0001,F001
0002,F002
0003,F003
0004,F004
0005,F005
0006,F006
0007,F007
0008,F008
0009,F009
[osotolongo@detritus fsdg]$ head demographics.csv
PSubject,edat_v0,Anyos_Escolaridad_FAC_v0,Sex_1H_0M_v0
F001,71,8,0
F002,70,12,1
F003,70,8,0
F004,76,16,0
F005,68,20,1
F006,64,14,0
F007,59,19,1
F008,55,16,0
F009,67,16,0
[osotolongo@detritus fsdg]$ join -t"," -1 2 -2 1 codes.csv demographics.csv | awk -F"," '{print "facehbi_"$2","$3","$4","$5}' | sed 's/facehbi_Subject/Variables/;s/edat_v0/Age/;s/Anyos_Escolaridad_FAC_v0/Education/;s/Sex_1H_0M_v0/Gender/' | sed 's/facehbi_\([^,]*\),/Input facehbi_\1 Main /; s/,/ /g' > body.csv
[osotolongo@detritus fsdg]$ head body.csv
Variables Age Education Gender
Input facehbi_0001 Main 71 8 0
Input facehbi_0002 Main 70 12 1
Input facehbi_0003 Main 70 8 0
Input facehbi_0004 Main 76 16 0
Input facehbi_0005 Main 68 20 1
Input facehbi_0006 Main 64 14 0
Input facehbi_0007 Main 59 19 1
Input facehbi_0008 Main 55 16 0
Input facehbi_0009 Main 67 16 0
[osotolongo@detritus fsdg]$ cat headers.txt
GroupDescriptorFile 1
Title FACEHBI_all
Class Main
[osotolongo@detritus fsdg]$ cat headers.txt body.csv > facehbi.fsdg
[osotolongo@detritus fsdg]$ head facehbi.fsdg
GroupDescriptorFile 1
Title FACEHBI_all
Class Main
Variables Age Education Gender
Input facehbi_0001 Main 71 8 0
Input facehbi_0002 Main 70 12 1
Input facehbi_0003 Main 70 8 0
Input facehbi_0004 Main 76 16 0
Input facehbi_0005 Main 68 20 1
Input facehbi_0006 Main 64 14 0

GLM Analysis (mri_glmfit)

Primero construimos los contrastes, diciendole a FS cual es la variable que nos interesa, en este caso la edad,

[osotolongo@detritus fsdg]$ cat facehbi.mtx
0 1 0 0

Ahora vamos a correr el modelo con este contraste,

[osotolongo@detritus fsdg]$ mris_preproc --fsgd facehbi.fsdg --cache-in thickness.fwhm10.fsaverage --target fsaverage --hemi lh --out lh.facehbi.age.thickness.10.mgh
[osotolongo@detritus fsdg]$ mri_glmfit --y lh.facehbi.age.thickness.10.mgh --fsgd facehbi.fsdg --C facehbi.mtx --surf fsaverage lh --cortex --glmdir lh.facehbi.age.glmdir

Para usar freeview me he tenido que ir a la FSL VM

[fsluser@FSLVm7_64 fsdg]$ freeview -f $SUBJECTS_DIR/fsaverage/surf/lh.inflated:annot=aparc.annot:annot_outline=1:overlay=lh.facehbi.age.glmdir/facehbi/sig.mgh:overlay_threshold=4,5 -viewport 3d

Cambiando el overlay threshold para que muestre toda la significancia,

Ejemplo, fijando uncorrected p<0.001,

neuroimagen/fs_group_analysis.1591862803.txt.gz · Last modified: 2020/08/04 10:46 (external edit)