Install Advanced Normalization Tools

Get the latest ANTs code

Download the latest code into an arbitrary directory, I use ~/code:

mkdir ~/code 
cd ~/code
git clone https://github.com/ANTsX/ANTs.git

You will also need to install the ZLIB libraries:

sudo apt-get install zlib1g-dev

Run CMake/Make

I install my applications in ~/Applications, however the following will install ANTs in ~/bin:

mkdir -p ~/bin/ants
cd ~/bin/ants
ccmake ~/code/ANTs

Hit ‘c’ to do an initial configuration. CMake will do some checking and then present options for review. Hit ‘c’ again to do another round of configuration. If there are no errors, you’re ready to generate the make files by pressing ‘g’.

Now you are back at the command line, it’s time to compile:

make

This compiles in the most resource-efficient manner. To save time, you can use multiple threads, for example:

make -j 2

Post-install Configuration

If you want to use ANTs scripts, copy them from the source directory Scripts/ to the bin directory where antsRegistration etc are located:

cp -r ~/bin/ants/Scripts/* ~/bin/ants/bin/

Assuming you’ve built in ~/bin/ants, there will now be a binary directory ~/bin/ants/bin, containing the programs (and scripts if you’ve included them). The scripts additionally require ANTSPATH to point to the bin directory including a trailing slash.

You will need to edit your .bashrc or .profile file by adding the following lines:

export ANTSPATH=${HOME}/bin/ants/bin
export PATH=${ANTSPATH}:$PATH

Now check this worked correctly:

which antsRegistration
Next
Previous

Related