sp.similarity.from.mesh: Distance-based spatial similarity metrics calculated from the...

sp.similarity.from.meshR Documentation

Distance-based spatial similarity metrics calculated from the mesh. \loadmathjax

Description

The sp.similarity.from.mesh function computes Hausdorff distances and surface Dice similarity coefficient.

Usage

sp.similarity.from.mesh(
  mesh1,
  mesh2,
  hausdorff.coeff = c("HD.max", "HD.mean"),
  hausdorff.quantile = c(0.5, 0.95),
  surface.tol = seq(0, 10, 1)
)

Arguments

mesh1, mesh2

espadon mesh class objects

hausdorff.coeff

Vector indicating the requested Hausdorff distance metrics from among 'HD.max','HD.mean'. Equal to NULL if not requested. NULL, it will be added.

hausdorff.quantile

numeric vector of probabilities with values between 0 and 1, representing the quantiles of the unsigned distances between mesh1 and mesh2. Equal to NULL if not requested.

surface.tol

numeric vector representing the maximum margins of deviation which may be tolerated without penalty. Equal to NULL if not requested.

Value

Returns a list containing (if requested):

  • Hausdorff : dataframe including the maximum, mean and quantiles

  • smetrics : dataframe with the columns:

    • tol : the requested tolerances

    • sDSC : the surface Dice similarity coefficients,defined by Nikolov et al [1]

    • sAPL : the surface Added Path Length in \mjeqnmm^2ascii, introduced (in pixels) by Vaassen et al [2]

References

[1] \insertRefNikolov2018DeepLTespadon

[2] \insertRefVaassen2020Evalespadon

See Also

sp.similarity.from.bin

Examples

library (Rvcg)
# espadon mesh of two spheres of radius R1=10 and R2=11, separated by dR = 3
sph <- vcgSphere ()
mesh1 <- obj.create ("mesh")
mesh1$nb.faces <- ncol (sph$it)
mesh1$mesh <- sph
mesh2 <-  mesh1

R1 <- 10
R2 <- 11
dR <- 3
mesh1$mesh$vb[1:3,] <- R1 * mesh1$mesh$normals[1:3,] + mesh1$mesh$vb[1:3,]
mesh2$mesh$vb[1:3,] <- R2 * mesh2$mesh$normals[1:3,] + mesh2$mesh$vb[1:3,] +
                 matrix (c (dR, 0, 0), ncol = ncol (mesh2$mesh$vb), nrow = 3)
             
sp.similarity.from.mesh (mesh1 , mesh2, 
                         hausdorff.quantile = seq (0, 1, 0.05),
                         surface.tol = seq (0, dR + abs(R2-R1), 0.5))

espadon documentation built on April 11, 2025, 5:57 p.m.