flair-linear
- Affine registration of FLAIR images to the MNI standard space¶
This pipeline performs a set of steps in order to affinely align FLAIR images to the MNI space using the ANTs software package [Avants et al., 2014].
These steps include:
- bias field correction using N4ITK [Tustison et al., 2010]
- affine registration to the MNI152NLin2009cSym template [Fonov et al., 2011, 2009] in MNI space with the SyN algorithm [Avants et al., 2008]
- cropping of the registered images to remove the background
Dependencies¶
If you only installed the core of Clinica, this pipeline needs the installation of ANTs on your computer.
Using ANTsPy instead of ANTs
Since clinica 0.9.0
you have the option to rely on ANTsPy
instead of ANTs to run this pipeline, which means that the installation of ANTs is not
required in this case. The ANTsPy package is installed with other Python dependencies of Clinica.
To use this options, you simply need to add the --use-antspy
option flag to the command line (see below).
Note however that this is a new and not extensively tested option such that bugs or unexpected
results are possible. Please contact the Clinica developer team if you encounter issues.
Running the pipeline¶
The pipeline can be run with the following command line:
clinica run flair-linear [OPTIONS] BIDS_DIRECTORY CAPS_DIRECTORY
where:
BIDS_DIRECTORY
is the input folder containing the dataset in a BIDS hierarchyCAPS_DIRECTORY
is the output folder containing the results in a CAPS hierarchy
with specific options :
-ui
/--uncropped_image
: By default, output images are cropped to a fixed matrix size of 169×208×179, 1 mm isotropic voxels. This allows reducing the computing power required when training deep learning models afterwards. Use this option if you do not want to get cropped images.--random_seed
: By default, results are not deterministic. Use this option if you want to obtain a deterministic output. The value you set corresponds to the random seed used by ANTs. This option requires ANTs version2.3.0
onwards and is also compatible with ANTsPy.--use-antspy
: By default, the pipeline is running with ANTs. Use this flag option if you want to use ANTsPy instead.
Optional parameters common to all pipelines
-tsv
/--subjects_sessions_tsv
This flag allows you to specify in a TSV file the participants belonging to your subset. For instance, running the FreeSurfer pipeline on T1w MRI can be done using :
clinica run t1-freesurfer BIDS_PATH OUTPUT_PATH -tsv my_subjects.tsv
participant_id session_id
sub-CLNC0001 ses-M000
sub-CLNC0001 ses-M018
sub-CLNC0002 ses-M000
Creating the TSV
To make the display clearer the rows here contain successive tabs but that should not happen in an actual TSV.
-wd
/--working_directory
By default when running a pipeline, a temporary working directory is created. This directory stores all the intermediary inputs and outputs of the different steps of the pipeline. If everything goes well, the output directory is eventually created and the working directory is deleted.
With this option, a working directory of your choice can be specified. It is very useful for the debugging process or if your pipeline crashes. Then, you can relaunch it with the exact same parameters which will allow you to continue from the last successfully executed node.
For the pipelines that generate many files, such as dwi-preprocessing
(especially if you run it on multiple subjects), a specific drive/partition with enough space can be used to store the working directory.
-np
/--n_procs
This flag allows you to exploit several cores of your machine to run pipelines in parallel, which is very useful when dealing with numerous subjects and multiple sessions.
Thanks to Nipype, even for a single subject, a pipeline can be run in parallel by exploiting the cores available to process simultaneously independent sub-parts. We recommend using your_number_of_cpu - 1
for costly pipelines such as pet-surface-longitudinal
.
If you do not specify -np
/ --n_procs
flag, Clinica will detect the number of threads to run in parallel and propose the adequate number of threads to the user.
-cn
/--caps-name
Use this option if you want to specify the name of the CAPS dataset that will be used inside the dataset_description.json
file, at the root of the CAPS folder (see CAPS Specifications for more details). This works if this CAPS dataset does not exist yet, otherwise the existing name will be kept.
Tip
Do not hesitate to type clinica run flair-linear --help
to see the full list of parameters.
Outputs¶
Results are stored in the folder subjects/<participant_id>/<session_id>/flair_linear
following the CAPS hierarchy and include the outputs:
<source_file>_space-MNI152NLin2009cSym_res-1x1x1_FLAIR.nii.gz
: FLAIR image affinely registered to theMNI152NLin2009cSym
template.<source_file>_space-MNI152NLin2009cSym_res-1x1x1_affine.mat
: affine transformation estimated with ANTs.- (optional)
<source_file>_space-MNI152NLin2009cSym_desc-Crop_res-1x1x1_FLAIR.nii.gz
: FLAIR image registered to theMNI152NLin2009cSym
template and cropped. By default this file will be present but the flag--uncropped_image
can be used to avoid computing it.
Describing this pipeline in your paper¶
Example of paragraph
These results have been obtained using the flair-linear
pipeline of Clinica
[Routier et al., 2021;
Wen et al., 2020].
More precisely, bias field correction was applied using the N4ITK method
[Tustison et al., 2010].
Next, an affine registration was performed using the SyN algorithm
[Avants et al., 2008]
from ANTs [Avants et al., 2014]
to align each image to the MNI space with the ICBM 2009c nonlinear symmetric template
[Fonov et al., 2011,
2009].
(Optional) The registered images were further cropped to remove the background
resulting in images of size 169×208×179, with 1 mm isotropic voxels.
Tip
Easily access the papers cited on this page on Zotero.
Contact us !¶
- Check for past answers on Clinica Google Group
- Start a discussion on GitHub
- Report an issue on Github