# Installing MRtrix3, BrainSuite and ANTs

Here I will account on how to install the rest of the software introduced in the last entry.

I’ve never used the following to analyse but to overcome shortcomings on my own dataset. I’ve served MRtrix3 for denoising diffusion-weighted images (DWI), BrainSuite to get rid of the so-called EPI distortions, and ANTs to denoise T1-weighted images and improve registration. These and other features will be covered in the future.

• MRtrix3

First, you need to install the dependencies.

sudo apt-get install git g++ python python-numpy libeigen3-dev zlib1g-dev libqt4-
opengl-dev libgl1-mesa-dev libfftw3-dev libtiff5-dev

Second, clone MRtrix3 from the repository by typing

git clone https://github.com/MRtrix3/mrtrix3.git

Third, configure MRtrix3 and install it.

cd mrtrix3
./configure

Build the binaries with ./build, go to the top of the MRtrix3 directory, and set the path typing ./set_path

Now close the Terminal and re-open it.

Test the installation type mrview to open the open the visual display, and then dwidenoise to see whether your Terminal recognises the command or not.

• BrainSuite

sudo tar xvfz BrainSuite18.linux.tgz -C /opt/

Now, download the MATLAB Compiler Runtime 2015b. Don’t worry, this file is FREE and does not require a MATLAB license.

Extra. If you need to update libraries and repositories, type:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.8

Testing the installation. Unlike the rest of the software, if you want to either start the GUI or a command from BrainSuite, you will need to specify the path to these executables. For instance:

/opt/BrainSuite18a/bdp/bdp.sh #to run the bdp script to preprocess DWI data
/opt/BrainSuite18a/bin/BrainSuite16a1 #to start the GUI

NOTE: If when running the GUI an error emerged then you would probably need to modify the path to the Matlab Runtime Compiler 2015b (or MCR2015b) in the bdp.sh file, which is inside the “bdp” folder in the BrainSuite directory.

• ANTs

The installation of ANTs is really quick. It will require git, c++ and cmake (or ccmake, sudo apt-get install cmake-curses-gui), though.

git clone git://github.com/stnava/ANTs.git

Second, create a folder for the binaries mkdir antsbin and go inside of it with cd antsbin

Third, compile the binaries ccmake ../ANTs. If asked, type “c” and “g”.

Fourth, install with make -j 4.

Fifth, copy the content of the folder “ANTs/Scripts” in “antsbin/bin/”.

Now open your bash profile gedit ~/.bashrc and paste the following:

export ANTSPATH=/users/<youruser>/antsbin/bin/ #replace <youruser> by your user name.
export PATH=${ANTSPATH}:$PATH

Test the installation. Call ANTs from the terminal to check everything is OK (i.e., type ANTs -h)