项目 / ANTsX/ANTsPy

ANTsX/ANTsPy

行业候选
语言 Python标签 medical-imagingneuroimagingpython数据更新 2026-11-20 06:49:16 · 仓库 2026-11-19

一段话介绍

把成熟的 C++ 生物医学影像处理框架 ANTs 封装为 Python 库,提供医学影像的快速读写,以及配准、分割、统计学习和面向发表的可视化等功能。

本站整理,非 GitHub 官方 description。

官方 description(GitHub API 原样)
A fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more.
893累计星
188Fork
—峰值日增
0上榜次数
总榜
暂未入榜
日榜
暂未入榜
周榜
暂未入榜
月榜
暂未入榜

官方快照(gh_history.db,2026-11-25):总榜 未进 Top50 · 日榜 未进 Top50 · 周榜未满 7 天基线(官方不生成) · 月榜暂无官方口径;下方四卡为站内趋势聚合(周卡按上榜次数,非官方 7 日增量窗)。

行业与场景

按行业选型 →

医学影像分析与辅助诊断

适配系统:医学影像系统、辅助诊断平台 · 得分 1.4

具备影像处理/分割识别能力,可接入 PACS 做病灶标注、初筛与报告辅助生成。

更多信息

以下三段按该项目自己的 GitHub README 章节摘录(可合理截断并标明);README 没有对应章节的留空,不编造。

特点或设计要点
可用 pip 或 conda 安装预编译包,也支持从源码编译。图像可与 NumPy 数组互转,并支持操作链式调用。若要在医学影像数据集上训练深度学习模型,官方另指向 ANTsPyNet。
星标走势还差一天的数据,明天就能看到曲线
每天 10:30 记一次星标,连续两天后自动生成曲线
首次发现 — · 最近在榜 2026-11-18 · 语言 Python · 贡献者 —
sdk

GitHub 项目主页介绍

来自 GitHub 仓库 README / 主页介绍正文,原样摘录,共 6,577 字节。

# Advanced Normalization Tools in Python

[![PyPI version](https://img.shields.io/pypi/v/antspyx)](https://pypi.org/project/antspyx/)
[![Conda downloads](https://img.shields.io/conda/d/conda-forge/antspyx)](https://anaconda.org/channels/conda-forge/packages/antspyx/overview)
[![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)
[![Coverage Status](https://coveralls.io/repos/github/ANTsX/ANTsPy/badge.svg?branch=main)](https://coveralls.io/github/ANTsX/ANTsPy?branch=main)
[![docs](https://readthedocs.org/projects/antspy/badge/?version=latest&style=flat)](https://antspy.readthedocs.io/en/latest/)
[![Docker Pulls](https://img.shields.io/docker/pulls/antsx/antspy.svg)](https://hub.docker.com/repository/docker/antsx/antspy)
![Downloads](https://img.shields.io/github/downloads/ANTsX/ANTsPy/total)
[![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/ANTsPyNet) 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
```
Or alternatively from conda:

```bash
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](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).

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


### 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/main/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/main/tutorials) folder. A selection of especially useful tutorials is presented below.

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

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/main/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=).
↑