Wednesday, 17 February 2016

Using DESPOT T1 and PD maps to create synthetic T1-weighted volume

command TR FA TE Path_to_T1Map Path_to_PDmap Path_to_output
- I have followed example give by freesurfer to achieve optimal contrast
TR= 20ms
Flip angle = 30 degrees
TE = 5ms

% mri_synthesize 20 30 5 /home/../T1_map.mgz /home/../PD_map.mgz /home/...synth_output.mgh


Freesurfer vertex-wise ROI analysis using Desikan atlas annotation

# Use mri_annotation2label to create labels from the annotations of the Desikan atlas. Apply this to fsaverage, so that the label is in common space.
# If freesurfer is run on a network you might have fsaverage in your project directory, but this might just be a link. So you may need to delete the link, and copy the directory 'fsaverage' from the source e.g. /software/system/.../freesurfer/fsaverage into your project directory - this will mean that it will be editable.

% mri_annotation2label --subject fsaverage \
--hemi lh \
--outdir fsaverage/label

or

% mri_annotation2label --subject fsaverage \
--hemi lh \
--annotation aparc.a2009s \
--outdir fsaverage/label


# You can also apply this command to individual subjects, but it will be in subject space not common space.

# You then need set up your environment for analysis - see GroupAnalysis page.
# Following the steps for resampling and smoothing but instead of using the --cortex option you will need to specify the label you'd like to use. - It is important not to smooth the whole brain here, you only want to smooth the region that you are interested in analysing. for example,

% mris_preproc --fsgd YOURFILE.fsgd \
  --target fsaverage --hemi lh \
  --meas thickness \
  --out lh.YOURFILE.thickness.00.mgh

% mri_surf2surf  --hemi lh \
  --s fsaverage \
  --sval lh.YOURFILE.thickness.00.mgh \
  --fwhm 10 \
  --label-trg /path/to/fsaverage/label
  --tval lh.YOURFILE.thickness.10B.mgh


# You can then run your analysis remembering to specify that you only want to analyse the region specified.

% mri_glmfit \
  --y lh.YOURFILE.thickness.10.mgh \
  --fsgd YOURFILE.fsgd dods\
  --C lh-Avg-thickness-age-Cor.mtx \
  --surf fsaverage lh \
  --label /path/to/fsaverage/label
  --glmdir lh.YOURFILE.glmdir




# Overlaying just the labels onto an inflated brain.
% tksurfer fsaverage lh inflated

Then go to File - Label - Load label
Repeat for all labels necessary
Save tiff.

Monday, 4 January 2016

Freesurfer recon-all

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

Once all data is downloaded from dougal and transferred to your account (converted to NIFTI or not) you can start to set up the data for reconstruction.

1. Create a subdirectory for your raw data.
2. Create subject data directories with the  following command:

recon-all -i ./SAGA/SAGA01/NIFTI/MPRAGE.nii.gz -subjid NAME_OF_OUTPUT_DIRECTORY

This specifies where to find the raw data, and what to name the new directory. This new directory will be empty except for 001.mgz (raw data), and this is where all processing data will be saved.

Running the reconstruction:

recon-all  -all -subjid NAME_OF_OUTPUT_DIRECTORY