Data Analysis
Data Acquisition
Human Connectome Project
Lab Admin
-
-
-
-
-
-
- Lab Handbook
Useful Resources
Data Analysis
Data Acquisition
Human Connectome Project
Lab Admin
Useful Resources
**This is an old revision of the document!** ----
Page describing how we analyze cortical thickness with freesurfer ====Setting up Freesurfer and MATLAB==== First make sure that you have the correct lines in your .bashrc file to run freesurfer: <code>export FREESURFER_HOME=/usr/local/freesurfer source $FREESURFER_HOME/SetUpFreeSurfer.sh > /dev/null export SUBJECTS_DIR=/mnt/diskArray/projects/freesurfer</code> Next make sure that you have the right tool boxes in your matlab search path. This should be done through your startup.m file <code>addpath(genpath('~/git/yeatmanlab'));</code> ====Create a T1 weighted nifti image for the subject==== Step 1: In a terminal, convert the PAR/REC files to nifti images. You may not need to do this if you have already gone through the [[anatomy|Anatomy Pipeline]] <code>cd /mnt/diskArray/projects/MRI/[subid] parrec2nii -c -b *.PAR</code> Step 2: In MATLAB compute the root mean squared (RMS) image. Once again this might have already been done in the [[anatomy|Anatomy Pipeline]] so you can re-use that RMS image <code>T1path = 'Path to t1 weighted image'; T1path = mri_rms(T1path); % Root mean squared image</code> ====Freesurfer Segmentation==== Freesurfer is a useful tool for segmenting a T1-weighted image and building a cortical mesh. To segment the subject's T1-weighted image using freesurfer from the command line type: <code>recon-all -i /home/projects/MRI/[subjid]/[YYYYMMDD]/[subjid]_WIP_MEMP_VBM_SENSE_13_1_MSE.nii.gz -subjid [subid] -all</code> The MATLAB script **parallel_recon.m** has been written to (with slight adjustments in order to specify file input and output) automate and parallelize the process, which typically takes 6-10 hours per file. We will follow the steps outlined in the [[https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/LongitudinalTutorial|Freesurfer Wiki]] for analyzing cortical thickness. The first steps are described [[https://surfer.nmr.mgh.harvard.edu/fswiki/LongitudinalProcessing|here]].