Third-party software¶
Environment variables set-up¶
As you will see on this page, environment variables are often needed in order to configure some third-party software installations.
-
Run the provided
exportandsourcecommands in your terminal. Environment variables will be defined only for the duration of your session, and will be lost if you re-launch your terminal.Learn how to set environment variables
export var_name = value: defines an environment variable as value and makes it accessible to other processes started from the terminal.source file: used to read/execute a file, for example one where configurations are set
-
In order to define these variables permanently, you need to manually edit the configuration file associated to your shell.
If you are using
bash, it can be~/.bashrcor~/.bash_profile, if you are usingzsh, it should be~/.zshrc.
Provided command lines should be adapted
Please do not copy/paste the provided commands without adapting them to your system and without testing them. Most paths provided here require to be adapted to your system and depend on how you installed the software.
A good approach is to verify that the different paths you want to assign to a variable exist first :
→ If they do, then try running the export and source (step 1. above) commands in your terminal. Verify that the software or the pipeline you want runs as expected.
→ If this works, then consider modifying your shell configuration file (step 2. above) to have these variables automatically defined on every session.
Converters¶
Some converters require dcm2niix to transform DICOM files into NIfTI :
DCM2NIX¶
Version required
Clinica requires dcm2niix version 1.0.20230411 or later.
Please check the installation instructions for all platforms on dcm2niix Git repository.
Pipelines¶
Some, but not all pipelines use specific third-party software. Depending on your usage of Clinica, you will need to install additional packages. Specific dependencies are described in the table below (1) :
- If not listed, the pipeline does not require any additional dependency outside Clinica.
Clinica available pipelines
-
Anatomical MRI
t1-linear- Linear processing of T1w MR images: affine registration to the MNI standard space of T1 imagesflair-linear- Linear processing of FLAIR images: affine registration to the MNI standard space of FLAIR imagest1-volume- Processing of T1w MR images using SPM: tissue segmentation and spatial normalizationt1-freesurfer- Processing of T1w MR images using FreeSurfer: cortical surface, subcortical structures and volumetricst1-freesurfer-longitudinal- Longitudinal processing of T1w MR images using FreeSurfer: cortical surface, subcortical structures and volumetrics
-
Diffusion MRI (DWI)
dwi-preprocessing-*- DWI pre-processing: correction of head motion, magnetic susceptibility, eddy current and bias field induced distortionsdwi-dti- DTI scalar maps (FA, MD, AD, RD) and spatial normalization: extraction of DTI-based measures (FA, MD, AD, RD)dwi-connectome- Construction of structural connectome: computation of fiber orientation distributions, tractogram and connectome
-
PET
- Introduction to concepts used in the PET pipelines: partial volume correction and standardized uptake value ratio (SUVR) map computation
pet-linear- Linear processing of PET images: affine registration to the MNI standard space and intensity normalizationpet-volume- Volume-based processing of PET images: registration to T1w MRI, intensity normalization, partial volume correction and spatial normalizationpet-surface- Surface-based processing of PET images: projection of the PET signal onto the subject’s cortical surfacepet-surface-longitudinal- Surface-based longitudinal processing of PET images: projection of the PET signal onto the subject’s cortical surface
-
Statistics
statistics-surface- Surface-based mass-univariate analysis with SurfStatstatistics-volume- Volume-based mass-univariate analysis with SPM
-
Machine Learning
machinelearning-prepare-spatial-svm- Prepare input data for spatially regularized SVMmachinelearning-classification- Classification based on machine learning
-
Deep learning
- You can use the ClinicaDL framework for the reproducible processing of neuroimaging data with deep learning methods.
| ANTs | Convert3D | FreeSurfer | FSL | ITK | MRtrix3 | PETPVC | SPM | |
|---|---|---|---|---|---|---|---|---|
| Anat > Linear | ✓∘ | |||||||
| Anat > Volume | ✓ | |||||||
| Anat > FreeSurfer | ✓ | |||||||
| DWI > Preprocessing | ✓ | ✓ | ✓ | ✓ | ||||
| DWI > DTI | ✓ | ✓ | ✓ | |||||
| DWI > Connectome | ✓ | ✓ | ✓ | |||||
| PET > Linear | ✓ | |||||||
| PET > Surface | ✓ | ✓ | ✓⟡ | ✓⟡ | ✓ | |||
| PET > Volume | ✓⟡ | ✓⟡ | ✓ | |||||
| Stats > Surface | ✓ | |||||||
| Stats > Volume | ✓ |
- ✓∘ : for anatomical linear pipelines there is also the possibility to use ANTsPy instead of ANTs since Clinica
v0.9.0 - ✓⟡ : you only need to install ITK if you plan to perform partial volume correction using PETPVC.
CAT12 toolbox and Clinica < v0.3.7
Starting from Clinica v0.3.7, the CAT12 toolbox is no longer needed for the t1-volume and pet-volume pipelines.
For previous versions of Clinica, you will need to download the latest version of the toolbox here and follow the instructions to ensure that your cat12 folder is located in your spm/toolbox folder.
Depending on the architecture and OS of your system, setup of third party libraries can change. Please refer to each tool’s website for installation instructions :
ANTs¶
To install ANTs, download it from ANTs release list and follow the instructions on ANTs wiki.
We strongly recommend installing ANTs >= 2.5.0 from which no environment variable are needed.
Nonetheless, if you are using an older version of ANTs, make sure to have the following environment variables defined:
export ANTSPATH="/path/to/your/ANTs/"
export PATH=${ANTSPATH}:${PATH}
Convert3D¶
You can find more details about Convert3D on their website. There are
two options to install it :
FreeSurfer¶
You can find more details about FreeSurfer on their website. To install it :
Make sure to have the following environment variables defined:
export FREESURFER_HOME="/Applications/freesurfer"
source ${FREESURFER_HOME}/SetUpFreeSurfer.sh &> /dev/null
FSL¶
We recommend installing FSL 6.0.
ITK¶
You can find more details about ITK on their website. To install it :
MRtrix3¶
You can find more details about MRtrix3 on their website, including
official instructions for downloading.
You have basically two options:
Tip
Note that using the conda package should be easier in most cases.
- Use the official conda package.
- Use the MacOS pre-compiled application package installer.
- Use the Homebrew formula (although large dependencies such as
XCodeandQt5are required).
PETPVC¶
You can find more details about PETPVC on their website,
including official instructions for downloading on their Github.
You have basically three options:
- Use pre-built binaries, available here.
- Use the official conda package.
- Build from source.
Tip
If building from source, do not forget to compile in RELEASE mode, otherwise, partial volume correction will be very slow.
SPM Standalone¶
Set-up MATLAB + SPM
Clinica now only supports SPM standalone, which functions without MATLAB.
To use SPM standalone, you will need to install two things:
- The Matlab Runtime (often abbreviated into MCR), for which no license is required.
- The SPM standalone itself.
Verify your environment variables
If you followed the installation instructions, you should have set the environment variable $LD_LIBRARY_PATH on Linux, or $DYLD_LIBRARY_PATH on MacOS.
In addition, you need to define the following environment variables:
export MCR_HOME="/path/to/your/MCR/"
export SPMSTANDALONE_HOME="/path/to/your/spmstandalone/home/"
What are these paths ?
SPMSTANDALONE_HOMEshould indicate the directory containing therun_spmxx.shfile.MCR_HOMEshould indicate the directory containing thebin,runtime... folders
Autocompletion (optional)¶
eval "$(register-python-argcomplete clinica)"
Autocompletion for zsh shell users
zsh shell users will have to add this right before the last line of their configuration file to enable autocompletion in Clinica:
autoload bashcompinit
bashcompinit
source ~/.bash_completion.d/python-argcomplete.sh
Contact us !¶
- Check for past answers on Clinica Google Group
- Start a discussion on GitHub
- Report an issue on Github