Expand description
Surface Curvature Calculation for QSMART
This module computes Gaussian and mean curvatures at the surface of a 3D binary mask, based on the discrete differential geometry approach.
The curvatures are used in QSMART to weight the spatially-dependent filtering near brain boundaries to reduce artifacts.
Uses 2D Delaunay triangulation (via delaunator crate) matching MATLAB’s approach:
tri = delaunay(x, y) - triangulates on x,y coordinates with z as height.
Reference: Meyer, M., Desbrun, M., Schröder, P., Barr, A.H. (2003). “Discrete Differential-Geometry Operators for Triangulated 2-Manifolds.” Visualization and Mathematics III, 35-57. https://doi.org/10.1007/978-3-662-05105-4_2
Reference implementation: https://www.mathworks.com/matlabcentral/fileexchange/61136-curvatures
Structs§
- Curvature
Result - Result of curvature calculation
- Point3D 🔒
- Simple 3D point structure
- Triangle 🔒
- Triangle structure
Functions§
- calculate_
curvature_ proximity - Calculate proximity maps using curvature at the brain surface
- calculate_
gaussian_ curvature - Simple Gaussian curvature calculation for mask boundary Returns full volume with curvature values at surface voxels
- compute_
curvatures_ 🔒from_ mesh - Compute Gaussian and mean curvatures using discrete differential geometry
- convolve_
1d_ 🔒direction_ masked - 1D convolution with Gaussian kernel along specified axis Uses replicate padding to match MATLAB’s imgaussfilt3 behavior
- create_
surface_ 🔒mask - Create a surface mask (boundary voxels)
- dilate_
mask 🔒 - Dilate a binary mask using spherical structuring element
- erode_
mask 🔒 - Erode a binary mask using spherical structuring element
- extract_
surface_ 🔒voxels - Extract surface voxels from a binary mask
- gaussian_
smooth_ 🔒3d_ masked - 3D Gaussian smoothing with anisotropic sigma
- morphological_
close - Morphological closing (dilation followed by erosion)
- triangulate_
surface 🔒 - 2D Delaunay triangulation of surface points