Basic Mixture Fitting

This process performs two steps crucial to the robustness of the EM segmentation :

Description

If the atlas used is not probabilistic (i.e. it is a volume of labels), it is first "probabilized" by creating one 3D volume for each label, which yields a binary 4D volume, and by smoothing the resulting masks (Figure 1). The smoothing kernel size theorically depends on the quality of the registration and the on the inter-individual variability. In practice, we choose it so that its full-width at half-maximum (FWHM) is 3 times the MRI voxel-size.

Figure 1. Probabilization of an anatomical atlas.

A first 4-classes mixture is fitted to the MRI histogram. Log-transformed intensities are first normalized with a translation of the histogram so that the maximum value in the image is 0. This way, pre-computed centroids values can be used to initialize the fitting process as close as possible to the true centroids. Centroids are first refined by K-means segmentation. Results from the K-means are then used to initialize the parameters (mean, variance, global proprortion) of a 4-class gaussian mixture model which is fitted by expectation-maximization (Figure 2).

Figure 2. Fitting of the naive 4-classes GMM for a T2-weighted histogram.

Using a classification of the anatomical ROIs from the atlas between "background", "csf", "grey", "white" and "grey/white" regions, probability density functions (PDFs) are derived from the mixture for each anatomical ROI. Baye's formula is then used to derive posterior class probabilities for all voxels from the PDFs and atlas-derived prior probabilities. Parameters from the full mixture are then updated with their maximum likelihood estimator.

Figure 3. Tissue type classification for the Macaque atlas anatomical regions and corresponding PDFs.

Process outputs

Mixtures are stored in a json file as a dictionary :

{
"gray":
{
"mu": -1.7823177576065063,
"alpha": 0.46657214820798842,
"sigma": 0.1165863424539566
},
"white":
{
"mu": -2.1191134452819824,
"alpha": 0.25263679791918719,
"sigma": 0.15299448370933533
},
"csf":
{
"mu": -1.171069860458374,
"alpha": 0.14711989041376747,
"sigma": 0.29822775721549988
},
"background":
{
"mu": -3.7579374313354492,
"alpha": 0.13367116345905683,
"sigma": 0.75646281242370605
}
}

Figure 4. "Eye" visualization of the 4-class mixture and the full mixture results.

Prior probabilities are stored in a 4D volume with indices in the 4 dimension corresponding to class labels. Labels should thus be consecutives and start at 0.

Figure 5. "Eye" visualization of the prior probabilities for classes "isocortex", "white matter" and "dorsal pallium".

References

Parameters

analysis: String ( optional, input )
input_mri: P:MRI Raw ( input )
Raw (non-bias corrected) MRI.
input_mask: P:Atlas Registered Skull Stripping Mask ( optional, input )
Intracranial mask used to constrain the histogram analysis.
input_bias_field: P:MRI VIP Bias Field ( optional, input )
Bias field estimated with VIP Bias correction tool.
input_atlas_labels: P:Atlas Registered Labels ( optional, input )
Atlas labels resampled in the MRI space. One of input_atlas_labels and input_atlas_prior must be provided.
input_atlas_prior: P:Atlas Registered Prior ( optional, input )
Probabilistic atlas resampled in the MRI space. One of input_atlas_labels and input_atlas_prior must be provided.
input_graywhite_hierarchy: P:Atlas Grey/White Hierarchy ( optional, input )
Hierarchy that classifies atlas regions between "background", "csf", "grey", "white" and "grey/white" regions.
contrast: OpenChoice ( optional, input )
Contrast of the input MRI (T1 or T2).
is_mapping: Boolean ( optional, input )
Set this to true if the input image is a quantitative T1 or T2 map.
labels_to_prior: Boolean ( optional, input )
Set this to true if only anatomical labels are provided and they should thus be "probabilized" (i.e. transformed into a 4D probability volume and smoothed).
smoothing_sigma: OpenChoice ( optional, input )
Standard deviation of the gaussian kernel used for probability smoothing.
smoothing_unit: Choice ( optional, input )
Unit of the standard deviation.
insure_no_zero: OpenChoice ( optional, input )

If a value is provided, insures that no prior probability is null in the entire image. Let us call this value alpha, probabilities are then given the value p' = alpha * p + (1 - alpha)/N, where N is the number of classes in the mixture. If alpha = 0, all probabilities are made equiprobable. If alpha = 1, prior probabilities are kept unchanged.

We've shown however, with a validation set acquired in MIRCen, that this modulatory parameter did not improve segmentation results. Thus, we do not advise to use it for routine processing.

robust_prior: OpenChoice ( optional, input )

If a value is provided (let us call it R), this insures that at most R classes have a non-null probability in each voxel.

If we stored probabilities in a sparse matrix, this could allow lower computational cost. However, such storage is not implemented in our processes yet. We thus do not advise the use of this option for routine processing.

write_basic_mixture: Boolean ( optional, input )
Write the 4-classes mixture. This won't be used in later steps, but it can be useful to visualize it for quality control inspection. Mixtures are stored in a JSON file.
write_complete_mixture: Boolean ( optional, input )
Write the complete mixture. This will be used by the EM segmentation process to initialize the mixture model.. Mixtures are stored in a JSON file.
write_prior: Boolean ( optional, input )
Write the prior probability map.
output_basic_mixture: P:Basic Gaussian Mixture Parameters ( output )
4-classes mixture. This won't be used in later steps, but it can be useful to visualize it for quality control inspection. Mixtures are stored in a JSON file.
output_complete_mixture: P:Complete Gaussian Mixture Parameters ( output )
Complete mixture. This will be used by the EM segmentation process to initialize the mixture model.. Mixtures are stored in a JSON file.
output_prior: P:EM Prior Proba ( optional, output )
Prior probability map.
verbose: Boolean ( optional, input )
Make the process more verbose.
visualize: Boolean ( optional, input )
Triggers automatic visualization of intermediate steps. Only use this for debugging purposes.

Technical information

Toolbox : Primatologist

User level : 0

Identifier : primate_BasicMixture

File name : brainvisa/toolboxes/primatologist/processes/blocks/primate_BasicMixture.py

Supported file formats :

input_mri :
gz compressed NIFTI-1 image, Aperio svs, BMP image, DICOM image, Directory, ECAT i image, ECAT v image, FDF image, FreesurferMGH, FreesurferMGZ, GIF image, GIS image, Hamamatsu ndpi, Hamamatsu vms, Hamamatsu vmu, JPEG image, Leica scn, MINC image, NIFTI-1 image, PBM image, PGM image, PNG image, PPM image, SPM image, Sakura svslide, TIFF image, TIFF image, TIFF(.tif) image, TIFF(.tif) image, VIDA image, Ventana bif, XBM image, XPM image, Zeiss czi, gz compressed MINC image, gz compressed NIFTI-1 image
input_mask :
gz compressed NIFTI-1 image, Aperio svs, BMP image, DICOM image, Directory, ECAT i image, ECAT v image, FDF image, FreesurferMGH, FreesurferMGZ, GIF image, GIS image, Hamamatsu ndpi, Hamamatsu vms, Hamamatsu vmu, JPEG image, Leica scn, MINC image, NIFTI-1 image, PBM image, PGM image, PNG image, PPM image, SPM image, Sakura svslide, TIFF image, TIFF image, TIFF(.tif) image, TIFF(.tif) image, VIDA image, Ventana bif, XBM image, XPM image, Zeiss czi, gz compressed MINC image, gz compressed NIFTI-1 image
input_bias_field :
gz compressed NIFTI-1 image, Aperio svs, BMP image, DICOM image, Directory, ECAT i image, ECAT v image, FDF image, FreesurferMGH, FreesurferMGZ, GIF image, GIS image, Hamamatsu ndpi, Hamamatsu vms, Hamamatsu vmu, JPEG image, Leica scn, MINC image, NIFTI-1 image, PBM image, PGM image, PNG image, PPM image, SPM image, Sakura svslide, TIFF image, TIFF image, TIFF(.tif) image, TIFF(.tif) image, VIDA image, Ventana bif, XBM image, XPM image, Zeiss czi, gz compressed MINC image, gz compressed NIFTI-1 image
input_atlas_labels :
gz compressed NIFTI-1 image, Aperio svs, BMP image, DICOM image, Directory, ECAT i image, ECAT v image, FDF image, FreesurferMGH, FreesurferMGZ, GIF image, GIS image, Hamamatsu ndpi, Hamamatsu vms, Hamamatsu vmu, JPEG image, Leica scn, MINC image, NIFTI-1 image, PBM image, PGM image, PNG image, PPM image, SPM image, Sakura svslide, TIFF image, TIFF image, TIFF(.tif) image, TIFF(.tif) image, VIDA image, Ventana bif, XBM image, XPM image, Zeiss czi, gz compressed MINC image, gz compressed NIFTI-1 image
input_atlas_prior :
gz compressed NIFTI-1 image, Aperio svs, BMP image, DICOM image, Directory, ECAT i image, ECAT v image, FDF image, FreesurferMGH, FreesurferMGZ, GIF image, GIS image, Hamamatsu ndpi, Hamamatsu vms, Hamamatsu vmu, JPEG image, Leica scn, MINC image, NIFTI-1 image, PBM image, PGM image, PNG image, PPM image, SPM image, Sakura svslide, TIFF image, TIFF image, TIFF(.tif) image, TIFF(.tif) image, VIDA image, Ventana bif, XBM image, XPM image, Zeiss czi, gz compressed MINC image, gz compressed NIFTI-1 image
input_graywhite_hierarchy :
Hierarchy, Hierarchy
output_basic_mixture :
JSON file, JSON file
output_complete_mixture :
JSON file, JSON file
output_prior :
gz compressed NIFTI-1 image, BMP image, DICOM image, Directory, ECAT i image, ECAT v image, FDF image, GIF image, GIS image, JPEG image, MINC image, NIFTI-1 image, PBM image, PGM image, PNG image, PPM image, SPM image, TIFF image, TIFF(.tif) image, VIDA image, XBM image, XPM image, gz compressed MINC image, gz compressed NIFTI-1 image