Skip to content

NSB Pipeline for T1

cicadawing edited this page Sep 19, 2024 · 9 revisions

NSB Pipeline for T1

  1. MRIQC
    • Run MRIQC at the individual level - quantifies various measures of SNR in a T1 according
    • Run MRIQC at the group level - identify outliers across these metrics
    • Run Alex Holmes’ MRIQC PCA - identify the participants who are outliers across the metrics altogether
    • Inspect the outlier data, remove if necessary
  2. FreeSurfer recon
    • Run recon-all
  3. FreeSurfer Euler function (a script for it can be found at /projects/freesurfer_holmesQC/step1_autoQC/Step1c.euler.sh)
    • Run the Freesurfer euler function to identify participants with an excessive number of holes in their reconstructed surface mesh. This is used to identify participants where Freesurfer reconstruction is poor.
    • Identify outliers in euler number
    • Inspect outliers and remove data if necessary
  4. FreeSurfer recon inspection
    • Depending on the amount and novelty of the data (e.g. maybe the T1 is collected using unusual parameters such as 7T Tesla MP2RAGE), you may want to inspect all/some of the reconstructed data.
    • Inspect the data by loading the pial surfaces into Freesurfer along with the original anatomical data. If reconstruction was accurate, you should see that the tracings follow the grey/white matter boundaries in a predictable manner.

Notes on MP2RAGE

In the MP2Rage sequence, two T1 measurements are taken at slightly different inversions (typically ending in _inv1 and _inv2). These images are combined into one MP2RAGE image (a*_uni image). Combining images this way enhances grey and white matter tissue contrasts at the expense of increasing noise in the CSF, sinuses and air pockets around the subject. If we were to just pass the noisy uni image to Freesurfer, the algorithm would struggle to yield unbiased results because of the level of noise (e.g. tracing issues). We thus need to remove this noise using some method. Various methods are available:

  • MP2Rage cleaning in SPM
  • SUSAN in FSL
  • Some github repositories claim to be able to automatically clean by introducing a scrubbing parameter

The best method of cleaning we have come across is the presurfer package - this creates a series of masks based on the non-noisy, high contrast inv2 image using AFNI to get a map of the CSF and the air outside of the skull, which is then applied to the unified image (since it is in the same space), thereby cutting out areas affected by problematic noise. The end result of presurfer is a skullstripped image - which the creators say is intended to be passed to Freesurfer for reconstruction. However, freesurfer requires a full head for accurate Talairach registration (you will also need intracranial volume estimation). Hence, we just use the full uni image once it has been noise scrubbed (includes brain and skull).

https://github.com/srikash/presurfer

To run presurfer, clone the repository into your utils directory. You may also need your own copy of spm12.

I set up my own presurfer function in a matlab file like below (ie. where s is a subject number ie. 10 for sub-10):

function Step2_presurfer_function(s)

addpath(genpath('~/kg98_scratch/Toby/utils/presurfer'))
addpath(genpath('~/kg98_scratch/Toby/utils/spm12'))


direc = fullfile(sprintf('~/kg98_scratch/Toby/WHOLEMBBP/workspace/DICOM_DIR/MRH106_MBBP%i_MR01', s));
cd(direc)
% MP2RAGE pre-processing Start-to-finish
UNI=fullfile(pwd, (sprintf('%i_uni_T1w.nii', s)));
INV2=fullfile(pwd, (sprintf('%i_inv2_T1w.nii', s)));
% ########################################################################
% STEP - 0 : (optional) MPRAGEise UNI
% ########################################################################
UNI_out = presurf_MPRAGEise(INV2,UNI); % Outputs presurf_MPRAGEise directory

% ########################################################################
% STEP - 1 : Pre-process INV2 to get STRIPMASK
% ########################################################################
presurf_INV2(INV2); % Outputs presurf_INV2 directory

% ########################################################################
% STEP - 3 : Pre-process UNI to get BRAINMASK
% ########################################################################
% Change UNI path to that of the MPRAGEised UNI if Step-0 was done
if exist('UNI_out','var')
    presurf_UNI(UNI_out); % Outputs presurf_UNI directory
else
    presurf_UNI(UNI);
end

% ########################################################################
% STEP - 4 : Prepare for Freesurfer
% ########################################################################

% Load the MPRAGEised UNI image and STRIPMASK in ITK-SNAP
% Clean the mask in the regions-of-interest and save
% Multiply the MPRAGEised UNI with the manually edited STRIPMASK
% Supply to recon-all

end

I then typically call on the script from the command line e.g.

#Move to directory of the .mat file first then run. Make sure $s is set
matlab -nodisplay -r "cd('/home/tconstab1/kg98_scratch/Toby/WHOLEMBBP/workspace'); Step2_presurfer_function($s);exit"

Notes on limbic reconstruction

Freesurfer has limbic reconstruction currently available (08/2023) - but we caution that this is still a work in progress. We hope that more research will become available on the accuracy of Freesurfer’s sclimbic.

Clone this wiki locally