Skip to main content

A fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more.

Project description

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.

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

antspyx-0.6.2.tar.gz (7.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

antspyx-0.6.2-cp313-cp313-win_amd64.whl (8.8 MB view details)

Uploaded CPython 3.13Windows x86-64

antspyx-0.6.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (22.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

antspyx-0.6.2-cp313-cp313-macosx_15_0_x86_64.whl (18.6 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

antspyx-0.6.2-cp313-cp313-macosx_14_0_arm64.whl (16.6 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

antspyx-0.6.2-cp312-cp312-win_amd64.whl (8.8 MB view details)

Uploaded CPython 3.12Windows x86-64

antspyx-0.6.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (22.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

antspyx-0.6.2-cp312-cp312-macosx_15_0_x86_64.whl (18.6 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

antspyx-0.6.2-cp312-cp312-macosx_14_0_arm64.whl (16.6 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

antspyx-0.6.2-cp311-cp311-win_amd64.whl (8.8 MB view details)

Uploaded CPython 3.11Windows x86-64

antspyx-0.6.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (22.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

antspyx-0.6.2-cp311-cp311-macosx_15_0_x86_64.whl (18.6 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

antspyx-0.6.2-cp311-cp311-macosx_14_0_arm64.whl (16.6 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

antspyx-0.6.2-cp310-cp310-win_amd64.whl (8.8 MB view details)

Uploaded CPython 3.10Windows x86-64

antspyx-0.6.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (22.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

antspyx-0.6.2-cp310-cp310-macosx_15_0_x86_64.whl (18.6 MB view details)

Uploaded CPython 3.10macOS 15.0+ x86-64

antspyx-0.6.2-cp310-cp310-macosx_14_0_arm64.whl (16.6 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

antspyx-0.6.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (22.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

antspyx-0.6.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (22.4 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file antspyx-0.6.2.tar.gz.

File metadata

  • Download URL: antspyx-0.6.2.tar.gz
  • Upload date:
  • Size: 7.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for antspyx-0.6.2.tar.gz
Algorithm Hash digest
SHA256 7973855ee286f8b45b816fd9da9b9ea5b11f3d6557f783147cb68ccd8d0adc6a
MD5 6338220b0e8009125a06d38fe10f2e02
BLAKE2b-256 734c302f0de74a9d118661400394f2ea20d2d749c417d41492d58f9077bebecc

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: antspyx-0.6.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 8.8 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for antspyx-0.6.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 451301a7a650b9987788eb67dfb3c5b18371ab6e201156a9b167b49c6f37f43d
MD5 3c5836e86038d00880b931723968496a
BLAKE2b-256 fc47a07e2e94436620045650b361cd88ef3d5c6adea7bcac779f271c5f5f803d

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dfae9cb73620fb20b21199161d5a520eeb1d3b1c49e4bbcba59a3b40d17b7584
MD5 96f464a408b8da68a36dffa2b1ab3771
BLAKE2b-256 423763a2d2df18c83e9b51b90eb64e3521c69b128b5eea36329ad7f513aa809b

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp313-cp313-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.2-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 b4454773a7814b849ec5b02897254ba0bf83dd91c6383c567f5b253d7999e1fb
MD5 7cbfc0e1fdc160cbb25cccb653b7d08c
BLAKE2b-256 23a131217983049c74bfdcc86fa64457f3743105bddf92a14dcbab5c8a45b7e8

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.2-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4fafef8a55d06ef8d54794cc3d85bfbc599ac9f869c31fc79dc5e159bb69cee5
MD5 72c2e3dddc64cabe1b063ad322924984
BLAKE2b-256 a6025e09b19819ae231cc0234d64ef2fc45730cc077417e4be11e0cc838adbdd

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: antspyx-0.6.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 8.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for antspyx-0.6.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 02acba8bb16e6e42c3a6624a2e48eaf81c7122cb62ae519677b5f3545b1233b7
MD5 e23d533b13a85ce98c94807ec34cbb7b
BLAKE2b-256 9407ecd04003ac1eda8102d0245aac569a1216c0ea20664c38250f2e2d300d0f

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 faf5863de6c22bf9a45713961f0fe48a5759f6249bfa360e1294f387f99cc829
MD5 1743dc5684a82dd6b95cb76a5834a0af
BLAKE2b-256 da6f7e188b720672a6897144a2755d54f03031a53290af03c4ef7826d92ed9c4

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp312-cp312-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.2-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 e190c2a3fb22d4520b2e7fbaa22dcfbca27a20461560ea0e756f39cb09270179
MD5 b7d5071cae52432e1f900dd8ae293100
BLAKE2b-256 c6ccb272c44c503bda21c4c04cf319dc0dffd4b4f8f38c3c5dd842729fe8ef6e

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.2-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 733941a1056dd36d679af8a473dbaaac5c7113a80d2a36054cda2bcaeb707964
MD5 d3488cdb6cc0a7d4e485a821943e8a8e
BLAKE2b-256 04689011a6d7d2dfee97ee070e329beff5b89491b78f69f313bc677e7cc43146

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: antspyx-0.6.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 8.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for antspyx-0.6.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 dc27cdd988a5a6775275c9b44c9edb051ac23e839018215f29cec4ea5d34319f
MD5 3c91d62498e133074348f7694040843a
BLAKE2b-256 a51f478d53a6e26cee67b90aacc2a966d4187126140346db195e1c577f6d52dc

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2183865589fd4009090983172d9881984d76bb33eb3cf0c201f42c3c1d760ca4
MD5 a2f44c49101493cfa4867a7e44a5db6f
BLAKE2b-256 894115ccc36bba3770c493dcd56845a5227ae0550c51551dd62c5d007700c708

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp311-cp311-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.2-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 e5816950dcc499ec26acb7fc13ff9ed992c192485fd13d90249319890465a671
MD5 2011aac2256180d8cb86c8cb7e0a8f86
BLAKE2b-256 3b98bbd7a19c34fbfe5444f9d92aebe127b3ae046635d37cdfd4d8c328691bad

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.2-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 1b7528a4f8a1a3eddd157b51f4b54b3532175322c2d24821129d1f65aefa37ee
MD5 2d1619dd7135f4e7b908e31f691c76df
BLAKE2b-256 0383d2b126e4ea9f869cf83b547b9d098d36137c22dffe577fd54eb970c30a64

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: antspyx-0.6.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 8.8 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for antspyx-0.6.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8d9664bec602dbc61d505443a9e9aff4f40f622525043cea613647e57a98ec14
MD5 161853a10caaf01f96baa0f023b4591d
BLAKE2b-256 33a725e465c429972d3b88044e1c38b6172a05e012a19111c1c138e87f7a537d

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 01d229f40953bd94314417277630292d64ee1ab5d5f906cf05e668a435f371b4
MD5 2dc43876b5d4ff018223b94b5aa38afe
BLAKE2b-256 f56cbd3f09b678a020b65eebd3d34095f65c1f535d8a4b78d7132ef68404fcb5

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp310-cp310-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.2-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 c54f882eff435dc45bd0cbb3ca658909504f6f3cb37e162b75c8af825b045cfe
MD5 c75a90d3c2e31270f96ebb7700e2c067
BLAKE2b-256 f96c2375a9ef84afcf1c4ee9998d7a61c6eaddfac6b2c37182382e95416f2fc3

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.2-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 c6f0dce3f8a84e63668e6656be394b07fdb19e7eb27a8af04141c5ceb052e4b4
MD5 058ad85cbe1ed67f34cb22f7ece07bca
BLAKE2b-256 35c6035f02da7a1a6395132ed5621bee408e1f097fdb1e3862851c53d9464585

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e38de355b88096253ad346ef90464bfba83c22ba71be10a8bbd2beb210b1d0fd
MD5 ad8315f11d0f20e9c7acb42ad21db365
BLAKE2b-256 9e8f639eb5a13afd18a0acef53007897e429aa4d03c7fcd393c567c7ec4c3809

See more details on using hashes here.

File details

Details for the file antspyx-0.6.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 08562ba95323a4fb93ae7d433c00673adef4bd6535f64c3a9458ef09271b5c24
MD5 9512b962b41ce15b55a10551135f945a
BLAKE2b-256 1edaffee16625505ee367f366ed2199329979b4415658f66620599e3a334dfea

See more details on using hashes here.

Supported by

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