Linux installationLink

RequirementsLink

Clinica is written in Python, version 2.7, and its core mainly depends on the NiPype & Dipy frameworks. These two open-source Python projects aim to provide a uniform interface to existing neuroimaging software packages and facilitate interactions between them.

Minimal requirements:

Miniconda2 allows you to install, run, and update Python packages and their dependencies. To install it on a 64-bit Linux environment, open a new terminal and type the following commands:

wget -O /tmp/miniconda2-installer.sh https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
bash /tmp/miniconda2-installer.sh

Do not forget to restart your terminal (or open a new one) before continuing the installation process.

Pipeline-specific interfaces: Not all the following dependencies are necessary to install and run Clinica. You may want to only install the software packages used by certain pipelines of Clinica. Pipelines' specific dependencies are listed below:

ANTS CAT12 Dcm2niix Dcm2nii FreeSurfer FSL ITK Matlab MRtrix3 PETPVC SPM
convert-*-to-bids x x x
t1-freesurfer x
t1-fsl x
t1-spm-* x x x
dwi-preprocessing-* x x
dwi-processing x x x
pet-preprocessing-volume x x* x x* x
statistics-surfstat x
machine-learning-svm-*

*You only need to install ITK if you plan to perform partial volume correction using PETPVC.

Please refer to each tool’s website for installation instructions:

  • ANTS Download here and follow the instructions on the ANTs wiki.
  • CAT12 Download the latest version here and follow the instructions to ensure that your cat12 folder is located in spm/toolbox.
  • dcm2niix Download here and follow the installation instructions on the same page.
  • dcm2nii Download here.
  • FreeSurfer Download and install FreeSurfer following the instructions on the wiki. Please note that on Ubuntu you will need to install the packages tcsh and libjpeg62
    sudo apt-get install tcsh libjpeg62
    
  • FSL Download here and follow the instructions on the FSL wiki.
  • ITK Follow the instructions on the ITK blog.
  • Matlab
  • MRtrix3 Follow the instructions on the MRtrix website.
  • SPM Download the latest version here and follow the instructions on the SPM wiki.
  • PETPVC Follow the instructions here. Do not forget to compile in RELEASE mode, otherwise, partial volume correction will be very slow.

Do not forget to check the installations following each tool’s guidelines.

DownloadLink

To download Clinica in the current directory, run the following command:

git clone https://gitlab.icm-institute.org/aramislab/clinica.git

InstallationLink

To install Clinica, type the following commands:

cd clinica
pip install .

Add the --user option to install Clinica in your local space without administration privileges. Do not forget to add ~/.local/bin to your PATH variable if you do so. Just paste this line in your ~/.bashrc (or ~/.bash_profile) :

export PATH="~/.local/bin:$PATH"

Finally, you will need to type only once activate-global-python-argcomplete --user in your terminal. This command will finish the installation of the argcomplete which ables to benefit from autocompletion when running Clinica with the command line.

Environment setupLink

Edit the file ~/.bashrc (or the configuration file associated to your shell. If you are using bash, it can also be ~/.bash_profile. If you are using zsh, it must be ~/.zshrc). Your file must look like as below. Please be careful if you copy/paste this, some adjustments are needed. You must specify on the corresponding lines: the path to your ANTs installation, your version of Matlab, the path to your SPM installation, the path to your MRtrix3 installation.

Note

zsh shell users will have to add this right before the last line:

autoload bashcompinit
bashcompinit
source ~/.bash_completion.d/python-argcomplete.sh

You must also add SPM to the MATLAB path variable if you installed it as a toolbox. To do so, add the following line to your startup.m file located in your initial working folder, by default ~/Documents/MATLAB (see here for more details). If the file does not exist, you can create it and type inside:

addpath('/path/to/your/spm12');

You can also replace the previous line by the following, assuming the SPM_HOME environment variable is set in your .bashrc file.

[~, spmhome] = system('source ~/.bashrc > /dev/null; echo $SPM_HOME;');
spmhome = strsplit(spmhome,'\n');
addpath(spmhome{end-1});

Note

zsh shell users will have to replace .bashrc by .zshrc.

Keeping up-to-dateLink

To check and download Clinica updates, simply pull again the Clinica repository and re-install it.

cd <PATH_TO_YOUR_CLINICA>
git pull
pip uninstall clinica && pip install .