SkillAgentSearch skills...

ANTsXMouseBrainMapping

The ANTsX Ecosystem for Mapping the Mouse Brain

Install / Use

/learn @ntustison/ANTsXMouseBrainMapping
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

DOI

The ANTsX ecosystem for mapping the mouse brain

Two novel open-source contributions:


Mouse brain extraction and structural labeling

<p align="middle"> <img src="https://github.com/ntustison/DevCCF-Velocity-Flow/blob/main/Manuscript/Figures/mousePipeline.png" width="700" /> </p>

Description

To develop a structural morphological processing pipeline for the mouse brain analogous to our human-based tools. This repository includes reproducible code and resources for training and applying mouse brain structural segmentation models using ANTsXNet. These murine pipelines consist of (1) a brain extraction network trained on high-resolution T2-weighted mouse MRI templates from public datasets, and (2) a regional labeling model. Both networks follow a standardized U-net architecture with aggressive data augmentation to support generalization across varying acquisition protocols and resolutions. They have been independently applied and refined by community users across multiple imaging contexts, including serial two-photon tomography and alternate labeling schemes. All models are available via ANTsPyNet and ANTsRNet. This work also provides a more general framework for template-based, data augmentation training for both isotropic and anisotropic mouse data.

<!-- <details> <summary>Elaboration</summary> * No current tools to create training data for deep learning (in contrast to e.g., [human data](https://pubmed.ncbi.nlm.nih.gov/24879923/)). * Low data quality. Data is often: * sampling issues such as anisotropy, incomplete (i.e., missing boundary structures), * T2-w only, and * limited applicability to high resolution resources (e.g., AllenCCFv3, DevCCF). * However, in historical contrast to the human domain, we can leverage these publicly available templates (i.e., AllenCCFv3 and DevCCF) and deep learning to provide tools for multiple modalities and varying degrees of isotropic sampling. </details> <details> <summary>Results</summary> Structural morphological tools for T2-w volumetric mouse brain images: * [Brain extraction](https://github.com/ANTsX/ANTsPyNet/blob/master/antspynet/utilities/mouse.py#L5-L10) * [Brain parcellation](https://github.com/ANTsX/ANTsPyNet/blob/master/antspynet/utilities/mouse.py#L301-L306) * [Cortical thickness](https://github.com/ANTsX/ANTsPyNet/blob/master/antspynet/utilities/mouse.py#L453-L457) </details> -->

Implementation details and self-contained examples

<details> <summary>Brain extraction</summary>

Mouse brain extraction

ANTsPyNet example

>>> import ants
>>> import antspynet
>>>
>>> mouse_t2_file = tf.keras.utils.get_file(fname="mouse.nii.gz",
      origin="https://figshare.com/ndownloader/files/45289309", force_download=True)
>>> mouse_t2 = ants.image_read(mouse_t2_file)
>>> mouse_t2_n4 = ants.n4_bias_field_correction(mouse_t2, 
                                                rescale_intensities=True,
                                                shrink_factor=2, 
                                                convergence={'iters': [50, 50, 50, 50], 'tol': 0.0}, 
                                                spline_param=20, verbose=True)
>>> mask = antspynet.mouse_brain_extraction(mouse_t2_n4, modality='t2', verbose=True)

ANTsRNet example

> library( ANTsR )
> library( ANTsRNet )
>
> mouseT2File <- tensorflow::tf$keras$utils$get_file( fname="mouse.nii.gz",
    origin = "https://figshare.com/ndownloader/files/45289309", force_download = TRUE )
> mouseT2 <- antsImageRead( mouseT2File )
> mouseT2N4 <- n4BiasFieldCorrection( mouseT2, 
                                      rescaleIntensities = TRUE,
                                      shrinkFactor = 2, 
                                      convergence = list( iters = c( 50, 50, 50, 50 ), tol = 0.0 ), 
                                      splineParam = 20, verbose = TRUE )
>>> mask <- mouseBrainExtraction( mouseT2N4, modality = 't2', verbose = TRUE )

Additional notes concerning training and evaluation data and training augmentation

  • Build two symmetric isotropic ANTsX templates from two publicly available datasets with different "defacing" aesthetics:

  • Data augmentation of CAMRI and high resolution B-spline template:

    • bias field simulation,
    • histogram warping,
    • added noise,
    • random translation and warping, and
    • random anisotropic resampling in the three canonical directions.
  • C57BI evaluation data

    • Completely unseen data
    • 12 specimens
    • 7 time points (Day 0, Day 3, Week 1, Week 4, Week 8, Week 20)
    • Whole brain masks are provided
<!-- <p align="middle"> <img src="https://github.com/ntustison/DevCCF-Velocity-Flow/blob/main/Manuscript/Figures/diceWholeBrain.png" width="600" /> </p> --> </details> <details> <summary>Brain structural labeling</summary>

Mouse brain structural labeling

ANTsPyNet example

>>> import ants
>>> import antspynet
>>>
>>> mouse_t2_file = tf.keras.utils.get_file(fname="mouse.nii.gz",
      origin="https://figshare.com/ndownloader/files/45289309", force_download=True)
>>> mouse_t2 = ants.image_read(mouse_t2_file)
>>> mouse_t2_n4 = ants.n4_bias_field_correction(mouse_t2, 
                                                rescale_intensities=True,
                                                shrink_factor=2, 
                                                convergence={'iters': [50, 50, 50, 50], 'tol': 0.0}, 
                                                spline_param=20, verbose=True)
>>> parc_nick = antspynet.mouse_brain_parcellation(mouse_t2_n4, 
                                                   mask=None, 
                                                   which_parcellation="nick",      
                                                   return_isotropic_output=True,  
                                                   verbose=True)
>>> parc_tct = antspynet.mouse_brain_parcellation(mouse_t2_n4, 
                                                  mask=None, 
                                                  which_parcellation="tct",      
                                                  return_isotropic_output=True,  
                                                  verbose=True)                                                      

ANTsRNet example

> library( ANTsR )
> library( ANTsRNet )
>
> mouseT2File <- tensorflow::tf$keras$utils$get_file( fname="mouse.nii.gz",
    origin = "https://figshare.com/ndownloader/files/45289309", force_download = TRUE )
> mouseT2 <- antsImageRead( mouseT2File )
> mouseT2N4 <- n4BiasFieldCorrection( mouseT2, 
                                      rescaleIntensities = TRUE,
                                      shrinkFactor = 2, 
                                      convergence = list( iters = c( 50, 50, 50, 50 ), tol = 0.0 ), 
                                      splineParam = 20, verbose = TRUE )
> parcNick <- mouseBrainParcellation( mouseT2N4, 
                                      mask = NULL,
                                      whichParcellation = 'nick', 
                                      returnIsotropicOutput = TRUE,
                                      verbose = TRUE )
> parcTct <- mouseBrainParcellation( mouseT2N4, 
                                     mask = NULL,
                                     whichParcellation = 'tct', 
                                     returnIsotropicOutput = TRUE,
                                     verbose = TRUE )                                        

Mouse cortical thickness

ANTsPyNet example

>>> import ants
>>> import antspynet
>>>
>>> mouse_t2_file = tf.keras.utils.get_file(fname="mouse.nii.gz",
      origin="https://figshare.com/ndownloader/files/45289309", force_download=True)
>>> mouse_t2 = ants.image_read(mouse_t2_file)
>>> mouse_t2_n4 = ants.n4_bias_field_correction(mouse_t2, 
                                                rescale_intensities=True,
                                                shrink_factor=2, 
                                                convergence={'iters': [50, 50, 50, 50], 'tol': 0.0}, 
                                                spline_param=20, verbose=True)
>>> kk = antspynet.mouse_cortical_thickness(mouse_t2_n4, 
                                            mask=None, 
                                            return_isotropic_output=True,                                    
            
View on GitHub
GitHub Stars19
CategoryDevelopment
Updated29d ago
Forks2

Languages

TeX

Security Score

90/100

Audited on Mar 11, 2026

No findings