This repository tries to serve as a guide and back-up of project code, potentially to be used for publication.
The software is not perfect and may need substantial reworking before they are worth applying to real data in any research project. Issues include, but are not limited to:
- Inclusion of high intensity drainage vessels or noise in the outer part of the brain. [Skullstrip and Segmentation issue.]
- Varying intensities across an image, or just different brain vasculatures imply varying degree of the vasculature that is segmented. And these varyingly segmented vasculatures are therefore not bijective to the tortuosity metrics, due to inhrently "random" biological structures, but also due to deterministic (and random if included) segmentation software choices. [Bias Field and Segmentation issue.]
- Both of the previous issues may manifest themselves together in the form of increased tortuosity metrics if many sufficiently small false links are found.
- Removing noise is not a trivial task, because too much filtering of the noise may remove the visibility of small arteries. This is also undesired.
- Remarks about the tortuosity metrics found in Bullitt (2003) [https://doi.org/10.1109/TMI.2003.816964] and Johnson (2007) [https://doi.org/10.1016/j.medengphy.2006.07.008] appear to contradict some of the actual properties they have when calculated and verified in our examples, furthering the list of issues. This is especially true for the SOAM which we have verified two different ways for sine curves.
- Degeneracy of the tortuosity metrics are also present when the Frequency of the sines and helices are in the range [0 < F < 1]. It should be mentioned that we cannot have any amplitude less than 1 due to a discrete resolution of voxels. And the figures included all plot at the range A > 3 and F > 1, with a unitary increase per increment.
The software was created with the intent to try to segment out the "central" vascularity surrounding the Circle of Willis. This is done using each image's own intensity distribution for their own segmentation. The proof of concept was seen discussed in Kollmannsberger (2017) [https://doi.org/10.1088/1367-2630/aa764b] and the foundation of our software builds on his code as well [https://github.com/phi-max/skel2graph3d-matlab].
Our implementation is sought verified using different approaches the derivative used in the definition of curvature (in addition to SOAM and SOTM), with numeric integration approach based on the analytic solution [https://www.math24.net/curvature-radius/ & https://doi.org/10.1016/j.medengphy.2006.07.008] and by using finite difference (FD) [https://en.wikipedia.org/wiki/Finite_difference]. These special approaches (at least as implemented) work well for synthetic data, but not in more naturally occurring vessel segments.
As the method is intensity based, we at least recommend:
- Skullstripping. (A clean one, or else other parts of the brain with higher intensity may obscure the intensity distribution.)
- Bias Field Correction. (Helps to find more of the vasculature.)
- alpha_graphing_protocol.m - Is the file that segments the cerebrovacularity. Less than preferably optimal.
- do_helix.m - Allows the user to draw a helix with corresponding DM, SOAM, SOTM, etc.
- do_sine.m - Allows the user to draw a helix with corresponding DM, SOAM, SOTM, etc.
- graph_debugging.m - 3D plotting of the graphed artery/vessel/vasculature to aid debugging implementation mistakes and sampling errors.
- helix_curvature.m - Finite difference approach of curvature, requiring parametrization along Z axis.
- sine_curvature.m - Finite difference approach of curvature, requiring only that the curve is in 2D.
- integral_curvature_sine.m - Numerical integration of the analytical solution for curvature; only for sine.
- measure_DM.m - Calculates the Distance Metric (DM), for a curve in 3D space. It also returns the arc length of a curve.
- measure_SOAM.m - Calculates the Sum of Angles Metric (SOAM), for a curve in 3D space.
- measure_SOTM.m - Calculates the Sum of Torsion Metric (SOTM), for a curve in 3D space.
- tortuosity_wrapper.m - A wrapper to calculate tortuosity measurements based on the graphs created by the graphing protocol.
- viz_helix_space_wrapper.m - A script that produces the example images under "/helix/*.jpg".
- viz_sine_space_wrapper.m - A script that produces the example images under "/sine/*.jpg".
- safeAcos.m - A safe arccosine to correct possible errors.
All "measure_*.m" files has an option to do independent smoothing per axis. Through trial and error, we found that DM was made more inaccurate, but it improved the accuracy of both SOAM and SOTM.
- The software that creates the graphs from skeletons can be found at https://github.com/phi-max/skel2graph3d-matlab.
- Matlab2018a (or a newer version).
- Either your own 3D images or the synthetic arteries created by the "viz_space_wrapper.m" files for multiple sines or helices or "do.m" files for a single sine or helix. Just change the parameters in the code as seen appropriate.
- As with Matlab software solely consisting of ".m" files you just dump it in a path where Matlab checks for ".m" scripts. See "pathdef.m".
(Images from FSLeyes' 3D Viewer https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FSLeyes)