digit.fixed: Digitize 3D landmarks on mesh3d object

View source: R/digit.fixed.r

digit.fixedR Documentation

Digitize 3D landmarks on mesh3d object

Description

An interactive function to digitize three-dimensional (3D) landmarks. Input for the function is either a matrix of vertex coordinates defining a 3D surface object or a mesh3d object as obtained from read.ply.

Usage

digit.fixed(spec, fixed, index = FALSE, ptsize = 1, center = TRUE)

Arguments

spec

An object of class shape3d/mesh3d, or matrix of 3D vertex coordinates

fixed

The number of landmarks to be digitized (fixed, and curve sliders if desired)

index

Whether selected landmark addresses should be returned (internal use only)

ptsize

Size of mesh points (vertices), e.g. 0.1 for dense meshes, 3 for sparse meshes

center

Should the object 'spec' be centered prior to digitizing?

Details

Function for digitizing fixed three-dimensional landmarks. The user can later designate some as curve sliding semilandmarks, using the function define.sliders or through a semilandmark definition matrix.

To digitize 3D surface sliding semilandmarks the function digitsurface should be used instead.

For details on the full procedure for digitizing fixed 3D landmarks and surface sliding semilandmarks, see the relevant vignette by running vignette("geomorph.digitize3D").

NOTE: The function centers the mesh before digitizing by default (center=TRUE). If one chooses not to center, specimen may be difficult to manipulate in rgl window.

Digitizing

Digitizing is interactive. Once a point is selected, the user is asked if the system should keep or discard the selection (y/n). If "y", the user is asked to continue to select the next landmark. If "n" the removes the last chosen landmark, and the user is asked to select it again. This can be repeated until the user is comfortable with the landmark chosen.

To digitize with a standard 3-button mouse (PC):

  1. the RIGHT mouse button (primary) to select points to be digitized,

  2. the LEFT mouse button (secondary) is used to rotate mesh,

  3. the mouse SCROLLER (third/middle) is used to zoom in and out.

NOTE: Digitizing functions on MACINTOSH computers using a standard 3-button mice works as specified. Macs using platform specific single button mice, XQuartz must be configured: go to Preferences > Input > tick "Emulate three button mouse":

  1. press button to rotate 3D mesh,

  2. press button while pressing COMMAND key to select vertex to be used as a landmark,

  3. press button while pressing OPTION key to adjust mesh perspective.

  4. the mouse SCROLLER or trackpad two finger scroll is used to zoom in an out.

NOTE: there is no pan (translate) functionality in rgl library for all platforms at this time.

Value

Function returns (if assigned to an object) and writes to the working directory an NTS file, containing the landmark coordinates. The file name corresponds to the name of the specimen. If index=FALSE function returns to the console an n x 3 matrix containing the x,y,z coordinates of the digitized landmarks. If index=TRUE, function returns a list:

selected

a matrix containing the x,y,z coordinates of the digitized landmarks

fix

a matrix of addresses for landmarks that are "fixed" (for internal use)

Author(s)

Erik Otarola-Castillo & Emma Sherratt

See Also

read.ply

rgl-package (used in 3D plotting)


geomorph documentation built on Sept. 1, 2023, 1:07 a.m.