Skip to content

Installation

You will find below the steps for installing Clinica on Linux or Mac. Please do not hesitate to contact us on the forum if you encounter any issues with the installation of Clinica.

Quick start

Installation of Clinica

You will need a Python environment to run Clinica. To do that, we advice you to download Miniconda allows you to install, run, and update Python packages and their dependencies. To install Miniconda, open a new terminal and type the following commands:

  • If you are on Linux:

    curl https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o /tmp/miniconda-installer.sh
    bash /tmp/miniconda-installer.sh
    

  • If you are on Mac:

    curl https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o /tmp/miniconda-installer.sh
    bash /tmp/miniconda-installer.sh
    

Miniconda 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 conda info, it will verify if Conda is installed, check the version and show your Miniconda path.

Depending on the pipeline that you want to use, you need to install Pipeline-specific interfaces. Not all the dependencies are necessary to Clinica. Please refer to this section to determine which third-party libraries you need to install.

Clinica can be installed using the Conda package manager. If you want to try the last release of Clinica you can install it by typing the following command in your command line session:

conda create --name clinicaEnv python=2.7 clinica -c Aramislab -c conda-forge
It will download all the needed packages and create the Clinica environment.

Info

This command will create an environment called clinicaEnv. Clinica is already installed inside it. The option -c Aramislab tells Conda to search the package on the Aramis conda channel.

Running the Clinica environment

Activation of the Clinica environment

Now that we have created the Clinica environment, you can finally activate it:

source activate clinicaEnv
activate-global-python-argcomplete --user

Success

Congratulations, you have installed Clinica! At this point, you can try the basic clinica command and get the help screen:

(clinicaEnv)$ clinica
usage: clinica [-v] [-l file.log]  ...

clinica expects one of the following keywords:

    run                 To run pipelines on BIDS/CAPS datasets.
    convert             To convert unorganized datasets into a BIDS hierarchy.
    iotools             Tools to handle BIDS/CAPS datasets.
    generate            To generate pre-filled files when creating new
                        pipelines (for developers).

Optional arguments:
  -v, --verbose         Verbose: print all messages to the console
  -l file.log, --logname file.log
                        Define the log file name (default: clinica.log)

If you have successfully installed the third-party software, you are ready to run any of the pipelines proposed by Clinica.

It should display a help describing the different categories of command line (see Interacting with Clinica for further explanations).

Deactivation of the Clinica environment

At the end of your session, remember to deactivate your Conda environment:

source deactivate

Developer installation

If you plan to contribute to Clinica or you want to have the current development version, you can either:

  • Download the tarball for a specific version from our repository. Then decompress it.
  • Clone our GitLab repository git clone https://gitlab.icm-institute.org/aramislab/clinica.git.

Then, we suggest to create a custom Conda environment and install Clinica using the YAML file to guarantee the dependencies:

cd clinica
conda env create -f environment.yml

By default, the environment name is clinica_env but you can choose a different name by adding the option --name my_environment.

Once the environment is created, Clinica can be installed inside. Remember to activate the environment before proceeding

source activate clinica_env
pip install -e .
activate-global-python-argcomplete --user

If everything goes well, type clinica and you should the help message which is displayed above.

At the end of your session, you can deactivate your Conda environment:

source deactivate

Remember that Clinica will be only available inside of your Conda environment.