Differences between revisions 9 and 10
Deletions are marked like this. Additions are marked like this.
Line 63: Line 63:
All you need is to append the flag -hippocampalsubfields to your recon-all command. For example, to analyze your subject "bert", you would type: All you need is to append the flag -hippocampal-subfields-T1 to your recon-all command. For example, to analyze your subject "bert", you would type:
Line 66: Line 66:
recon-all -all -s bert -hippocampalsubfieldsT1 recon-all -all -s bert -hippocampal-subfields-T1
Line 72: Line 72:
recon-all -s bert -hippocampalsubfieldsT1 recon-all -s bert -hippocampal-subfields-T1
Line 100: Line 100:
recon-all -s <subject_name> -hippocampalsubfieldsT1T2 <file name of additional scan> recon-all -s <subject_name> -hippocampal-subfields-T1T2 <file name of additional scan>
Line 105: Line 105:
recon-all -s <subject_name> -hippocampalsubfieldsT2 <file name of additional scan> recon-all -s <subject_name> -hippocampal-subfields-T2 <file name of additional scan>

Segmentation of hippocampal subfields

This functionality is present in FreeSurfer 6.0 and later

Author: Juan Eugenio Iglesias

E-mail: iglesias [at] nmr.mgh.harvard.edu

Rather than directly contacting the author, please post your questions on this module to the FreeSurfer mailing list at freesurfer [at] nmr.mgh.harvard.edu

If you use these tools in your analysis, please cite:


Contents

  1. Motivation and General Description
  2. Installation
  3. Usage
  4. Frequently asked questions


1. Motivation and General Description

This tool generates an automated segmentation of the hippocampal subfields based on a statistical atlas built primarily upon ultra-high resolution (~0.1 mm isotropic) ex vivo MRI data. This new method can take advantage high-resolution, dedicated images when available (typically, but not necessarily, T2 weighted), and solves a number of limitations of the in vivo atlas that was distributed with FreeSurfer 5.1-5.3, namely:

(a) The image resolution of the training data used to built the atlas was insufficient for the human labelers to completely distinguish the subfields, forcing them to heavily rely on geometric criteria to trace boundaries, which affected the accuracy of their annotations. On the ex vivo images, several of these boundaries are much better visualized, so the annotations are much more reliable.

(b) Related to (a): a problematic consequence of the lack of resolution in the in vivo data was that the manual delineation protocol did not include the “molecular layer”, which corresponds to the stratum radiatum, lacunosum moleculare, hippocampal sulcus and molecular layer of the dentate gyrus, and which is also known as “dark band” due to its hypointense appearance in T2 MRI. The absence of the “molecular layer” in the atlas compromised the ability of the atlas to segment high-resolution in vivo data, since this layer is the key appearance feature describing the internal structure of the hippocampus. The new, ex vivo atlas does include this layer in the model.

(c) The delineation protocol of the in vivo atlas was designed for the hippocampal body and did not translate well to the hippocampal head or tail. The new atlas was created with a new, specifically designed labeling protocol.

(d) Due to issues (a), (b), and (c), the volumes of the subfield in the in vivo atlas did not agree well with those from histological studies (Simic, et al., 1997, Harding, et al., 1998). The volumes derived from the new atlas agree much better with these studies (see the Neuroimage paper).

Here is a coronal slice of a sample T1-weighted 1 mm scan and the corresponding segmentations given by FreeSurfer 5.3 and FreeSurfer 6.0:


samples1.png

And here is is a coronal slice of a sample T2-weighted scan with 0.4 mm in-plane resolution (coronal) and 2 m slice thickness, along with the segmentation given by FreeSurfer 6.0 (FreeSurfer 5.3 could not be used to segment such scans):


samples2.png

2. Installation

The hippocampal subfield module requires the Matlab R2012 runtime; the runtime is free, and therefore NO MATLAB LICENSES ARE REQUIRED TO USE THIS SOFTWARE. Please note that, if you have already installed the runtime for the brainstem module, you do not need to install it again. Instructions for the installation of the runtime can be found here:

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


3. Usage

This software has three modes of operation, depending on whether you only have a standard 1 mm T1 scan or you have an additional MRI volume containing the hippocampus (ideally of higher resolution).

  • Mode A: only standard resolution (~ 1 mm ) T1 scan available.

All you need is to append the flag -hippocampal-subfields-T1 to your recon-all command. For example, to analyze your subject "bert", you would type:

recon-all -all -s bert -hippocampal-subfields-T1 

Or, if Bert has already undergone the FreeSurfer pipeline (recon-all -all), you can just run:

recon-all -s bert -hippocampal-subfields-T1 

The output will be in the following directories:

$SUBJECTS_DIR/bert/mri/subfieldAnalysis_T1_v1.0/left

$SUBJECTS_DIR/bert/mri/subfieldAnalysis_T1_v1.0/right

In each of those two directories, you will find two files:

discreteLabels.mgz: the volume with the subfield segmentation

volumesHippo.txt: a text file with the volumes of the subfields and of the whole hippocampus.


  • Mode B: segmentation with an additional scan

If an additional MRI volume (e.g., a T2 scan, but it could be proton density, or even another T1) covering the hippocampi is available, we can use it to obtain a more reliable segmentation - particularly in the case in which its resolution is higher than 1 mm (even if anisotropic). In this case, the only requirement is that the additional scan is in the same orientation as the 1 mm T1 scan and coarsely aligned to it.

The are two sub-modes of operation, depending on whether we want to use the standard resolution T1 and the additional scan simultaneously in the segmentation (multispectral analysis), or if we only want to use the additional scan. The former is advised when the additional scan is of comparable resolution as the T1 scan (e.g., a 1x1x1 mm T2 volume) or when it does not cover the whole hippocampal region - in that case, the T1 information will be critical to segment the hippocampal regions outside the field of view of the additional volume (see for instance Figure 12e in the Neuroimage paper). The latter is advised when the additional scan is of higher resolution than the T1 volume and it covers the whole hippocampal region. The corresponding commands would be:

  • Multispectral segmentation:

recon-all -s <subject_name> -hippocampal-subfields-T1T2 <file name of additional scan> 
  • Using only additional scan:

recon-all -s <subject_name> -hippocampal-subfields-T2 <file name of additional scan>  

The outputs would be in the following directories:

  • Multispectral segmentation: $SUBJECTS_DIR/<subject_name>/mri/subfieldAnalysis_T1_<file name of additional scan>_v1.0/<side>/

    Using only additional scan: $SUBJECTS_DIR/<subject_name>/mri/subfieldAnalysis_<file name of additional scan>_v1.0/<side>/

where <side> is left or right. As in Mode A, the output will consist of two files, discreteLabels.mgz and volumesHippo.txt, containing the discrete segmentation and the hippocampal subfield volumes, respectively. The discrete segmentation will be in the physical coordinate space of the additional scan – but you can easily warp it to the space of the 1 mm T1 data, see FAQ below.


4. Frequently asked questions (FAQ)

  • Are you sure that this software does not require Matlab licenses? Why does it require the Matlab runtime, then?

The software uses compiled Matlab code that requires the free runtime, but no licenses. So, if you have a computer cluster, you can run hundred of segmentations in parallel without having to worry about Matlab licenses. And yes, this is all perfectly legal ;-)

  • The sum of the number of voxels of a given structure multiplied by the volume of a voxel is not equal to the volume reported in volumesHippo.txt.

This is because the volumes are computed upon a soft segmentation, rather than the discrete segmentation in discreteLabels.mgz. This is the same that happens with the main recon-all stream: if you compute volumes by counting voxels in aseg.mgz, you don't get the values reported in aseg.stats.

  • The size of the image volume of discreteLabels.mgz (in voxels) is not the same as that of norm.mgz or the additional input scan.

The segmentation discreteLabels.mgz covers only a patch around the hippocampus, at a higher resolution than the input image. The segmentation and the image are defined in the same physical coordinates, so you can visualize them simultaneously with:

cd $SUBJECTS_DIR/<subject_name>/mri/

freeview -v nu.mgz -v subfieldAnalysis_T1_v1.0/left /discreteLabels.mgz:colormap=lut subfieldAnalysis_T1_v1.0/right/discreteLabels.mgz:colormap=lut 

If you want to resample the segmentation to the 1 mm FreeSurfer voxel space, you can run the command:

mri_convert  subfieldAnalysis_T1_v1.0/<side>/discreteLabels.mgz  subfieldAnalysis_T1_v1.0/<side> /discreteLabelsResampledT1.mgz -rt nearest -rl nu.mgz -odt float

Or, if you want to resample it to the voxel space of the additional scan:

mri_convert  subfieldAnalysis<_T1>_<file name of additional scan>_v1.0/<side> /discreteLabels.mgz  subfieldAnalysis<_T1>_<file name of additional scan>_v1.0/<side>/discreteLabelsResampledAddScan.mgz -rt nearest -rl <name_of_additional_scan> -odt float
  • This module is CPU hungry

Indeed! The deformation of the atlas towards the input scan(s) is parallelized. If you want to limit the number of cores that the software is allowed to use, you simply need to set the environment variable ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS. For example, to limit the number of used cores to 2 in tcsh or csh:

setenv ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS 2

Or, in bash:

export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=2
  • The volume of the whole hippocampus obtained with this module is not equal to the value reported by the main FreeSurfer pipeline in $SUBJECTS_DIR/<subject_name>/stats/aseg.stats.

Yes! The reason for this is that the volumes correspond to two different analyses. We have found the estimates from this module to be slightly more accurate than FreeSurfer's (see paper). e

  • What image formats are supported for the additional scan?

Any format supported by FreeSurfer, including Nifti (.nii/.nii.gz), DICOM, MICN (.mnc) and FreeSurfer format (.mgh/.mgz).

  • When using an additional scan, why is the segmentation in its physical coordinate space – rather than that of the FreeSurfer pipeline?

This is because the additional scan is frequently a coronal T2 with high in-plane resolution but large slice separation, so it is more accurate to resample the isotropic T1 to the T2 space rather than the other way around. In any case, the software computes a transform than maps the space of the isotropic FreeSurfer image volumes to the space of the additional scan. This transform is available at:

  • $SUBJECTS_DIR/<subject_name>/mri/transforms/T1_to_<name_of_additional_file>.refined.<side>.lta

If you want the segmentation to be aligned with the 1mm T1 scan, you have two options, to resample or not to resample. If you want to resample to the voxel space of the 1 mm T1, you can run the following command:

cd $SUBJECTS_DIR/<subject_name>/mri/

mri_convert subfieldAnalysis<_T1>_<file name of additional scan>_v1.0/<side>/discreteLabels.mgz subfieldAnalysis<_T1>_<file name of additional scan>_v1.0/<side>/discreteLabelsResampledT1.mgz -rt nearest -rl nu.mgz -ait transforms/T1_to_<name_of_additional_file>.refined.<side>.lta  -odt float

where “ait” stands for “apply inverse transform”. If you want to warp without resampling in order to preserve the resolution of the segmentation, you can run these commands instead:

cd $SUBJECTS_DIR/<subject_name>/mri/

 mri_vol2vol --mov subfieldAnalysis<_T1>_<file name of additional scan>_v1.0/<side>/discreteLabels.mgz --o subfieldAnalysis<_T1>_<file name of additional scan>_v1.0/<side>/discreteLabelsT1spaceNoResampled.mgz --targ nu.mgz --lta-inv transforms/T1_to_<name_of_additional_file>.refined.<side>.lta  --no-resample 

HippocampalSubfields (last edited 2020-05-08 11:57:49 by JuanIglesias)