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.3.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.3-cp313-cp313-win_amd64.whl (8.8 MB view details)

Uploaded CPython 3.13Windows x86-64

antspyx-0.6.3-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.3-cp313-cp313-macosx_15_0_x86_64.whl (18.6 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

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

Uploaded CPython 3.13macOS 14.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

antspyx-0.6.3-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.3-cp312-cp312-macosx_15_0_x86_64.whl (18.6 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

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

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

antspyx-0.6.3-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.3-cp311-cp311-macosx_15_0_x86_64.whl (18.6 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

antspyx-0.6.3-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.3-cp310-cp310-macosx_15_0_x86_64.whl (18.6 MB view details)

Uploaded CPython 3.10macOS 15.0+ x86-64

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

Uploaded CPython 3.10macOS 14.0+ ARM64

antspyx-0.6.3-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.3-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.3.tar.gz.

File metadata

  • Download URL: antspyx-0.6.3.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.3.tar.gz
Algorithm Hash digest
SHA256 48d1f5b6b2e8a90f6f66f14cdbdd4c37e20268f5db84cb9ac99256ecb9c72386
MD5 0574479457b2122b31bde41abb1b1693
BLAKE2b-256 8b50a421ddf4f30ab6d47bd1867c4eb2680aadea94533c011e6ef6451f208054

See more details on using hashes here.

File details

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

File metadata

  • Download URL: antspyx-0.6.3-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.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 bf3a1e9508a240f41fd1ff5aa2f51caa9374cc1e35816738e22a78f493fa3817
MD5 5032fb0dec0ae0f3935a1d202abf1e68
BLAKE2b-256 3e3314afdb5f1ac1754c49642f50757eb5831cbe746c2513360b9c9ef920c4c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f91a9505a0290642bc690fcc4e26a655b36441b0aa32ece6685a73882cb6656f
MD5 ba69e2fd330b9d88b8cba63f2ade76f9
BLAKE2b-256 d864c23d2eba50a0ccc4ef55e6c56b018344c4d3c21c8656e16aa4341d77435f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.3-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 ff863c6592552c85e0f768c5856f52d16d79ad5af434b009da9eb0ab4c39110a
MD5 77c47c67756a5b456277725cca86f42e
BLAKE2b-256 487b22cab6981489a1b9f3fa77ae64310f5e16e165d713f360bb47c4b65c780c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.3-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0c9ec8fcee72d7c7fe0d820dbfc9d7f929db3306037be27f24b52e30ae1ccbc0
MD5 be29bf1d254a765f9778a0dec1c4e790
BLAKE2b-256 44533ebd21adb38422f833d6406e03ce64c3dc09b2e7dceade3a5448334e90f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: antspyx-0.6.3-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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a3011711704037202fcabb8da7da917fc667c99f54a694f0c1f58251e67b1a4f
MD5 8e436c90a8b821881d1a0f42311b1ebe
BLAKE2b-256 a0c727d9e70bddc6489f3852227748386ca293e8fa50bbee5b49ec1329f13289

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b0acddaed4b52a5374a032e5cefe483852196bc727373e18081104d6ed5faf2a
MD5 fd366ed155057faacc57c7d0a34b064b
BLAKE2b-256 abc7e942d86dab13c19b1de024cb8891c65ef59c24985995805f648e051b4137

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.3-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 68c1ee777f13398806366c339f460065ba65bcd9cc7c1daba7cfb8663e63c8f4
MD5 97cfc1938ef68d61c4ac293f7f3f80de
BLAKE2b-256 bee411956ea04c9653f5d99f7178a5e06daa7fc43b7a08a3a274879d49eeb302

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.3-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e378329089f622c72eacc47e4e2c18503d0f3fbf2cc39ccb9df65880c0a7846f
MD5 89ea0af022ad8d3a8c06299c496ddfcf
BLAKE2b-256 c1a412b5855418e5afddc588f645742c26cd2d6805cee2f745679eb06c2afc00

See more details on using hashes here.

File details

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

File metadata

  • Download URL: antspyx-0.6.3-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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 39a29ba5abbf3475dea70cf0d0a2472e34a5c854f99d2f08204a288f1f5aeac4
MD5 45004659370c0455a7d892869905211a
BLAKE2b-256 14b13d267884f1fc626248ce73091eaff0a923037c05e21fdd6321c9cf7a6d08

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d986ac7800d8fe3e3578fb81c229e588586ed3438457a46101821d761e797393
MD5 16fc7e32b9c1fc288cdb6cb3c29efdde
BLAKE2b-256 a7f052bc532820120fbc0e8fd934bd3020eab27afd116c3a6a5e7719f088f45d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.3-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 d3c38e21cb7298808acf89eb5f10a92f4dbf67adab56d878b7b024d2c565770b
MD5 88dd4361e1162854ddc869028b426e7a
BLAKE2b-256 ccd3995fe54b400d34b51fd42bde535db733d86a14d05eeaaeb7ed84fba3f813

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.3-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 7ab4e22a45699fca63c29f717eb180e3ddf38934dca26eabd19f03b02935c40f
MD5 532c31b846bb317d94cc66d71aea31b1
BLAKE2b-256 90c10eb2a0a0221da6f858b133161684c2d73021f5b0dc13b6d61e86349be4a3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: antspyx-0.6.3-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.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 73b14988124e296e7b165d54626ec4c9a6f766ab44f78d0597c12af66435cd40
MD5 cbfaaef8ff8ed70e79d2fbd8df4237ad
BLAKE2b-256 72c7229bcb0d2fad8a827351a84dbebf4609a389b49f4903c9e0e37ac60295a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 17078508ea8ac15c814f9db0973203f6d08a5ef9267deb1a8975e2b96e74d10a
MD5 cc57a1901daa5c3b30c0e321a4d4fe4b
BLAKE2b-256 1f6bd0a2d3d88b639b3cc8a7a947521b70bdf3c08c9e1c678726d6f552ab95aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.3-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 4b5b06d8070490337c7fa61bb83ad00f762805ff6f7aed2341a0617baef4958b
MD5 d40a7c1be5b8486109d926d0d358ff60
BLAKE2b-256 2a47f67884df5806d5828ce3afce073fcc0bed902f5342239a9e99e0adfa58a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.3-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 9bd8a3c8848af489ba58eeab66dc82762f87d0b8a242cab8f91d8f00e8ecf9aa
MD5 c9ba6be92aba78a323ca0a790989172e
BLAKE2b-256 bc983a746acf68f36fdaabb7fe6468abbe647946dc3c27b32faf67fd76944df0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a9a3ad29b2983e1fee500f0299f78051dee2bace5068b1cd33db1c042efeff71
MD5 eded550652556b2de397d1c894664110
BLAKE2b-256 cd5db3e11cdfdf3191a45738b886b058069e2364a46875dae28cff379e2ebed0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6ebd53d10a5a7b36462731b422ef85baf8fc75459f2fbbdfe6515eb22e8d47ac
MD5 ddefbaef3ae636d22ec13383d3505a36
BLAKE2b-256 3f6fe5755ee12888c3b3ba7c66a5c3139172e81f198dacbc0d7193a9100e568f

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