antspyx


Nameantspyx JSON
Version 0.5.4 PyPI version JSON
download
home_pageNone
SummaryA fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more.
upload_time2024-10-22 16:24:41
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements pandas pyyaml numpy statsmodels webcolors matplotlib Pillow
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Advanced Normalization Tools in Python

[![Coverage Status](https://coveralls.io/repos/github/ANTsX/ANTsPy/badge.svg?branch=master)](https://coveralls.io/github/ANTsX/ANTsPy?branch=master)
<a href='http://antspyx.readthedocs.io/en/latest/?badge=latest'>
</a>
[![PyPI - Downloads](https://img.shields.io/pypi/dm/antspyx?label=pypi%20downloads)](https://pypi.org/project/antspyx/)
[![Nightly Build](https://github.com/ANTsX/ANTsPy/actions/workflows/wheels.yml/badge.svg)](https://github.com/ANTsX/ANTsPy/actions/workflows/wheels.yml)
[![ci-pytest](https://github.com/ANTsX/ANTsPy/actions/workflows/ci-pytest.yml/badge.svg)](https://github.com/ANTsX/ANTsPy/actions/workflows/ci-pytest.yml)
[![ci-docker](https://github.com/ANTsX/ANTsPy/actions/workflows/ci-docker.yml/badge.svg)](https://github.com/ANTsX/ANTsPy/actions/workflows/ci-docker.yml)
[![Docker Pulls](https://img.shields.io/docker/pulls/antsx/antspy.svg)](https://hub.docker.com/repository/docker/antsx/antspy)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md)
[![PubMed](https://img.shields.io/badge/ANTsX_paper-Open_Access-8DABFF?logo=pubmed)](https://pubmed.ncbi.nlm.nih.gov/33907199/)

The 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.

If you are looking to train deep learning models on medical imaging datasets, you might be interested in [ANTsPyNet](https://github.com/antsx/antspy) which provides tools for training and visualizing deep learning models.

<br>

## Installation

### Pre-compiled binaries

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

```bash
pip install 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](https://github.com/antsx/antspy/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](https://github.com/ANTsX/ANTsPy/wiki/MacOS-wheel-compatibility-issues).


### 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](https://github.com/antsx/antspy/blob/master/tutorials/Installation.md).

<br>

## 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.

```python
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())
```

<br>

## Tutorials

Resources 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.

- Basic overview [[Link](https://github.com/ANTsX/ANTsPy/blob/master/tutorials/tutorial_5min.md)]
- Composite registrations [[Link](https://github.com/ANTsX/ANTsPy/blob/master/tutorials/concatenateRegistrations.ipynb)]
- Multi-metric registration [[Link](https://github.com/ANTsX/ANTsPy/blob/master/tutorials/concatenateRegistration/MultiMetricRegistration.ipynb)]
- Image math operations [[Link](https://github.com/ANTsX/ANTsPy/blob/master/tutorials/iMath_help.ipynb)]
- Wrapping ITK code [[Link](https://github.com/ANTsX/ANTsPy/blob/master/tutorials/UsingITK.ipynb)]

More tutorials can be found in the [ANTs](https://github.com/ANTsX/ANTs) repository.

<br>

## 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](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++.

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.

<br>

## References

The 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&q=advanced+normalization+tools+ants+image+registration&hl=en&as_sdt=0,40) and by [ourselves](https://scholar.google.com/scholar?hl=en&as_sdt=0%2C40&q=advanced+normalization+tools+ants+image+registration+-avants+-tustison&btnG=).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "antspyx",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "\"Brian B. Avants\" <stnava@gmail.com>",
    "download_url": null,
    "platform": null,
    "description": "# 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<a href='http://antspyx.readthedocs.io/en/latest/?badge=latest'>\n</a>\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[![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/antspy) which provides tools for training and visualizing deep learning models.\n\n<br>\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```\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\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<br>\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 > img.mean())\n```\n\n<br>\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/concatenateRegistration/MultiMetricRegistration.ipynb)]\n- Image math operations [[Link](https://github.com/ANTsX/ANTsPy/blob/master/tutorials/iMath_help.ipynb)]\n- Wrapping ITK code [[Link](https://github.com/ANTsX/ANTsPy/blob/master/tutorials/UsingITK.ipynb)]\n\nMore tutorials can be found in the [ANTs](https://github.com/ANTsX/ANTs) repository.\n\n<br>\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<br>\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&q=advanced+normalization+tools+ants+image+registration&hl=en&as_sdt=0,40) and by [ourselves](https://scholar.google.com/scholar?hl=en&as_sdt=0%2C40&q=advanced+normalization+tools+ants+image+registration+-avants+-tustison&btnG=).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more.",
    "version": "0.5.4",
    "project_urls": {
        "Homepage": "https://github.com/antsx/antspy"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f869eccf2743a6fe71e09792f1b1f9afc5c992680f2defcccf3b84525d1e0020",
                "md5": "fd93a9090167f96156e90cb8dc4d4660",
                "sha256": "ffdb471fcc805f4f9d689d19253ea2993c646552738cb1a8a68b8d8017e57820"
            },
            "downloads": -1,
            "filename": "antspyx-0.5.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "fd93a9090167f96156e90cb8dc4d4660",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.8",
            "size": 22202906,
            "upload_time": "2024-10-22T16:24:41",
            "upload_time_iso_8601": "2024-10-22T16:24:41.722455Z",
            "url": "https://files.pythonhosted.org/packages/f8/69/eccf2743a6fe71e09792f1b1f9afc5c992680f2defcccf3b84525d1e0020/antspyx-0.5.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7f93170f139c88c68aece49af9ea5086f3c5554cc271343cb957c6141bf54b07",
                "md5": "558892abde158e547bf55c855fd5cfe2",
                "sha256": "37235e75f7c361f96e83333f05a979e494eebf47ae69e9f9f8da924c8cc88f37"
            },
            "downloads": -1,
            "filename": "antspyx-0.5.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "558892abde158e547bf55c855fd5cfe2",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.8",
            "size": 22202119,
            "upload_time": "2024-10-22T16:24:12",
            "upload_time_iso_8601": "2024-10-22T16:24:12.300561Z",
            "url": "https://files.pythonhosted.org/packages/7f/93/170f139c88c68aece49af9ea5086f3c5554cc271343cb957c6141bf54b07/antspyx-0.5.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3ea7f6afa9ac026db460605d4db5dedce7e5e62cba38941d727a9d38d6f80378",
                "md5": "fcb367ae07d674085c7b824906946b38",
                "sha256": "b61cdc43459fc1038f9eea65d148be630fc442c0753ef6d484c0ec6d435d74de"
            },
            "downloads": -1,
            "filename": "antspyx-0.5.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "fcb367ae07d674085c7b824906946b38",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.8",
            "size": 22202222,
            "upload_time": "2024-10-22T16:25:27",
            "upload_time_iso_8601": "2024-10-22T16:25:27.572422Z",
            "url": "https://files.pythonhosted.org/packages/3e/a7/f6afa9ac026db460605d4db5dedce7e5e62cba38941d727a9d38d6f80378/antspyx-0.5.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9bc68b2f2af67f01e76b2be7a2a2cedd8dc897b74ae128f87e94a3569a2a7a9e",
                "md5": "f56d299b4eea39e2ddebc940a663998e",
                "sha256": "8499989a797ba36428b21fad916246c08e11dd0870e58ccc71c728e392598b3f"
            },
            "downloads": -1,
            "filename": "antspyx-0.5.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "f56d299b4eea39e2ddebc940a663998e",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8",
            "size": 22199524,
            "upload_time": "2024-10-22T16:25:11",
            "upload_time_iso_8601": "2024-10-22T16:25:11.727120Z",
            "url": "https://files.pythonhosted.org/packages/9b/c6/8b2f2af67f01e76b2be7a2a2cedd8dc897b74ae128f87e94a3569a2a7a9e/antspyx-0.5.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91aa8572114f6b17fc2ae1e9040774141c185dc774a520ffaaddbb5e6b3602bc",
                "md5": "112816f48c4bc30b6b08d9e4516d1991",
                "sha256": "39b830bfd33aef433f13742ea5b83244f1bd76a85fe33cd54ab953f3d13d15e0"
            },
            "downloads": -1,
            "filename": "antspyx-0.5.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "112816f48c4bc30b6b08d9e4516d1991",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.8",
            "size": 22201562,
            "upload_time": "2024-10-22T16:25:21",
            "upload_time_iso_8601": "2024-10-22T16:25:21.406324Z",
            "url": "https://files.pythonhosted.org/packages/91/aa/8572114f6b17fc2ae1e9040774141c185dc774a520ffaaddbb5e6b3602bc/antspyx-0.5.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-22 16:24:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "antsx",
    "github_project": "antspy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "pandas",
            "specs": []
        },
        {
            "name": "pyyaml",
            "specs": []
        },
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "statsmodels",
            "specs": []
        },
        {
            "name": "webcolors",
            "specs": []
        },
        {
            "name": "matplotlib",
            "specs": []
        },
        {
            "name": "Pillow",
            "specs": []
        }
    ],
    "lcname": "antspyx"
}
        
Elapsed time: 2.71266s