surface_points_template: Redefine surface points. Adds additional surface points...

View source: R/BoneDensityFunctions.R

surface_points_templateR Documentation

Redefine surface points. Adds additional surface points (“sliders”) that are spatially distributed across the mesh surface. Adapted from geomorph

Description

Redefine surface points. Adds additional surface points (“sliders”) that are spatially distributed across the mesh surface. Adapted from geomorph

Usage

surface_points_template(surface_mesh, landmarks, no_surface_sliders)

Arguments

surface_mesh

Mesh object

landmarks

Data frame with landmark coordinates (columns: ID, x, y, z)

no_surface_sliders

Numeric. No. of surface points to generate

Value

Data frame. 3D coordinates for the combined set of original landmarks and the new surface points

Author(s)

Scott Telfer scott.telfer@gmail.com

Examples


  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.mrk.json",
                               package = "BoneDensityMapping")
  landmarks <- import_lmks(landmark_path)
  mapped_coords <- surface_points_template(surface_mesh, landmarks, 1000)


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