02. Template building

This step creates a template based on the sulcal imprints of input subjects, by computing a deformation from each subject to the template and iteratively refining the template using the registered imprints.

You probably want to use this process as part of Disco and Dartel complete pipeline or Disco pipeline instead of using it in isolation.

  1. Choose which constraints will drive the deformation (bundles are a work in progress...).
  2. Select the study directory of the experiment.
  3. The scale of deformations can be changed with the coef_sigV parameter, which may optimize the registration (details below). Detection of outlier sulci can be controlled with check_outliers and threshold_outliers. Advanced parameters are available when the userLevel is set to Expert in BrainVISA preferences.

Outputs of this step are the deformed sulcal imprints for each subject. All sulcal templates are automatically registered in the template subdirectory saved in the study_dir.

This process uses the imprint_workspace.mat file of each subject, which are output by 01. Sulcal imprints extraction. It also has other outputs, which are not shown at the level of the BrainVISA process:

DISCO_{Study}
├── figures
│   ├── Hausdorff_Mean_Distances_*.fig
│   └── Hausdorff_Mean_Distances_final.fig
├── mat
│   ├── res_suj_*_*.mat
│   ├── subject_def_*_*.mat
│   ├── template_elaboration_*.mat
│   └── template_elaboration_complete.mat
└── templates
    ├── template_visu_*_L.mesh
    ├── template_visu_*_L.mesh
    ├── template_visu_*_L.tex
    └── template_visu_*_R.tex

Parameters

anatomical_constraints: Choice ( input )
study_dir: DISCO Study Dir ( input )
left_imprint_mesh: ListOf( Sulcal Imprint Full Mesh ) ( input )
sulci_to_be_studied: Sulci To Be Studied DISCO ( input )
bundles_to_be_studied: Bundles To Be Studied DISCO ( optional, input )
left_imprint_def_mesh: ListOf( Sulcal Imprint Def Full Mesh ) ( output )
left_imprint_def_texture: ListOf( Sulcal Imprint Def Full Texture ) ( output )
right_imprint_def_mesh: ListOf( Sulcal Imprint Def Full Mesh ) ( output )
right_imprint_def_texture: ListOf( Sulcal Imprint Def Full Texture ) ( output )
couple_weight_type: Choice ( input )
Method used for assigning a weight to the different sulcal constraints. Please look at the MATLAB code to see what it does exactly.
nbMin: Integer ( input )
Number of minimizations to be performed for estimating the deformations. For example nbMin=3 will instruct the algorithm to do 3 consecutive minimizations, decreasing the size of the point matching kernels sigmaW and sigmaI after each of them.
coefK: Float ( input )
Adjustment factor for the automatic computation of the Fast Gauss Transform precision coefficient K.
coef_sigV: Float ( input )
coef_sigV is the kernel size which defines the scale of deformation, in millimetres. In other words, the deformation kernel is a function of the Euclidean distance between two points divided by coef_sigV.
check_outliers: Boolean ( input )
If enabled, outlier imprints will be detected and excluded from the data before the template is created. Outlier detection and exclusion is done at the level of each imprint for each subject.
threshold_outliers: Float ( input )
Threshold used for outlier detection: each imprint that has a higher Z-score will be excluded. Outlier detection and exclusion is done at the level of each imprint for each subject.

Technical information

Toolbox : Disco

User level : 0

Identifier : buildTemplate

File name : brainvisa/toolboxes/disco/processes/DISCO_components/buildTemplate.py

Supported file formats :

study_dir :
Directory, Directory
left_imprint_mesh :
MESH mesh, MESH mesh
sulci_to_be_studied :
Text file, Text file
bundles_to_be_studied :
Text file, Text file
left_imprint_def_mesh :
MESH mesh, MESH mesh
left_imprint_def_texture :
Texture, Texture
right_imprint_def_mesh :
MESH mesh, MESH mesh
right_imprint_def_texture :
Texture, Texture