Skip to content

Mac installation


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, open a new terminal and type the following commands:

curl -o /tmp/
bash /tmp/
Miniconda2 will ask you where to install it. Do not forget to copy the export PATH given at the end of the installation (just in case). If everything went fine, open a new terminal and type which pip, it should lead to your Miniconda2 path.

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-volume-* x x x
dwi-preprocessing-* x x
dwi-processing-* x x x
pet-volume x x* x x* x
statistics-surfstat x

*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 here and follow the instructions on the FreeSurfer wiki.
  • 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. The fastest solution is to use Homebrew: a brew tap MRtrix3/mrtrix3 followed by a brew install mrtrix3 will install MRtrix3.
  • 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.


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

git clone


To install Clinica, type the following commands:

cd clinica
pip install .

If everything went fine, type clinica: it should display a help describing the different categories of command line (see Interacting with Clinica for further explanations).

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 setup

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.

# System language setting:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

# Miniconda2 (should be added automatically):
export PATH="~/miniconda2/bin:$PATH"

# ANTs:
export ANTSPATH="/path/to/your/ANTs"

# FreeSurfer:
export FREESURFER_HOME="/Applications/freesurfer"
source ${FREESURFER_HOME}/ &> /dev/null

# FSL:
export FSLDIR="/usr/local/fsl"
export PATH="${FSLDIR}/bin":${PATH}
source ${FSLDIR}/etc/fslconf/

# Matlab (specify your version in the path):
export MATLAB_HOME="/Applications/MY_MATLAB_VERSION/bin/"
export MATLABCMD="${MATLAB_HOME}/matlab"

# MRtrix:
export MRTRIX_HOME="/path/to/your/mrtrix3"
export PATH="${MRTRIX_HOME}/bin":"${MRTRIX_HOME}/scripts":${PATH}

# SPM:
export SPM_HOME="/path/to/your/spm12"

# Dcm2nii
export PATH="/path/to/your/dcm2nii:$PATH"

# Autocomplete system:
eval "$(register-python-argcomplete clinica)"


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

autoload bashcompinit

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:


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');


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

Keeping up-to-date

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

git pull
pip uninstall clinica && pip install .