pub fn self_intersection_heuristic(
current_vertices: &[[f64; 3]],
original_vertices: &[[f64; 3]],
faces: &[[usize; 3]],
_voxel_size: &[f64; 3],
) -> f64Expand description
Compute self-intersection heuristic by comparing vertex distances between current and original mesh.
This is based on FSL-BET2’s self_intersection method which:
- Computes mean edge length for both meshes (ml, mlo)
- For vertex pairs that are currently close (< ml apart), checks if they’ve gotten significantly closer than they were in the original mesh
- Accumulates squared differences in normalized distances
Returns a scalar value where > 4000 indicates likely self-intersection. The threshold of 4000 matches FSL-BET2’s self_intersection_threshold.
Note: Vertices are expected to be in mm coordinates.