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.1.tar.gz (7.2 MB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.13Windows x86-64

antspyx-0.6.1-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.1-cp313-cp313-macosx_14_0_arm64.whl (16.6 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

antspyx-0.6.1-cp313-cp313-macosx_13_0_x86_64.whl (19.3 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

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

Uploaded CPython 3.12Windows x86-64

antspyx-0.6.1-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.1-cp312-cp312-macosx_14_0_arm64.whl (16.5 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

antspyx-0.6.1-cp312-cp312-macosx_13_0_x86_64.whl (19.3 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

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

Uploaded CPython 3.11Windows x86-64

antspyx-0.6.1-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.1-cp311-cp311-macosx_14_0_arm64.whl (16.6 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

antspyx-0.6.1-cp311-cp311-macosx_13_0_x86_64.whl (19.3 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

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

Uploaded CPython 3.10Windows x86-64

antspyx-0.6.1-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.1-cp310-cp310-macosx_14_0_arm64.whl (16.6 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

antspyx-0.6.1-cp310-cp310-macosx_13_0_x86_64.whl (19.3 MB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

antspyx-0.6.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (22.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

antspyx-0.6.1-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.1.tar.gz.

File metadata

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

File hashes

Hashes for antspyx-0.6.1.tar.gz
Algorithm Hash digest
SHA256 fd3f3a1749fb5a22b5ef3e73be17bcf2d8cf30636796abe04b1ea356d449a193
MD5 a9a9e27af6196f470155ce992dc8c2d7
BLAKE2b-256 64e672ae72bf5e217237026bd4e24b3836959982a328d9c444b26fd53997815d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: antspyx-0.6.1-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.12.8

File hashes

Hashes for antspyx-0.6.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5b788fe653eddc3c20c121c16e67ed6a695f1d507e5d48b2757b835cec64334c
MD5 baaae1924c3a277f4e6ce5ae9cec4884
BLAKE2b-256 0e3105fac5a38ff0427629dac1e2016c32e8d965ff4e18c87f1cc36df5e141ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 69523d1e3dc1c6d211adb985cc4eae4e07ccea63c0af223a03c2a8433c90f267
MD5 76addd7abd71d5532e9cb978e223f6e5
BLAKE2b-256 4ec3a17990fefcb1f85ef4c51aed091215acc59bbdab908321f7254c73ed8e82

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.1-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 660d3434019322ea5a8f98139a4ce9b9f21d57e091b4280e5bab1944afed3a6d
MD5 68c4c0fba50f4d81fac9aa54b4adc099
BLAKE2b-256 4080960ee01bf6595ecac5be45876ab571f1a10991b67cf24de582e549584ea1

See more details on using hashes here.

File details

Details for the file antspyx-0.6.1-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.1-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 b07800a31d121224fca90728e515c3d0386de3d58dbf67bd20eb0706c6cc1aae
MD5 c97fe7828f33163841c5144cda3bb7d6
BLAKE2b-256 86ce5a46f01259bcfb94a959d1d770342288d90a8646de001fd525c8b31058d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: antspyx-0.6.1-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.12.8

File hashes

Hashes for antspyx-0.6.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3188fb1ffed7049361c27cc5ea168aeeb16038f04ec214c9d303ec540285b6a1
MD5 af1bb4ec5369167bea0d3a60457cf9c5
BLAKE2b-256 3708e48d693536c86c386959d0bfb6b8b69c4ac6df36214975a558ded90e7bf2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 01f4940bff034bc01598bf498d43fa04c93d43b4e5caf6cb7a856a1b1c60a2ad
MD5 42e2d432e2f04f6f59e25ac7ad275446
BLAKE2b-256 6bad28893cf07025bee898d133f18876d9a07305ffa652cde0ae5d34394445b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.1-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e17c303c8cf0c88714188513866b7b05b765ebf51845e5516411e60f78df68ba
MD5 b1bc195ed22d9e725786d4d695a7b9ab
BLAKE2b-256 5ff74205f9f8b518447183dcef6f80259e04f758d03bf19d83cfec8b78422884

See more details on using hashes here.

File details

Details for the file antspyx-0.6.1-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.1-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 e9315a85c01cf168f10f3f2694f16158b722b6422f7dabebf1749ffbe2a3e07a
MD5 45952918c8d4b6c6ba7a35bb186a3a01
BLAKE2b-256 4be8ed6e574fd2d589756b6954ae697ef5b1b484eb2b9814f89fa48016033d80

See more details on using hashes here.

File details

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

File metadata

  • Download URL: antspyx-0.6.1-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.12.8

File hashes

Hashes for antspyx-0.6.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8e8ac4cebf82776b4fc565ed49990a18b0e89c8e04c2a61999f96bf939ee919a
MD5 e530216bfbb5864445e0787ee2dd2a9a
BLAKE2b-256 ab061e8c57b7e7634c6a20451492462db582a02df0554f9aacc26d8d0175271a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b11eaaebfed77d3504df541071ae3920fd714cd7e89dd0ad1fec9be9b8a50ae9
MD5 89f7cb5691c26de59a8110fe2591f952
BLAKE2b-256 dc73bb2e603f5a1c392d63246e185037d14284bae50a7be05483129f1607506a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 3047fe3ce32e1826ab6cd714243292171a4fecd38a4555094732d17c1bf82a8e
MD5 9693e5c9405e5d84e09582d47cd4c9d4
BLAKE2b-256 502be9a0be94062490b5535b401e00e1e1f09f9f8b8d40f1d39afefc615ee8f5

See more details on using hashes here.

File details

Details for the file antspyx-0.6.1-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.1-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 5aec52b435c943a170e5f49f59bf44fe49844186f9aa28b09bcbefff70861bf6
MD5 f42aa1cbb70753a9c31e0fba27992470
BLAKE2b-256 488026f49d0722501df97a7e00c9b11ba8f005bc7e85cf4c233e83f4e00aae42

See more details on using hashes here.

File details

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

File metadata

  • Download URL: antspyx-0.6.1-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.12.8

File hashes

Hashes for antspyx-0.6.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 70c693d9c72a87564b00d5cec79fbefac268fb130d47aab54a41591ce7756d0f
MD5 fcd84261ed47cdba77df28535c06c479
BLAKE2b-256 8de479cd20a1337d1152e4bed225d4c0bc58ea46086a64c8610f4e3e713eaf44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b453dad11146263a75ef4948c01ffe518c7e511c572afb85bb9943670563e662
MD5 ac75309d2de9f7418634a327e1df54de
BLAKE2b-256 14d89f38c2c365da2ae4bf58daf345c2a0227cee4db8112c6a4b67143c60b4ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 27c3ec8db02592a3920a4617e79932dfda5b6e6bad9cbe83494d684159379406
MD5 8b1c869f4699eb0cf330282303f029a3
BLAKE2b-256 bda877f6692007cdd88b84812748cf57357422698b8b1b18432ca2666e8bf95c

See more details on using hashes here.

File details

Details for the file antspyx-0.6.1-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for antspyx-0.6.1-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 035fefb1faae4cc0042fe04ac5a38c62be68df0fdc145a6e9c00999a5a2ab996
MD5 c04cb5ce69d3ee0636e4e57e9fd6e63b
BLAKE2b-256 681bb28e03557f56622138d02e91f6365f2d0e95d619b28b49134d4f280ab80a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 799aadf7cb21b69a4198f8a64f094d6a0f3a6d9a6fe99e0a7963abf876c06363
MD5 d25a882288bbb69470766d7ed0deb070
BLAKE2b-256 8237dc5da690218ad802e31d1b8087a843f6370f409fa2f8922064cdb974ef5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for antspyx-0.6.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 24079173d380e1fdb7af729268b5025a39695d3d66c12f1de3a1536d7230aad9
MD5 277c8c7fc5d483e8ce33ecb1bd5a81ca
BLAKE2b-256 83b2e124853ceffd559a47cff99f86d1dd7a7bf450c043092646bb4d3dbd711a

See more details on using hashes here.

Supported by

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