Skip to main content

Docs Get in Touch License Tests Codecov Python Version PyPI Downloads Code Style: Ruff Pre-commit Contributions Welcome

brainglobe-ccf-translator

PyPI - Version

CCF translator (brainglobe-ccf-translator) is a tool for translating between common coordinate frameworks using deformation matrices. A longstanding problem in NeuroInformatics has been the inability to easily translate data between common coordinate frameworks. CCF translator aims to solve this. By connecting each new space to an existing one, we can construct a graph of deformations. This means that data can be translated as long as there is a route from one space to another, even if that route passes through multiple other spaces. Now, when new templates for new modalities, strains, or ages are released, users will not be subdivided into unrelated spaces. As long as they are connected to a space which exists in our network, they will be fully connected to all other spaces.

CCF translator can also interpolate between spaces and create a new intermediate space. This is primarily useful for development, where, for instance, the midpoint between day 5 and day 7 can be taken and used as a postnatal day 6 reference. It could also be useful for making references of disease progression.

Diagram: a graph of all the available spaces and how they are connected. the spaces are nodes with the space name written on top of them, the edges show which spaces are connected to which other spaces.

graph TD
    allen_mouse_P56 --- demba_dev_mouse_P56
    allen_mouse_P56 --- perens_multimodal_lsfm_P56
    allen_mouse_P56 --- perens_stereotaxic_mri_mouse_P56
    allen_mouse_P56 --- princeton_mouse_P56
    demba_dev_mouse_P14 --- demba_dev_mouse_P21
    demba_dev_mouse_P14 --- demba_dev_mouse_P7
    demba_dev_mouse_P21 --- demba_dev_mouse_P28
    demba_dev_mouse_P28 --- demba_dev_mouse_P56
    demba_dev_mouse_P4 --- demba_dev_mouse_P7
    dorr_mouse_mri_P84 --- perens_stereotaxic_mri_mouse_P56

Use Cases

One way you can use CCF translator is to view data from one space, in another space. For instance the allen connectivity dataset shows projections from viral tracing studies in the adult brain. We can take any of these projection datasets and view them in the developing brain, for instance post natal day 9. an image which shows a viral tracing study overlaid on the allen adult ccfv3 template. it shows that same viral tracing data transformed and overlaid on a post natal day 9 template. between the two images is an arrow pointing from the adult to the post natal day 9 brain, above which is text saying CCF translator, implying that CCF translator was used to transform the data from adult to post natal day 9.

Installation

CCF translator can be installed by running

pip install brainglobe-ccf-translator

Or by cloning this repository and running

pip install -e .

while in the root of the repository.

Currently supported spaces

the name in CCF translator usually copies the name of the atlas in the brainglobe atlasapi.

Framework Name name in api supported age range
Allen mouse CCFv3 allen_mouse 56
Demba developmental mouse demba_dev_mouse 4-56
Gubra lightsheet mouse perens_multimodal_lsfm 56
Gubra MRI mouse perens_stereotaxic_mri_mouse 56
Princeton lightsheet mouse princeton_mouse 56
Dorr MRI mouse dorr_mouse_mri 84

We also support brainglobe atlas api names which are in existing coordinate frameworks. For instance you can specify osten_mouse and CCF translator will autoconvert this to allen_mouse.

atlas api name converts to supported age range
osten_mouse allen_mouse 56
allen_mouse_bluebrain_barrels allen_mouse 56
kim_mouse allen_mouse 56
demba_allen_seg_dev_mouse demba_dev_mouse 4-56

Usage

Transforming points To take a coordinate in one volume and find the equivalent coordinate in a second volume is quite simple in CCF translator.

import numpy as np
import brainglobe_ccf_translator

points = np.array([(286,250,267), (414,247,452)])
pset = brainglobe_ccf_translator.PointSet(points, 'demba_dev_mouse', voxel_size_micron=20, age_PND=56)
pset.transform(target_age=56, target_space='allen_mouse')
print(f"new points are {pset.values}")
new points are [[267 250 286] [452 247 414]]

Transforming volumes by default we downsample the deformation fields to match the resolution of your volume. This is much faster and uses less memory but is slightly less accurate. For a more accurate result set downsample=False in Volume.transform and VolumeSeries.interpolate_series.

All of our transforms assume you retrieved the atlas from the brianglobe-atlasapi. To run the volume examples you will want to install brainglobe-atlasapi using the following

pip install brainglobe-atlasapi

Transforming a volume is equally simple, here we get the volume from the brainglobe api, but you can load it however you like. In the Demba space the valid ages are from 4 to 56, and all of these are valid targets for transformation.

from brainglobe_atlasapi.bg_atlas import BrainGlobeAtlas
import brainglobe_ccf_translator

voxel_size_micron = 10
space_name = r"allen_mouse"
atlas = BrainGlobeAtlas(f"{space_name}_{voxel_size_micron}um")
source_age = 56
target_age= 32

ccft_vol = brainglobe_ccf_translator.Volume(
    values = atlas.reference,
    space = 'allen_mouse',
    voxel_size_micron=voxel_size_micron,
    segmentation_file=False,
    age_PND = source_age
)

ccft_vol.transform(target_age, 'demba_dev_mouse')
ccft_vol.save(rf"demo_data/P{target_age}_template_{voxel_size_micron}um.nii.gz")

Contributing

If you would like to add a new space or connect an existing one, please create a deformation matrix and/or describe the required reorientation, flipping, cropping, and padding of the axis between this space and one that already exists in the network, and then open an issue in this repository. Ideally, choose a space which covers all the areas which are covered in your space. While the Allen CCFv3 is very popular, it is missing the anterior olfactory bulb and the caudal portion of the cerebellum and brain stem, so it is not the optimal choice.

Citation

CCF translator was first described in DeMBA: a developmental atlas for navigating the mouse brain in space and time. If you use CCF translator, please cite that paper.

Metadata

Release files for brainglobe-ccf-translator 0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for brainglobe-ccf-translator 0.5
File Size Uploaded
brainglobe_ccf_translator-0.5.tar.gz 915.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for brainglobe-ccf-translator 0.5
File Interpreter ABI Platform
brainglobe_ccf_translator-0.5-py3-none-any.whl Python 3 none any Details

Total release size: 947.0 kB

Release files / brainglobe_ccf_translator-0.5.tar.gz

Download URL brainglobe_ccf_translator-0.5.tar.gz
Size 915.8 kB
Tags Source
SHA-256 checksum
How to use checksums
89f808ae7cd23154f6489f5dd1cb7394eb45f954bdc4c327d24abbf32da32b4d
BLAKE2b-256 checksum
How to use checksums
07e937704add26b3f05a25376fc560556ffd8ff1895476c4a62d48ed7aa8dcbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / brainglobe_ccf_translator-0.5-py3-none-any.whl

Download URL brainglobe_ccf_translator-0.5-py3-none-any.whl
Size 31.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79f1e21f062a7266560392d0ddb2a278e47acc8cb8c6a3950d481e8c191db07e
BLAKE2b-256 checksum
How to use checksums
1a48afc36cc07b9bb95e7df0946a08ee14bf9181b76387d36b7ff56a8067c773
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

0.22

2 release files

0.21

2 release files

This release

0.5 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page