landmark_check: Check landmarks are close to the mesh

View source: R/BoneDensityFunctions.R

landmark_checkR Documentation

Check landmarks are close to the mesh

Description

Check landmarks are close to the mesh

Usage

landmark_check(surface_mesh, landmarks, threshold = 1)

Arguments

surface_mesh

mesh object

landmarks

Dataframe. Columns are landmark name, x, y, and z coords

threshold

Numeric. Distance landmark can be from surface without warning being thrown

Value

String. Returns a message warning that landmarks are not on bone surface

Author(s)

Scott Telfer scott.telfer@gmail.com

Examples


  # Download bone model
  url <- "https://github.com/Telfer/BoneDensityMapping/releases/download/v1.0.2/test_CT_femur.stl"
  bone_filepath <- tempfile(fileext = ".stl")
  download.file(url, bone_filepath, mode = "wb")
  surface_mesh <- import_mesh(bone_filepath)
  landmark_path <- system.file("extdata", "test_femur.fcsv",
                             package = "BoneDensityMapping")
  landmarks <- import_lmks(landmark_path)
  landmark_check(surface_mesh, landmarks, threshold = 1.0)


BoneDensityMapping documentation built on Aug. 8, 2025, 6:46 p.m.