Skip to main content

Advanced Normalization Tools in Python

Coverage Status PyPI - Downloads Nightly Build ci-pytest ci-docker docs

Docker Pulls Contributor Covenant PubMed

The ANTsPy library wraps the well-established C++ biomedical image processing framework ANTs. It includes blazing-fast reading and writing of medical images, algorithms for registration, segmentation, and statistical learning, as well as functions to create publication-ready visualizations.

If you are looking to train deep learning models on medical imaging datasets, you might be interested in ANTsPyNet which provides tools for training and visualizing deep learning models.


Installation

Pre-compiled binaries

The easiest way to install ANTsPy is via the latest pre-compiled binaries from PyPI.

pip install antspyx

Or alternatively from conda:

conda install conda-forge::antspyx

Because of limited storage space, pip binaries are not available for every combination of python version and platform. We also have had to delete older releases to make space. If you cannot find a binary you need on PyPI, you can check the Releases page for archived binaries.

Some Mac OS Python installations have compatibility issues with the pre-compiled binaries. This means pip will not install binaries targeted for the current Mac OS version, and will instead try to compile from source. The compatibility checks can be disabled by setting the environment variable SYSTEM_VERSION_COMPAT=0. More details on the wiki.

Windows users will need a compatible Microsoft Visual C++ Redistributable installation.

Building from source

In some scenarios, it can make sense to build from source. In general, you can build ANTsPy as you would any other Python package.

git clone https://github.com/antsx/antspy
cd antspy
python -m pip install .

Further details about installing ANTsPy or building it from source can be found in the Installation Tutorial.


Quickstart

Here is a basic overview of some of the things you can do with ANTsPy. The main functionality includes reading / writing images, basic and advanced image operations, segmentation, registration, and visualization.

import ants

# read / write images
img = ants.image_read('path/to/image.nii.gz')
ants.image_write(img, 'path/to/image.nii.gz')

# basic operations
img + img2
img - img2
img[:20,:20,:20] # indexing returns an image

# advanced operations
img = ants.smooth_image(img, 2)
img = ants.resample_image(img, (3,3,3))
img.smooth_image(2).resample_image((3,3,3)) # chaining

# convert to or from numpy
arr = img.numpy()
img2 = ants.from_numpy(arr * 2)

# segmentation
result = ants.atropos(a=img, m='[0.2,1x1]', c='[2,0]', i='kmeans[3]', x=ants.get_mask(img))

# registration
result = ants.registration(fixed_image, moving_image, type_of_transform = 'SyN' )

# plotting
ants.plot(img, overlay = img > img.mean())

Tutorials

Resources for learning about ANTsPy can be found in the tutorials folder. A selection of especially useful tutorials is presented below.

  • Basic overview [Link]
  • Composite registrations [Link]
  • Multi-metric registration [Link]
  • Image math operations [Link]
  • Wrapping ITK code [Link]

More tutorials can be found in the ANTs repository.


Contributing

If you have a question or bug report the best way to get help is by posting an issue on the GitHub page. We welcome any new contributions and ideas. If you want to add code, the best way to get started is by reading the contributors guide that runs through the structure of the project and how we go about wrapping ITK and ANTs code in C++.

You can support our work by starring the repository, citing our methods when relevant, or suggesting new features in the issues tab. These actions help increase the project's visibility and community reach.


References

The main references can be found at the main ANTs repo. A Google Scholar search also reveals plenty of explanation of methods and evaluation results by the community and by ourselves.

Release files for antspyx 0.6.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 antspyx 0.6.3
File Size Uploaded
antspyx-0.6.3.tar.gz 7.2 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for antspyx 0.6.3
File
antspyx-0.6.3-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
antspyx-0.6.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
antspyx-0.6.3-cp313-cp313-macosx_15_0_x86_64.whl CPython 3.13 CPython 3.13 macOS 15.0+ x86-64 Details
antspyx-0.6.3-cp313-cp313-macosx_14_0_arm64.whl CPython 3.13 CPython 3.13 macOS 14.0+ ARM64 Details
antspyx-0.6.3-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
antspyx-0.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
antspyx-0.6.3-cp312-cp312-macosx_15_0_x86_64.whl CPython 3.12 CPython 3.12 macOS 15.0+ x86-64 Details
antspyx-0.6.3-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details
antspyx-0.6.3-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
antspyx-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
antspyx-0.6.3-cp311-cp311-macosx_15_0_x86_64.whl CPython 3.11 CPython 3.11 macOS 15.0+ x86-64 Details
antspyx-0.6.3-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details
antspyx-0.6.3-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
antspyx-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
antspyx-0.6.3-cp310-cp310-macosx_15_0_x86_64.whl CPython 3.10 CPython 3.10 macOS 15.0+ x86-64 Details
antspyx-0.6.3-cp310-cp310-macosx_14_0_arm64.whl CPython 3.10 CPython 3.10 macOS 14.0+ ARM64 Details
antspyx-0.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
antspyx-0.6.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details

Total release size: 318.1 MB

Release files / antspyx-0.6.3.tar.gz

Download URL antspyx-0.6.3.tar.gz
Size 7.2 MB
Tags Source
SHA-256 checksum
How to use checksums
48d1f5b6b2e8a90f6f66f14cdbdd4c37e20268f5db84cb9ac99256ecb9c72386
BLAKE2b-256 checksum
How to use checksums
8b50a421ddf4f30ab6d47bd1867c4eb2680aadea94533c011e6ef6451f208054
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp313-cp313-win_amd64.whl

Download URL antspyx-0.6.3-cp313-cp313-win_amd64.whl
Size 8.8 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
bf3a1e9508a240f41fd1ff5aa2f51caa9374cc1e35816738e22a78f493fa3817
BLAKE2b-256 checksum
How to use checksums
3e3314afdb5f1ac1754c49642f50757eb5831cbe746c2513360b9c9ef920c4c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL antspyx-0.6.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 22.4 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
f91a9505a0290642bc690fcc4e26a655b36441b0aa32ece6685a73882cb6656f
BLAKE2b-256 checksum
How to use checksums
d864c23d2eba50a0ccc4ef55e6c56b018344c4d3c21c8656e16aa4341d77435f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp313-cp313-macosx_15_0_x86_64.whl

Download URL antspyx-0.6.3-cp313-cp313-macosx_15_0_x86_64.whl
Size 18.6 MB
Tags CPython 3.13 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
ff863c6592552c85e0f768c5856f52d16d79ad5af434b009da9eb0ab4c39110a
BLAKE2b-256 checksum
How to use checksums
487b22cab6981489a1b9f3fa77ae64310f5e16e165d713f360bb47c4b65c780c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp313-cp313-macosx_14_0_arm64.whl

Download URL antspyx-0.6.3-cp313-cp313-macosx_14_0_arm64.whl
Size 16.6 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
0c9ec8fcee72d7c7fe0d820dbfc9d7f929db3306037be27f24b52e30ae1ccbc0
BLAKE2b-256 checksum
How to use checksums
44533ebd21adb38422f833d6406e03ce64c3dc09b2e7dceade3a5448334e90f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp312-cp312-win_amd64.whl

Download URL antspyx-0.6.3-cp312-cp312-win_amd64.whl
Size 8.8 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
a3011711704037202fcabb8da7da917fc667c99f54a694f0c1f58251e67b1a4f
BLAKE2b-256 checksum
How to use checksums
a0c727d9e70bddc6489f3852227748386ca293e8fa50bbee5b49ec1329f13289
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL antspyx-0.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 22.4 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b0acddaed4b52a5374a032e5cefe483852196bc727373e18081104d6ed5faf2a
BLAKE2b-256 checksum
How to use checksums
abc7e942d86dab13c19b1de024cb8891c65ef59c24985995805f648e051b4137
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp312-cp312-macosx_15_0_x86_64.whl

Download URL antspyx-0.6.3-cp312-cp312-macosx_15_0_x86_64.whl
Size 18.6 MB
Tags CPython 3.12 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
68c1ee777f13398806366c339f460065ba65bcd9cc7c1daba7cfb8663e63c8f4
BLAKE2b-256 checksum
How to use checksums
bee411956ea04c9653f5d99f7178a5e06daa7fc43b7a08a3a274879d49eeb302
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp312-cp312-macosx_14_0_arm64.whl

Download URL antspyx-0.6.3-cp312-cp312-macosx_14_0_arm64.whl
Size 16.6 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
e378329089f622c72eacc47e4e2c18503d0f3fbf2cc39ccb9df65880c0a7846f
BLAKE2b-256 checksum
How to use checksums
c1a412b5855418e5afddc588f645742c26cd2d6805cee2f745679eb06c2afc00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp311-cp311-win_amd64.whl

Download URL antspyx-0.6.3-cp311-cp311-win_amd64.whl
Size 8.8 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
39a29ba5abbf3475dea70cf0d0a2472e34a5c854f99d2f08204a288f1f5aeac4
BLAKE2b-256 checksum
How to use checksums
14b13d267884f1fc626248ce73091eaff0a923037c05e21fdd6321c9cf7a6d08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL antspyx-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 22.4 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
d986ac7800d8fe3e3578fb81c229e588586ed3438457a46101821d761e797393
BLAKE2b-256 checksum
How to use checksums
a7f052bc532820120fbc0e8fd934bd3020eab27afd116c3a6a5e7719f088f45d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp311-cp311-macosx_15_0_x86_64.whl

Download URL antspyx-0.6.3-cp311-cp311-macosx_15_0_x86_64.whl
Size 18.6 MB
Tags CPython 3.11 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
d3c38e21cb7298808acf89eb5f10a92f4dbf67adab56d878b7b024d2c565770b
BLAKE2b-256 checksum
How to use checksums
ccd3995fe54b400d34b51fd42bde535db733d86a14d05eeaaeb7ed84fba3f813
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp311-cp311-macosx_14_0_arm64.whl

Download URL antspyx-0.6.3-cp311-cp311-macosx_14_0_arm64.whl
Size 16.6 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
7ab4e22a45699fca63c29f717eb180e3ddf38934dca26eabd19f03b02935c40f
BLAKE2b-256 checksum
How to use checksums
90c10eb2a0a0221da6f858b133161684c2d73021f5b0dc13b6d61e86349be4a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp310-cp310-win_amd64.whl

Download URL antspyx-0.6.3-cp310-cp310-win_amd64.whl
Size 8.8 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
73b14988124e296e7b165d54626ec4c9a6f766ab44f78d0597c12af66435cd40
BLAKE2b-256 checksum
How to use checksums
72c7229bcb0d2fad8a827351a84dbebf4609a389b49f4903c9e0e37ac60295a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL antspyx-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 22.4 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
17078508ea8ac15c814f9db0973203f6d08a5ef9267deb1a8975e2b96e74d10a
BLAKE2b-256 checksum
How to use checksums
1f6bd0a2d3d88b639b3cc8a7a947521b70bdf3c08c9e1c678726d6f552ab95aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp310-cp310-macosx_15_0_x86_64.whl

Download URL antspyx-0.6.3-cp310-cp310-macosx_15_0_x86_64.whl
Size 18.6 MB
Tags CPython 3.10 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
4b5b06d8070490337c7fa61bb83ad00f762805ff6f7aed2341a0617baef4958b
BLAKE2b-256 checksum
How to use checksums
2a47f67884df5806d5828ce3afce073fcc0bed902f5342239a9e99e0adfa58a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp310-cp310-macosx_14_0_arm64.whl

Download URL antspyx-0.6.3-cp310-cp310-macosx_14_0_arm64.whl
Size 16.6 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
9bd8a3c8848af489ba58eeab66dc82762f87d0b8a242cab8f91d8f00e8ecf9aa
BLAKE2b-256 checksum
How to use checksums
bc983a746acf68f36fdaabb7fe6468abbe647946dc3c27b32faf67fd76944df0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL antspyx-0.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 22.5 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a9a3ad29b2983e1fee500f0299f78051dee2bace5068b1cd33db1c042efeff71
BLAKE2b-256 checksum
How to use checksums
cd5db3e11cdfdf3191a45738b886b058069e2364a46875dae28cff379e2ebed0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / antspyx-0.6.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL antspyx-0.6.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 22.4 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
6ebd53d10a5a7b36462731b422ef85baf8fc75459f2fbbdfe6515eb22e8d47ac
BLAKE2b-256 checksum
How to use checksums
3f6fe5755ee12888c3b3ba7c66a5c3139172e81f198dacbc0d7193a9100e568f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.6.3 This release

19 release files

0.6.2

19 release files

0.6.1

19 release files

0.6.0

6 release files

0.5.4

17 release files

0.4.2

26 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