Skip to main content

Module curvature

Module curvature 

Source
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§

CurvatureResult
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