ANTspower tools for neuroimaging – – Background



ANTspower tools for neuroimaging – – Background

0 2


ANTs2015

notes on in progress and future work

On Github stnava / ANTs2015

ANTs brain morphology“Large-scale evaluation of ANTs and FreeSurfer cortical thickness measurements”

Cortical thickness studies

Column1 Column2 Huntington’s disease obsessive-compulsive disorder schizophrenia ADHD bipolar disorder obesity Alzheimer’s disease heritable depression frontotemporal dementia elderly depression Parkinson’s disease age Williams syndrome gender multiple sclerosis untreated male-to-female transsexuality autism handedness migraines intelligence chronic smoking athletic ability alcoholism meditative practices cocaine addiction musical ability Tourette syndrome in children tendency toward criminality scoliosis in female adolescents childhood sexual abuse in female adolescents early-onset blindness Tetris-playing ability in female adolescents chronic pancreatitis traumatic brain injury

ANTs-related background

  • Sandy, Brian, and DiReCT
    • used other tools such as FMRIB Automated Segmentation Tool (FAST)
    • KellySlater.cxx
  • pipedream scripts “adequate for Penn data.”
  • KellyKapowski.cxx and antsCorticalThickness.sh
  • “Let’s evaluate on open data.”
  • and, eventually, “Let’s compare with FreeSurfer.”

The ANTs structural brain mapping workflow

Basic components of the pipeline

template building (offline) brain extraction cortical thickness estimation cortical parcellation

Template building

Tailor data to your specific cohort

  • Templates representing the average mean shape and intensity are built directly from the cohort to be analyzed, e.g. pediatric vs. middle-aged brains.
  • Acquisition and anonymization (e.g. defacing) protocols are often different.

Template building (cont.)

Each template is processed to produce auxiliary images which are used for brain extraction and brain segmentation.

Brain extraction comparison ANTs vs. FreeSurfer

Comparison with de facto standard FreeSurfer package. Note the difference in separation of the gray matter from the surrounding CSF. (0 failures out of 1205 scans)

Brain segmentation

Randomly selected healthy individuals. Atropos gets good performance across ages.

Cortical thickness estimation

In contrast to FreeSurfer which warps coupled surface meshes to segment the gray matter, ANTs diffeomorphically registers the white matter to the combined gray/white matters while simultaneously estimating thickness.

But without ground truth, how does one evaluate the pipeline?

  • Use age and gender (demographic information) in training/prediction paradigm
  • Public data sets (IXI, NKI, OASIS, MMRR)
  • \(>\) 1200 subjects, age 4 to over 94 years old

Prediction from cortical thickness data:gender and age

Age prediction per site

Regional importance comparison

\(AGE \sim VOLUME + GENDER + \sum_{i=1}^{62} T(DKT_i)\)

ANTs (left) vs. FreeSurfer (right)

Regional measurements

But, wait, there’s more!

Data availability

  • “Hey, can I have the FreeSurfer measurements for the entorhinal cortex?” Sure, why not?

  • “I was wondering if you would make available the CT in each ROI for each subject…” Sure, why not? Would you also like the surface areas and volumes?

  • “Can I have one or more of the templates that you used for your study?” Would you like the priors as well?

  • “Hey Nick, can we hire you to do an [EZ-MAP]-type study?” What about something better?

What about using both the T1 & T2?

ANTs tools are multivariate

Arno-thick-in-the-head (ATITH)

What if we made a crude estimate of the cortical thickness?

\(thickness_{ROI} = \frac{volume_{ROI}}{area_{ROI}}\)

Make sure you estimate the surface area correctly!

So how does ATITH compare with ANTs, FS?

Prediction from cortical thickness data:gender and age

And currently brewing on the UVa cluster…

Does denoising help?

  • itkAdaptiveNonLocalMeansDenoisingImageFilter.h

  • itkAdaptiveNonLocalMeansDenoisingImageFilter.hxx

$ DenoiseImage

COMMAND:
     DenoiseImage
          Denoise an image using a spatially adaptive filter originally described in J. V.
          Manjon, P. Coupe, Luis Marti-Bonmati, D. L. Collins, and M. Robles. Adaptive
          Non-Local Means Denoising of MR Images With Spatially Varying Noise Levels,
          Journal of Magnetic Resonance Imaging, 31:192-203, June 2010.

OPTIONS:
     -d, --image-dimensionality 2/3/4
          This option forces the image to be treated as a specified-dimensional image. If
          not specified, the program tries to infer the dimensionality from the input
          image.

     -i, --input-image inputImageFilename
          A scalar image is expected as input for noise correction.

     -n, --noise-model (Rician)/Gaussian
          Employ a Rician or Gaussian noise model.

     -s, --shrink-factor (1)/2/3/...
          Running noise correction on large images can be time consuming. To lessen
          computation time, the input image can be resampled. The shrink factor, specified
          as a single integer, describes this resampling. Shrink factor = 1 is the
          default.

     -o, --output correctedImage
                  [correctedImage,<noiseImage>]
          The output consists of the noise corrected version of the input image.
          Optionally, one can also output the estimated noise image.

     --version
          Get Version Information.

     -v, --verbose (0)/1
          Verbose output.

     -h
          Print the help menu (short version).

     --help
          Print the help menu.

But the best part is …

it is absolutely free!

${ANTSPATH}/antsCorticalThickness.sh \
  -a IXI/T1/IXI002-Guys-0828-T1.nii.gz \
  -e IXI/template/T_template0.nii.gz \
  -m IXI/template/T_template0ProbabilityMask.nii.gz \
  -f IXI/template/T_template0ExtractionMask.nii.gz \
  -p IXI/template/Priors/priors%d.nii.gz \
  -o IXI/ANTsResults/IXI002-Guys-0828-

(as in speech, not beer)

Don’t worry,

we’ll run a 2-D example this afternoon.

https://github.com/ntustison/antsCorticalThicknessExample

Extensions

Cortical thickness with lesions

antsCorticalThickness.sh is adaptable!

Register subject (or single subject template) to normal template with priors.

Transform lesion mask to normal template.

Create additional “lesion” prior, i.e.

SmoothImage 3 ${lesionMask} 1 ${lesionPrior} 1
Subtract out lesion prior from all other priors and keep values \(\in [0,1]\).

Modified template spatial priors

antsCorticalThickness.sh using lesion prior

Longitudinal processing

antsLongitudinalCorticalThickness.sh

$ antsLongitudinalCorticalThickness.sh

antsLongitudinalCorticalThickness.sh performs a longitudinal cortical thickness estimation.  The following steps
are performed:
  1. Create a single-subject template (SST) from all the data
  2. Create priors for the SST
     a. Run the SST through the individual cortical thickness pipeline.
     b. The brain extraction SST prior is created by smoothing the brain extraction
        mask created during 2a.
     c. If labeled atlases are not provided, we smooth the posteriors from 2a to create
        the SST segmentation priors, otherwise we use antsMalfLabeling to create a set of
        posteriors (https://github.com/ntustison/antsCookTemplatePriorsExample).
  3. Using the SST + priors, we run each subject through the antsCorticalThickness
     pipeline.

Usage:

antsLongitudinalCorticalThickness.sh -d imageDimension
              -e brainTemplate
              -m brainExtractionProbabilityMask
              -p brainSegmentationPriors
              <OPTARGS>
              -o outputPrefix
              ${anatomicalImages[@]}

Example:

  bash /Users/ntustison/Pkg/ANTs/bin/bin/antsLongitudinalCorticalThickness.sh -d 3 -e brainWithSkullTemplate.nii.gz -m brainPrior.nii.gz -p segmentationPriors%d.nii.gz -o output ${anatomicalImages[@]}

Required arguments:

     -d:  Image dimension                       2 or 3 (for 2- or 3-dimensional image)
     -e:  Brain template                        Anatomical *intensity* template (possibly created using a population
                                                data set with buildtemplateparallel.sh in ANTs).  This template is
                                                *not* skull-stripped.
     -m:  Brain extraction probability mask     Brain *probability* mask created using e.g. LPBA40 labels which
                                                have brain masks defined, and warped to anatomical template and
                                                averaged resulting in a probability image.
     -p:  Brain segmentation priors             Tissue *probability* priors corresponding to the image specified
                                                with the -e option.  Specified using c-style formatting, e.g.
                                                -p labelsPriors%02d.nii.gz.  We assume that the first four priors
                                                are ordered as follows
                                                  1:  csf
                                                  2:  cortical gm
                                                  3:  wm
                                                  4:  deep gm
     -o:  Output prefix                         The following subdirectory and images are created for the single
                                                subject template
                                                  * ${OUTPUT_PREFIX}SingleSubjectTemplate/
                                                  * ${OUTPUT_PREFIX}SingleSubjectTemplate/T_template*.nii.gz

     anatomical images                          Set of multimodal input data assumed to be specified ordered as
                                                follows:
                                                  ${time1_modality1} ${time1_modality2} ... ${time1_modalityN} \
                                                  ${time2_modality1} ${time2_modality2} ...
                                                  .
                                                  .
                                                  .
                                                  ${timeN_modality1} ...

                        A single modality is expected by default, in which case the input images
                        are simply ordered by time:

                          ${time1_modality1} ${time2_modality1} ... ${timeN_modality1}

                        If there are multiple modalities, use the -k option to specify how many.

Optional arguments:

     -s:  image file suffix                     Any of the standard ITK IO formats e.g. nrrd, nii.gz (default), mhd
     -c:  control type                          Control for parallel computation (default 0):
                                                  0 = run serially
                                                  1 = SGE qsub
                                                  2 = use PEXEC (localhost)
                                                  3 = Apple XGrid
                                                  4 = PBS qsub
     -t:  template for t1 registration          Anatomical *intensity* template (assumed to be skull-stripped).  A common
                                                use case would be where this would be the same template as specified in the
                                                -e option which is not skull stripped.
     -a:                                        Atlases (assumed to be skull-stripped) used to cook template priors.  If atlases
                                                aren't used then we simply smooth the single-subject template posteriors after
                                                passing through antsCorticalThickness.sh. Example:

                          -a atlas1.nii.gz -a atlas2.nii.gz ... -a atlasN.nii.gz

     -l:                                        Labels associated with each atlas, in the same order as they are specified
                        with the -a option. The number of labels in each image is assumed to be equal
                                                to the number of priors.
     -f:  extraction registration mask          Mask (defined in the template space) used during registration
                                                for brain extraction.
     -j:  number of cpu cores                   Number of cpu cores to use locally for pexec option (default 2; requires "-c 2")
     -k:  number of modalities                  Number of modalities used to construct the template (default 1):  For example,
                                                if one wanted to use multiple modalities consisting of T1, T2, and FA
                                                components ("-k 3").
     -n:  use SST cortical thickness prior      If set to '1', the cortical thickness map from the single-subject template is used
                                                as a prior constraint for each of the individual calls to antsCorticalThickness.sh
                                                (default = 0).
     -g:  use floating-point precision          Use floating point precision in registrations (default = 0)
     -v:  Atropos segmentation weight (SST)     Atropos spatial prior *probability* weight for the segmentation for the single
                                                subject template (default = 0.25)
     -w:  Atropos segmentation weight (Indiv.)  Atropos spatial prior *probability* weight for the segmentation for the individual
                                                time points (default = 0.5)
     -q:  Use quick registration parameters     If = 1, use antsRegistrationSyNQuick.sh as the basis for registration
                                                during brain extraction, brain segmentation, and (optional) normalization
                                                to a template.  Otherwise use antsRegistrationSyN.sh (default = 0).
     -r:  rigid alignment to SST                This option dictates if the individual subjects are registered to the single
                                                subject template before running through antsCorticalThickness.  This potentially
                                                reduces bias caused by subject orientation and voxel spacing (default = 0).
     -z:  Test / debug mode                     If > 0, runs a faster version of the script. Only for testing. Implies -u 0.
                                                Requires single thread computation for complete reproducibility.
ANTs brain morphology“Large-scale evaluation of ANTs and FreeSurfer cortical thickness measurements”