Skip to content

T1_FreeSurfer_Longitudinal

Ninon Burgos edited this page Sep 10, 2020 · 9 revisions

t1-freesurfer-longitudinal – FreeSurfer-based longitudinal processing of T1-weighted MR images

This pipeline processes a series of images acquired at different time points for the same subject with the longitudinal FreeSurfer stream [Reuter et al., 2012] to increase the accuracy of volume and thickness estimates. It does so in a single command consisting of two consecutive steps:

  • Template creation This corresponds to the FreeSurfer recon-all -base command. It is executed on the subject to produce an unbiased template image using robust and inverse consistent registration [Reuter et al., 2010].

  • Longitudinal correction This template is then used as an initialization to a sequence of processing steps triggered by the command FreeSurfer recon-all -long to perform segmentation, extract surfaces and derive measurements at each time point.

Prerequisites

The pipeline requires a prior run of the cross-sectional t1-freesurfer pipeline.

Dependencies

If you only installed the core of Clinica, this pipeline needs the installation of FreeSurfer 6.0 on your computer. You can find how to install this software on the third-party page.

Running the pipeline

The pipeline can be run with the following command line:

clinica run t1-freesurfer-longitudinal  <caps_directory>

where:

  • caps_directory is the input/output folder containing the results in a CAPS hierarchy. If you want to run the pipeline on a subset of your dataset, you can use the -tsv flag to specify in a TSV file the participants and the corresponding sessions of interest.

!!! note The computational time for one subject is around 6-8 hours (creation of the unbiased template) + 2-5 hours per corresponding session. The code execution speed depends on your CPU and the quality of your input T1 volumes. Please be aware that even though the pipeline runs in parallel, processing many subjects and sessions (e.g. ADNI dataset) is time consuming.

??? warning "Case when longitudinal correction is performed on macOS" If your run the t1-freesurfer-longitudinal pipeline on macOS, you will see warning messages when longitudinal correction is performed e.g.: text [19:29:11] Needs to create a $SUBJECTS_DIR folder in /var/folders/m_/j76n37kn4vs6zsj8fq0qcgy0000dn9/T/tmpbrbg9w1n for sub-01 | ses-2011 | long-20112015 (macOS case). When longitudinal correction is performed on macOS, FreeSurfer (recon-all -long) may crash if it has to handle a very long path. The workaround we are currently using is that FreeSurfer will be run in a temporary folder (e.g. /tmp/tmp<hash>) instead of <path_to_wd>/t1-freesurfer-longitudinal-correction/ReconAll. Then, the results will be copied to the working directory before the temporary folder is deleted.

??? warning "Case where one session is used for a participant" If your CAPS directory contains a participant with one session e.g.: text CAPS └── subjects ├── sub-CLNC01 │ ├── ses-M00 │ │ └── t1 │ │ └── freesurfer_cross_sectional │ └── ses-M18 │ └── t1 │ └── freesurfer_cross_sectional └── sub-CLNC02 └── ses-M00 └── t1 └── freesurfer_cross_sectional You will see this type of message when running Clinica: text $ clinica run t1-freesurfer-template CAPS -np 2 -wd <path_to_wd> The pipeline will be run on the following 2 participant(s): sub-CLNC01 | ses-M18, ses-M00 | long-M00M18 sub-CLNC02 | ses-M00 | long-M00 List available in <path_to_wd>/t1-freesurfer-template/participants.tsv The pipeline will last approximately 10 hours per participant. [13:33:43] sub-CLNC02 | long-M00 has only one time point. Needs to create a $SUBJECTS_DIR folder in /tmp/tmpe7ztq9hq [13:33:43] Running pipeline for sub-CLNC01 | long-M00M18 [13:33:43] Running pipeline for sub-CLNC02 | long-M00 [19:51:18] sub-CLNC01 | long-M00M18 has completed [20:15:04] Segmentation of sub-CLNC02 | long-M00 has moved to working directory and $SUBJECTS_DIR folder (/tmp/tmpe7ztq9hq) was deleted [20:15:05] sub-CLNC02 | long-M00 has completed [20:15:09] The t1-freesurfer-template pipeline has completed. You can now delete the working directory (<path_to_wd>/t1-freesurfer-template). When one session is used for template creation, FreeSurfer (recon-all -base) may crash if it has to handle a very long path. The workaround we are currently using is that when one time point is detected for a given participant, FreeSurfer will be run in a temporary folder (e.g. /tmp/tmp<hash>) instead of <path_to_wd>/t1-freesurfer-template/ReconAll. Then, the results will be copied to the working directory before the temporary folder is deleted.

Outputs

Template creation

Results stored in the following folder of the CAPS hierarchy: subjects/sub-<participant_label>/long-<long_label>/freesurfer_unbiased_template/sub-<participant_label>_long-<long_label>.

<long_label> is an identifier defined by concatenating all the sessions associated with the current <participant_label> (e.g. if the template for participant sub-CLNC01 is built from sessions M00, M01, M05, then <long_label> will be M00M01M05). See CAPS specifications for full definition and example of <long_id>.

This folder contains the standard output structure of the recon-all command (label/, mri/, surf/, etc.) already explained in the t1-freesurfer pipeline.

Longitudinal correction

Results are stored in the following folder of CAPS hierarchy: subjects/sub-<participant_label>/ses-<session_label>/t1/long-<long_label>/freesurfer_longitudinal/sub-<participant_label>_ses-<session_label>.long.sub-<participant_label>_long-<long_label>.

Similar to the template creation folder, the longitudinal folder contains the standard output structure of the recon-all command (label/, mri/, surf/, etc.). Among the files generated by FreeSurfer, you may be interested in the following outputs:

  • */mri/aseg.mgz: subcortical segmentation volume after correction with the unbiased template
  • */mri/wm.mgz: white matter mask after correction with the unbiased template
  • */mri/brainmask.mgz: skull-stripped volume after correction with the unbiased template
  • */surf/{l|r}.white: white surface between white matter and gray matter after correction with the unbiased template
  • */surf/{l|r}.pial: pial surface between gray matter and CSF after correction with the unbiased template

(where * stands for sub-<participant_label>_ses-<session_label>.long.sub-<participant_label>_long-<long_label>)

More details regarding the recon-all output files can be found on the FreeSurfer website.

!!! note The full list of features extracted from the FreeSurfer pipeline can be found in the The ClinicA Processed Structure (CAPS) specifications.

Describing this pipeline in your paper

!!! cite "Example of paragraph (short version):" These results have been obtained using the t1-freesurfer-longitudinal pipeline of Clinica [Routier et al]. This pipeline is a wrapper of different tools of the FreeSurfer software (http://surfer.nmr.mgh.harvard.edu/) [Fischl et al, 2012]. This processing builds a subject-dependent template space and extracts volume and thickness estimates in this space at different points in time.

??? cite "Example of paragraph (long version):" These results have been obtained using the t1-freesurfer-longitudinal pipeline of Clinica [Routier et al]. This pipeline is a wrapper of different tools of the FreeSurfer software [Fischl et al, 2012], which is documented and freely available for download online (http://surfer.nmr.mgh.harvard.edu/). The technical details of the procedures concerned with longitudinal analysis are described in prior publications [Reuter et al, 2010; Reuter et al, M00; Reuter et al, 2012]. The pipeline processes a series of images acquired at different time points for the same subject. It first produces an unbiased (with respect to any time point) template volume, and then, for each time point, uses the template as an initialisation (tailored to the subject) for the FreeSurfer cortical reconstruction process.

!!! tip Easily access the papers cited on this page on Zotero.

Support

Advanced usage

The two main processing steps of the t1-freesurfer-longitudinal pipeline can be performed individually:

  • Template creation

    Command line:

    clinica run t1-freesurfer-template caps_directory
    
  • Longitudinal correction

    Command line:

    clinica run t1-freesurfer-longitudinal caps_directory