Skip to main content

Anatomical Foundation Models for Brain MRIs

Installing

pip3 install git+https://github.com/carloalbertobarbano/AnatCL.git

Pretrained Models

import torch
from torchvision import transforms
from anatcl import AnatCL

model = AnatCL(descriptor="global", fold=0, pretrained=True)
model = model.to("cuda")

transform = transforms.Compose([
        transforms.Lambda(lambda x: torch.from_numpy(x.copy()).float()),
        transforms.Normalize(mean=0.0, std=1.0)
])

# Volumes should be 121x128x121 preprocessed with cat12 toolbox (vbm)
dataset = Dataset(transform=transform, ...)
dataloader = torch.utils.data.DataLoader(dataset, batch_size=8, shuffle=False,
                                         num_workers=8, persistent_workers=True)

model.eval()
for (image, label) in dataloader:
    image = image.to("cuda")
    output = model(image)
    
    # Do something with the output

Training Code

Check out this repository : https://github.com/carloalbertobarbano/contrastive-learning-brain-mri

Citing

If you find our models useful please do not forget to cite this work as

@article{barbano2026anatomical,
  title = {Anatomical foundation models for brain MRIs},
  journal = {Pattern Recognition Letters},
  volume = {199},
  pages = {178-184},
  year = {2026},
  issn = {0167-8655},
  doi = {https://doi.org/10.1016/j.patrec.2025.11.028},
  url = {https://www.sciencedirect.com/science/article/pii/S0167865525003848},
  author = {Carlo Alberto Barbano and Matteo Brunello and Benoit Dufumier and Marco Grangetto},
}

Metadata

Release files for anatcl 0.0.3

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

Source distribution (sdist)

Source distribution for anatcl 0.0.3
File Size Uploaded Provenance Actions
anatcl-0.0.3.tar.gz 7.1 kB Without provenance Details for anatcl-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anatcl 0.0.3
File Interpreter ABI Platform Actions
anatcl-0.0.3-py3-none-any.whl Python 3 none any Details for anatcl-0.0.3-py3-none-any.whl

Total release size: 14.1 kB

Release files / anatcl-0.0.3.tar.gz

Download URL anatcl-0.0.3.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
85ece5a99e0f3841819c8822bf46820d55618b8a6280b2d5c3b46ebfc0ca6fb5
BLAKE2b-256 checksum
How to use checksums
9b119bf75cdd65778c9340f3ad1dd89e596a532c8ecf3a3dc2abd2b70fe6112f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / anatcl-0.0.3-py3-none-any.whl

Download URL anatcl-0.0.3-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63a60c9d6bc17480df80ab6277e6847d3736623ad8e3689fb9d535de5d552e2f
BLAKE2b-256 checksum
How to use checksums
3e53d683356ff273a540eb6263df2123a1301c0de6458c7f60616b5ff83c5870
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Security for anatcl 0.0.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files No provenance

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