ANTS
====

We are tracking ANTS from the `Neurodebian`_ repository. To use ANTS add the
installation directory to your environment. This can be conveniently done with
environment modules:


.. code-block:: bash

   module load ants

There are currently 2 versions of ANTS:

+ 2.1.0 from neurodebian.org
+ 2.1.0-mpib0 with some minor patches in Scripts/ for Torque PBS

Afterwards all ants* related programs are in your PATH and ready to use. There
is no implicit job parallelism afaik except for some scripts like ``buildtemplateparallel.sh``.

To use this add the options ``-c 4 -q default`` to the command line:

.. code-block:: bash

   module load ants
   buildtemplateparallel.sh -d 3 -t GR -c 4 -q default -o ANTS T1*nii

Hint: add an optional ``&`` at the end of the line to run the script in the background.


.. note::

   Some scripts require ``-Q default`` instead of ``-q default``. Check the help page to get the correct parameter.



All other programs need to be wrapped into a job file to be run on the cluster nodes:


.. code-block:: bash

   qsub -N ants -l walltime=100:0:0,mem=16gb complex-ants-pipeline.sh


The file ``complex-ants-pipeline.sh`` contains your ANTS commands *preceeded*
by a ``module load ants``. The **walltime** and **memory requirements** given
above are just an example, tune them to your needs.


ANTSr
-----

Hint: If you are more familiar with GNU-R, you might want to checkout some
R-bindings for ANTS: `ANTSr`_.  To install, run this inside your R-session:


.. code-block:: r

   install.packages("drat", repos="http://ftp5.gwdg.de/pub/misc/cran/")
   drat::addRepo("ANTs-R")
   install.packages("ANTsR", repos="http://ftp5.gwdg.de/pub/misc/cran/")

.. _Neurodebian : http://neuro.debian.net/
.. _ANTSr: https://github.com/ANTsX/ANTsR
