Unix/Linux |
---|
MRtrix is now available as a package on Debian and Ubuntu systems using the NeuroDebian repository. This provides a simple and effective way of installing MRtrix, along with numerous other related packages. For more information, refer to the instructions on the NeuroDebian repository. Note that there is no guarantee that the version available on this repository is the most up to date.
The rest of this page provides instructions for installing MRtrix from source. MRtrix depends on a number of other packages. Most, if not all of these packages should be available on any recent Linux distribution via the appropriate package manager. MRtrix has been written and tested on Ubuntu Linux versions 7.10 (Gutsy) through to 10.10 (Maverick). On all these distributions, all dependencies are available via the Synaptic Package Manager.
On Ubuntu systems (and most likely Debian too), the following instructions should work with no modifications:
$ sudo apt-get install g++ python libglib2.0-dev libgtk2.0-dev libglibmm-2.4-dev libgtkmm-2.4-dev libgtkglext1-dev libgsl0-dev libgl1-mesa-dev libglu1-mesa-dev
$ tar xfj mrtrix-0.2.X.tar.bz2 $ cd mrtrix-0.2.X $ ./build $ sudo ./build install
On other distributions, different steps may be required to install the required dependencies, and/or to install the compiled executables. These steps are outlined in detail below.
Before any of the programs included in the MRtrix packages can be used, they need to be compiled (i.e. translated into machine code suitable for your specific computer platform). This will generate the required executables and dynamic library. Certain packages and dependencies are needed for this step. A subset of these packages will also be required to run the executables. These packages are:
On Ubuntu, these packages can be installed using the Synaptic Package Manager, and can be found under the names 'libglib2.0-dev', 'libgtk2.0-dev', 'libglibmm-2.4-dev', 'libgtkmm-2.4-dev', 'libgtkglext1-dev', 'libgsl0-dev', 'libgl1-mesa-dev' (for a generic OpenGL implementation - the nVidia® driver already includes the required development files), and 'libglu1-mesa-dev'.
Once all dependencies are installed, MRtrix can be compiled by issuing the commands (modify as appropriate):
$ tar xjf mrtrix-0.2.X.tar.bz2 $ cd mrtrix-0.2.X/ $ ./build
If this completes with no errors, all executables should be located in the bin/ folder, and the libmrtrix-0_2_X.so dynamic library should be located in the lib/ folder.
If any errors do occur, you may need to modify the configuration file. The relevant file will be located in the sysconf/ folder, will have a *.py suffix, and will be named according to the target platform. Unfortunately a full discussion of the various options that can be modified is beyond the scope of this document.
Once all executables and the dynamic library have been successfully created, they can be made available for use. The recommended installation procedure is as follows (note that this can be tailored to your needs). The following commands will typically need to be issued from the root account. If you do not have root or administrative access to your system, you can simply install the files to a location that you have write permissions for (i.e. anywhere in your home folder), in which case the following commands can be issued from your own account.
Note: on Ubuntu and other systems without a root account, simply type sudo as the first word on the command line (see this page for details).
The simplest way to perform this step is to use the special install target (as root if the destination is not user-writable):
# ./build installBy default, this will copy the executables and dynamic library to the folder /opt/mrtrix. To ensure these are in the system path, it will also create symbolic links to them in the folders /usr/bin (for the executables) and /usr/lib (for the dynamic library). Finally , it will also create a default system-wide configuration file in /etc/mrtrix.conf, to enable multi-threading on all cores as detected by the build script.
If the files need to be installed to a different folder, a different prefix can be specified as an additional parameter:
# ./build install=/usr/local
When installing to a location that is not in the path (such as the /opt folder), the simplest way to make the executables available is to create symbolic links to the executables in a standard location such as /usr/bin or /usr/local/bin. By default, the install step will create symbolic links in the /usr/bin and /usr/lib for the executables and dynamic library respectively. This can be disabled by specifying an empty path to the linkto special target:
# ./build install linkto=A different location can also be specified by passing a suitable prefix as an additional parameter. For example:
# ./build install=/usr/local/mrtrix linkto=/usr/localwill copy the executables and dynamic library in /usr/local/mrtrix/bin and /usr/local/mrtrix/lib respectively, and then create symbolic links to these in the corresponding /usr/local/bin and /usr/local/lib folders.
In some cases, it may not be possible to install the executables (or symbolic links to them) into a location that is in the default path. This can happen for instance if installing into a user account. In these cases, the location of the executables needs to be added to the PATH environment variable, and the location of the dynamic library needs to be added to the LD_LIBRARY_PATH environment variable (alternatively, it may also be possible to add the latter to the dynamic loader's search path, although this is system-specific).
This can typically be done by adding a couple of lines to the relevant startup script. Unfortunately, each Unix variant may use a different procedure for this. For single user accounts, it should be sufficient to add these lines to the ~/.bashrc file:
PATH=/home/user/mrtrix/bin:$PATH LD_LIBRARY_PATH=/home/user/mrtrix/libFor C shell users (csh or tcsh), the following lines should be added to the ~/.cshrc:
setenv PATH /opt/mrtrix/bin:$PATH setenv LD_LIBRARY_PATH /opt/mrtrix/lib/
Once the software is up and running, is it worth taking the time to perform a few simple configurations steps. The following important application behaviours can be modified by setting the relevant variables in the configuration file (described in more detail in the Appendix). Note that if the configuration file does not exist, or if the variables are not set, default values will be used instead.
NumberOfThreads: 4with the number set appropriately for your system. Note that a default configuration file with this parameter already set to the appropriate value should already exist if the software was installed using the ./build install command (see above).
Analyse.LeftToRight: falseBy default, Analyse images are assumed to be stored left to right.
top |
---|