ANTsX/ANTsPy

Name: ANTsPy

Owner: Advanced Normalization Tools Ecosystem

Description: Advanced Normalization Tools in Python

Created: 2017-08-28 18:00:57.0

Updated: 2018-05-23 08:59:52.0

Pushed: 2017-11-20 17:31:15.0

Homepage: null

Size: 91139

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Advanced Normalization Tools in Python

img

Build Status Coverage Status

<img src='https://readthedocs.org/projects/antspy/badge/?version=latest' alt='Documentation Status' />

About ANTsPy

ANTsPy is a Python library which wraps the C++ biomedical image processing library ANTs, matches much of the statistical capabilities of ANTsR, and allows seamless integration with numpy, scikit-learn, and the greater Python community.

ANTsPy includes blazing-fast IO (~40% faster than nibabel for loading Nifti images and converting them to numpy arrays), registration, segmentation, statistical learning, visualization, and other useful utility functions.

ANTsPy also provides a low-barrier opportunity for users to quickly wrap their ITK (or general C++) code in Python without having to build an entire IO/plotting/wrapping code base from scratch - see C++ Wrap Guide for a succinct tutorial.

If you want to contribute to ANTsPy or simply want to learn about the package architecture and wrapping process, please read the extensive contributors guide.

If you have any questions or feature requests, feel free to open an issue or email Nick (ncullen at pennmedicine dot upenn dot edu).

Installation

We recommend that users install the latest pre-compiled binaries, which takes ~1 minute. Note that ANTsPy is not currently tested for Python 2.7 support. Copy the following command and paste it into your bash terminal:

For MacOS:

install https://github.com/ANTsX/ANTsPy/releases/download/Weekly/antspy-0.1.4-cp36-cp36m-macosx_10_7_x86_64.whl

For Linux:

install https://github.com/ANTsX/ANTsPy/releases/download/v0.1.4/antspy-0.1.4-cp36-cp36m-linux_x86_64.whl

If the above doesn't work, or you want more detailed instructions on installing ANTsPy, you can read the installation tutorial.


ITK & VTK
Insight Toolkit (ITK)

By default, ANTsPy will search for an existing ITK build by checking if the ITK_DIR environment variable is set. If that is not found, it will build it for you. It does NOT require the Python wrappings for ITK.

Visualization Toolkit (VTK)

By default, ANTsPy will search for an existing VTK build by checking if the VTK_DIR environment variable is set. If that is not found, it will build it for you. It does NOT require the Python wrappings for VTK. If you do not want VTK, then add the --novtk flag to setup (e.g. python setup.py install --novtk).

ANTsR Comparison

Here is a quick example to show the similarity with ANTsR:

ANTsR code:

ary(ANTsR)
  <- antsImageRead(getANTsRData("r16"))
  <- resampleImage(img, c(64,64), 1, 0 )
  <- getMask(img)
1 <- atropos(a=img, m='[0.2,1x1]', c='[2,0]', i='kmeans[3]', x=mask )

ANTsPy code:

rt ants
  = ants.image_read(ants.get_data("r16"))
  = ants.resample_image(img, (64,64), 1, 0 )
  = ants.get_mask(img)
1 = ants.atropos(a=img, m='[0.2,1x1]', c='[2,0]', i='kmeans[3]', x=mask )
Tutorials

We provide numerous tutorials for new users.

5 minute Overview

Nibabel Speed Comparison


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.