This repository contains a Streamlit demo of the corpus callosum parcellation method proposed in:
Santana, C., Abreu, T., Rodrigues, J., Julio, P., Appenzeller, S., Rittner, L.
DTI-based Corpus Callosum parcellation using the Tensorial Morphological Gradient (TMG) and Self-Organizing Maps (SOM).
In: 2023 19th International Symposium on Medical Information Processing and Analysis (SIPAIM).
doi: 10.1109/SIPAIM56729.2023.10373443
To access the online demo, visit:
https://tmg-cc-parcellation.streamlit.app/
The following describes the TMG in detail and provides instructions for computing it independently of the parcellation pipeline.
The TMG [ref] uses the dissimilarity between neighboring voxels to summarize the main tensorial information into a scalar map. It adapts the idea of a morphological gradient to tensorial images and was proposed to facilitate segmentation and parcellation tasks using Diffusion Tensor Imaging (DTI) data.
For each voxel
There are several dissimilarity measures proposed for DTI applications and explored through the TMG [ref]. This implementation supports the Dot Product (prod), Frobenius Norm (frob), Log-Euclidean distance (logE), and J-Divergence (Jdiv). We highlight the Frobenius Norm and the Log-Euclidean distance as the most promising metrics:
- Early TMG studies obtained the best results using the Frobenius Norm, which was attributed to its linear response to anisotropy and trace differences. Applications included segmentation of the corpus callosum, the ventricles, and the cortico-spinal tract and segmentation of thalamic nuclei.
- The Log-Euclidean distance is closely related to the Frobenius Norm but uses the logarithm of the tensors. TMG results using both metrics look very similar but differ in scale, with the Log-Euclidean distance yielding larger values and higher contrast. It was applied to the parcellation of the corpus callosum.
The Dot Product only compares the principal eigenvectors of the tensors and might be too simple for most applications. In our experience, TMG results using the J-Divergence are difficult to handle when using real data, with some voxels showing extremely high values. For more details on the metrics, check TMG Metrics Info and Examples on Synthetic Data.ipynb.
The choice of the structuring element (SE) generally depends on the information required (2D or 3D) and the size of the studied structure (smaller structuring elements tend to generate thinner, more detailed borders). This implementation provides 2-, 4-, 6-, and 8-connected SEs. Only the 6-connected SE is 3D. For 2D SEs, the desired orientation must be specified. To visualize different SE options, use TMG Neighborhood Visualization.ipynb (should be run locally and requires DIPY and FURY). Also, TMGSE.py defines the SEs and provides a simple visualization.
The TMG computation uses DTI eigenvalues and eigenvectors. They must follow the DIPY convention, in which the eigenvectors are stored columnwise (the last dimension of the array defines the eigenvector). The main TMG function, including details on its inputs, is available in TMG.py. Examples of TMG computation using synthetic data can be found in TMG Metrics Info and Examples on Synthetic Data.ipynb.