R C++ Other
Clone or download
Latest commit 146f6c9 Jul 20, 2018


ANTsR Instagram


Travis Build Status

DOI 10.17605/osf.io/bsq5v

muschellij2 badges: Travis Build Status Coverage Status AppVeyor Build Status

A package providing ANTs features in R as well as imaging-specific data representations, spatially regularized dimensionality reduction and segmentation tools. See also the Neuroconductor site.


License: Apache License 2.0

Maintainer: Brian B. Avants

URL: homepage

BugReports: github issues

NeedsCompilation: yes

Travis checks: ANTsR results

Documentation: https://antsx.github.io/ANTsR/.

Preview ANTsR on the cloud

Here: https://rstudio.cloud/project/38492

Then try:


To learn more, open and run the Rmd files in the directory "/cloud/project/RL/ANTsR/doc"

Note: as of this writing, memory is very limited on this cloud preview so some examples may not run successfully.


Reference manual: ANTsR


Wiki: Notes and work in progress examples

Package source: from github

Binaries: here

Windows installation option here

Install the binary, after downloading, via command line:


Research using ANTsR

Installation from source

Please read this entire section before choosing which method you prefer.

In general, these assume you have git installed / accessible in your environment, as well as a compiler, preferably clang. you may also need cmake if you do/can not install cmaker.

Windows users should see Rtools and maybe, also, installr for assistance in setting up their environment for building (must have a compiler too). To my knowledge, there are no recorded instances of ANTsR being installed on Windows. If someone does so, we would like to know.

You will need to install R packages that ANTsR requires. Minimally: Install ITKR and ANTsRCore here and here then do:

mydeps <- c( "Rcpp", "RcppEigen", "magrittr", "rsvd", "magic", "psych" )
install.packages( pkgs = mydeps, dependencies = TRUE )

You can gain additional functionality by installing packages that are listed in the DESCRIPTION file under Suggests. A complete list of recommended ancillary packages here.

Method 1: with devtools in R

library( devtools )
# install_github("stnava/cmaker") # if you do not have cmake

Method 2: from command line (most traditional method)

Assumes git, cmake and compilers are available in your environment (as above).

First, clone the repository:

$ git clone https://github.com/stnava/ITKR.git
$ git clone https://github.com/ANTsX/ANTsRCore.git
$ git clone https://github.com/ANTsX/ANTsR.git

Install the package as follows:


The travis.yml file also shows a way to install from Linux command line.

Method 3: from binaries

Note that version numbers will change over time.

wget https://github.com/stnava/ITKR/releases/download/latest/ITKR_0.4.12_R_x86_64-pc-linux-gnu.tar.gz
R CMD INSTALL ITKR_0.4.12_R_x86_64-pc-linux-gnu.tar.gz
wget https://github.com/ANTsX/ANTsRCore/releases/download/v0.4.2.1/ANTsRCore_0.4.2.1_R_x86_64-pc-linux-gnu.tar.gz
R CMD INSTALL ANTsRCore_0.4.2.1_R_x86_64-pc-linux-gnu.tar.gz
wget https://github.com/ANTsX/ANTsR/releases/download/latest/ANTsR_0.6_R_x86_64-pc-linux-gnu.tar.gz
R CMD INSTALL ANTsR_0.6_R_x86_64-pc-linux-gnu.tar.gz

Method 4: platform independent via docker and kitematic

This is a beta operation that is in flux but may be convenient for some users.

  • based on this approach

  • create a docker username

  • download and install kitematic

  • login to kitematic with your docker username

  • search for antsr in the kitematic repository search bar

  • create a new container from the stnava version of antsr

  • start the container

  • type the "access url" address into a browser to run rstudio with antsr. it should be something like

  • you can also add your home folders to the container instance by adjusting the "volumes" option under the settings tab. then you can access local data.


Load the package:


List the available functions in the namespace ANTsR:


Call help on a function via ?functionName or see function arguments via args(functionName)

Tagging a beta release

git tag -d beta
git push origin :refs/tags/beta
git tag beta
git push  --tags origin

Release notes

More like development highlights, as opposed to release notes. See git log for the complete history. We try to follow these versioning recommendations for R packages. Under these guidelines, only major.minor is an official release.


  • ENH: better compilation and release style.
  • ENH: return boolean same size as image
  • ENH: improved decomposition methods
  • ENH: easier to use antsrSurf and antsrVol


  • ENH: spare distance matrix, multi scale svd


  • ENH: added domainImg option to plot.antsImage which can standardize plot.

  • COMP: test for DVCL define requirement to improve clang and gcc compilations

  • WIP: transform objects can be created on the fly and manipulated thanks to jeff duda

  • ENH: automation for eigenanatomy

  • ENH: reworked SCCAN and eanat

  • ENH: mrvnrfs

  • ENH: resting state Vignette

  • DOC: clarify/extend antsApplyTransforms

  • ENH: multidimensional images

  • STYLE: iMath not ImageMath in ANTsR


  • WIP: iMath improvements

  • WIP: ASL pipeline fuctionality

  • BUG: Fixed image indexing bug

  • BUG: plot.antsImage improvements

  • ENH: more antsRegistration options

  • ENH: geoSeg

  • ENH: JointLabelFusion and JointIntensityFusion

  • ENH: Enable negating images

  • ENH: weingarten curvature

  • ENH: antsApplyTransformsToPoints with example

  • ENH: renormalizeProbabilityImages

  • ENH: Suppress output from imageWrite.


First official release.