Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Compiling from source

crousseau edited this page Jan 23, 2018 · 1 revision

Development tools

In order to build the image registration tools from scratch, a functional compiler toolchain, cmake and git are required. Prior knowledge of these tools is helpful but not strictly necessary.

GIT is a command line tool to control different versions of documents. It is mostly used to manage software development, especially if multiple people work on the same software. You will need it to download NiftyReg. On Linux, if it isn't already installed it is certainly in your distributions package manager (e.g. ''sudo aptitude install git'' on debian). On mac, it is recommended to install the XCode command line tools, which include git and a number of other extremely useful tools, such as GCC (see below). Windows users can find git at https://git-scm.com/download/win

CMAKE is a build management tool, meaning it is used to organize and simplify all the steps needed to turn source code into a executable program. Linux users should, again, either have it installed already or find it in the package manager of their distribution (e.g. ''sudo aptitude install cmake'' on debian). Mac and Windows users can find it at http://www.cmake.org/download/

C(++) compiler. This is the program that actually translates the source code into a runnable program. There are a number of options for choosing the compiler, but we recommend the Gnu Compiler Collection (GCC) which is freely available for all platforms. Linux users will almost certainly have it installed already (if not, most distributions include a sort of essential development package containing compilers and all necessary other tools. For Ubuntu or Debian, this can be installed using sudo apt-get install build-essential), mac users can install apple's XCode command line tools package to obtain it, along with git (see above) and a number of other useful tools.

NiftyReg

Used to perform the actual image registration and transformation of the segmentation from the atlas onto the individual datasets. NiftyReg's homepage is at (http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftyReg). It can be downloaded with the command

git clone git://git.code.sf.net/p/niftyreg/git niftyreg-git

which will download NiftyReg into a subfolder called niftyreg-git. To compile, first change into that folder:

cd niftyreg-git

The exact version used in the publication, is the following: 83d8d1 (commit 83d8d1182ed4c227ce4764f1fdab3b1797eecd8d on the master branch) This version is also provided in binary form in this package, but can be specifically used after the above steps by executing

git checkout 83d8d1182ed4c227ce4764f1fdab3b1797eecd8d

Next, you will need to make a new folder that will be used to build the program, change into it and start the configuration progress:

mkdir build
cd build
cmake ../

After a successful run, the cmake command will finish with a line similar to "-- Build files have been written to: /home/myusername/niftyreg-git/build" (the path at the end will vary depending on the system). Now it is time to build the actual software: run

make

This can take a few minutes depending on the speed of the computer. It will put the finished NiftyReg tools into the reg-apps subdirectory. If a global installation is needed (requires adminstrator rights), run

sudo make install

and enter your password when prompted. After building the binaries, they can also used by the aMAP graphical interface. The "Backend Settings" contains fields that allow to enter the full path to the NiftyReg binaries. If the binaries are installed globally, it is enough to provide just the name of the program (as it would be typed into a command line, e.g. ''reg_aladin'')