Skip to main content

Build unbiased anatomical templates from individual images

Project description

License CI codecov Ruff Code style: black pre-commit

brainglobe-template-builder

Build unbiased anatomical templates from individual images

Overview

brainglobe-template-builder provides a streamlined process to create unbiased anatomical reference images, or templates, from multiple high-resolution brain images. While primarily designed for brain imaging, its versatility extends to any organ with available 3D digital images, especially those produced by 3D volumetric microscopy like serial two-photon tomography (STPT) and light-sheet microscopy (LSM).

brainglobe-template-builder aims to:

Warning

  • Early development phase. Stay tuned
  • Interface may undergo changes.

Installation

Warning

  • ANTs, which we depend on, is a large package. The installation may take a while.
  • ANTs is only available for Linux and macOS. If you are on Windows, you can use WSL

We recommend installing brainglobe-template-builder within a conda or mamba environment. Instructions assume conda usage, but mamba/micromamba are interchangeable.

Use the provided environment.yaml file to create a new environment.

git clone https://github.com/brainglobe/brainglobe-template-builder
cd brainglobe-template-builder
conda env create -f environment.yaml -n template-builder
conda activate template-builder

We have called the environment template-builder, but you can choose any name you like.

To install the latest development version of brainglobe-template-builder,

pip install -e .[dev]

For zsh users (default shell on macOS):

pip install -e '.[dev]'

Background

On templates and atlases

In brain imaging, a template serves as a standard reference for brain anatomy, often used interchangeably with the term reference image. By aligning multiple brain images to a common template, researchers can standardize their data, facilitating easier data-sharing, cross-study comparisons, and meta-analyses.

An atlas elevates this concept by annotating a template with regions of interest, often called labels or parcellations. With an atlas, researchers can pinpoint specific brain regions and extract quantitative data from them.

The entire process, from registration to data extraction, hinges on the quality of the template image. A high-quality template can significantly improve registration accuracy and the precision of atlas label annotations.

The aim of brainglobe-template-builder is to assist researchers in constructing such high-quality templates.

Single-subject vs population templates

Templates can be derived in two primary ways. A single-subject template is based on the brain of one individual. While this approach is simpler and may be suitable for some applications, it risks being unrepresentative, as the chosen individual might have unique anatomical features. On the other hand, population templates are constructed by aligning and averaging brain images from multiple subjects. This method captures the anatomical variability present in a population and reduces biases inherent in relying on a single subject. Population templates have become the standard in human MRI studies and are increasingly being adopted for animal brain studies.

Template construction with ANTs

brainglobe-template-builder leverages the power of ANTs (Advanced Normalisation Tools), a widely used software suite for image registration and segmentation.

ANTs includes a template construction piepline - implemented in the antsMultivariateTemplateConstruction2.sh script - that iteratively aligns and averages multiple images to produce an unbiased population template (see this issue for details).

An optimsed implementation of the above pipeline, developed by the CoBra lab, lies at the core of the brainglobe-template-builder's functionality.

License

⚖️ BSD 3-Clause

Package blueprint

This package layout and configuration (including pre-commit hooks and GitHub actions) have been copied from the python-cookiecutter template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brainglobe-template-builder-0.0.3.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file brainglobe-template-builder-0.0.3.tar.gz.

File metadata

File hashes

Hashes for brainglobe-template-builder-0.0.3.tar.gz
Algorithm Hash digest
SHA256 6a05f833165b79816f76723cc6899c857bfe9e97c4f42889137e9a999e600f41
MD5 e15d011cadf9bac465d3a3edba197849
BLAKE2b-256 8fa7861fd68431dd2624248e61d9b11544bc2445290db49705341d018b27d140

See more details on using hashes here.

File details

Details for the file brainglobe_template_builder-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for brainglobe_template_builder-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 15e7b5c46416c4da383e95bb5d83d36a04e90ae839a9cd01b2670c097c23bd2c
MD5 d8805662f93298d25ea60a487ba9623e
BLAKE2b-256 a7716ccdc6ae7f5af8a972de3e3c927a3f29321d786d7f075fc65ed220ab8b47

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page