{"id":28383768,"url":"https://github.com/antsx/antspy","last_synced_at":"2025-06-25T14:30:45.586Z","repository":{"id":37431695,"uuid":"101671766","full_name":"ANTsX/ANTsPy","owner":"ANTsX","description":"A fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more.","archived":false,"fork":false,"pushed_at":"2025-06-21T15:16:41.000Z","size":95148,"stargazers_count":730,"open_issues_count":44,"forks_count":171,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-06-21T16:26:31.452Z","etag":null,"topics":["medical-imaging","neuroimaging","python"],"latest_commit_sha":null,"homepage":"https://antspyx.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ANTsX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"patreon":"antsx"}},"created_at":"2017-08-28T18:00:57.000Z","updated_at":"2025-06-21T11:33:07.000Z","dependencies_parsed_at":"2023-12-21T21:29:31.918Z","dependency_job_id":"9afae93e-f621-405c-b37a-e47a403071d1","html_url":"https://github.com/ANTsX/ANTsPy","commit_stats":{"total_commits":1281,"total_committers":23,"mean_commits":55.69565217391305,"dds":0.5909445745511319,"last_synced_commit":"4814a966f1ed20acc601eb2281a6942db0367d9f"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/ANTsX/ANTsPy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ANTsX%2FANTsPy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ANTsX%2FANTsPy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ANTsX%2FANTsPy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ANTsX%2FANTsPy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ANTsX","download_url":"https://codeload.github.com/ANTsX/ANTsPy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ANTsX%2FANTsPy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261802105,"owners_count":23211677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["medical-imaging","neuroimaging","python"],"created_at":"2025-05-30T07:15:13.938Z","updated_at":"2025-06-25T14:30:45.576Z","avatar_url":"https://github.com/ANTsX.png","language":"Python","readme":"# Advanced Normalization Tools in Python\n\n[![Coverage Status](https://coveralls.io/repos/github/ANTsX/ANTsPy/badge.svg?branch=master)](https://coveralls.io/github/ANTsX/ANTsPy?branch=master)\n\u003ca href='http://antspyx.readthedocs.io/en/latest/?badge=latest'\u003e\n\u003c/a\u003e\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/antspyx?label=pypi%20downloads)](https://pypi.org/project/antspyx/)\n[![Nightly Build](https://github.com/ANTsX/ANTsPy/actions/workflows/wheels.yml/badge.svg)](https://github.com/ANTsX/ANTsPy/actions/workflows/wheels.yml)\n[![ci-pytest](https://github.com/ANTsX/ANTsPy/actions/workflows/ci-pytest.yml/badge.svg)](https://github.com/ANTsX/ANTsPy/actions/workflows/ci-pytest.yml)\n[![ci-docker](https://github.com/ANTsX/ANTsPy/actions/workflows/ci-docker.yml/badge.svg)](https://github.com/ANTsX/ANTsPy/actions/workflows/ci-docker.yml)\n[![docs](https://readthedocs.org/projects/antspy/badge/?version=latest\u0026style=flat)](https://antspy.readthedocs.io/en/latest/)\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/antsx/antspy.svg)](https://hub.docker.com/repository/docker/antsx/antspy)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md)\n[![PubMed](https://img.shields.io/badge/ANTsX_paper-Open_Access-8DABFF?logo=pubmed)](https://pubmed.ncbi.nlm.nih.gov/33907199/)\n\nThe ANTsPy library wraps the well-established C++ biomedical image processing framework [ANTs](https://github.com/antsx/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.\n\nIf you are looking to train deep learning models on medical imaging datasets, you might be interested in [ANTsPyNet](https://github.com/ANTsX/ANTsPyNet) which provides tools for training and visualizing deep learning models.\n\n\u003cbr\u003e\n\n## Installation\n\n### Pre-compiled binaries\n\nThe easiest way to install ANTsPy is via the latest pre-compiled binaries from PyPI.\n\n```bash\npip install antspyx\n```\nOr alternatively from conda:\n\n```bash\nconda install conda-forge::antspyx\n```\n\nBecause of limited storage space, pip binaries are not available for every combination of python\nversion and platform. We also have had to delete older releases to make space. If you\ncannot find a binary you need on PyPI, you can check the\n[Releases](https://github.com/antsx/antspy/releases) page for archived binaries.\n\nSome Mac OS Python installations have compatibility issues with the pre-compiled\nbinaries. This means pip will not install binaries targeted for the current Mac OS\nversion, and will instead try to compile from source. The compatibility checks can be\ndisabled by setting the  environment variable `SYSTEM_VERSION_COMPAT=0`. More details on\nthe [wiki](https://github.com/ANTsX/ANTsPy/wiki/MacOS-wheel-compatibility-issues).\n\nWindows users will need a compatible [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#visual-studio-2015-2017-2019-and-2022) installation.\n\n\n### Building from source\n\nIn some scenarios, it can make sense to build from source. In general, you can build ANTsPy as you would any other Python package.\n\n```\ngit clone https://github.com/antsx/antspy\ncd antspy\npython -m pip install .\n```\n\nFurther details about installing ANTsPy or building it from source can be found in the\n[Installation Tutorial](https://github.com/antsx/antspy/blob/master/tutorials/Installation.md).\n\n\u003cbr\u003e\n\n## Quickstart\n\nHere 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.\n\n```python\nimport ants\n\n# read / write images\nimg = ants.image_read('path/to/image.nii.gz')\nants.image_write(img, 'path/to/image.nii.gz')\n\n# basic operations\nimg + img2\nimg - img2\nimg[:20,:20,:20] # indexing returns an image\n\n# advanced operations\nimg = ants.smooth_image(img, 2)\nimg = ants.resample_image(img, (3,3,3))\nimg.smooth_image(2).resample_image((3,3,3)) # chaining\n\n# convert to or from numpy\narr = img.numpy()\nimg2 = ants.from_numpy(arr * 2)\n\n# segmentation\nresult = ants.atropos(a=img, m='[0.2,1x1]', c='[2,0]', i='kmeans[3]', x=ants.get_mask(img))\n\n# registration\nresult = ants.registration(fixed_image, moving_image, type_of_transform = 'SyN' )\n\n# plotting\nants.plot(img, overlay = img \u003e img.mean())\n```\n\n\u003cbr\u003e\n\n## Tutorials\n\nResources for learning about ANTsPy can be found in the [tutorials](https://github.com/ANTsX/ANTsPy/tree/master/tutorials) folder. A selection of especially useful tutorials is presented below.\n\n- Basic overview [[Link](https://github.com/ANTsX/ANTsPy/blob/master/tutorials/tutorial_5min.md)]\n- Composite registrations [[Link](https://github.com/ANTsX/ANTsPy/blob/master/tutorials/concatenateRegistrations.ipynb)]\n- Multi-metric registration [[Link](https://github.com/ANTsX/ANTsPy/blob/master/tutorials/MultiMetricRegistration.ipynb)]\n- Image math operations [[Link](https://github.com/ANTsX/ANTsPy/blob/master/tutorials/iMath_help.md)]\n- Wrapping ITK code [[Link](https://github.com/ANTsX/ANTsPy/blob/master/tutorials/UsingITK.md)]\n\nMore tutorials can be found in the [ANTs](https://github.com/ANTsX/ANTs) repository.\n\n\u003cbr\u003e\n\n## Contributing\n\nIf 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](https://github.com/ANTsX/ANTsPy/blob/master/CONTRIBUTING.md) that runs through the structure of the project and how we go about wrapping ITK and ANTs code in C++.\n\nYou 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.\n\n\u003cbr\u003e\n\n## References\n\nThe main references can be found at the main [ANTs](https://github.com/ANTsX/ANTs#boilerplate-ants) repo. A Google Scholar search also reveals plenty of explanation of methods and evaluation results by [the community](https://scholar.google.com/scholar?start=0\u0026q=advanced+normalization+tools+ants+image+registration\u0026hl=en\u0026as_sdt=0,40) and by [ourselves](https://scholar.google.com/scholar?hl=en\u0026as_sdt=0%2C40\u0026q=advanced+normalization+tools+ants+image+registration+-avants+-tustison\u0026btnG=).\n","funding_links":["https://patreon.com/antsx"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantsx%2Fantspy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantsx%2Fantspy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantsx%2Fantspy/lists"}