Learn R Programming

geomorph (version 4.1.1)

define.sliders: Select points to "slide" along curves

Description

An interactive function to define which landmarks will "slide" along curves.

Usage

define.sliders(landmarks, nsliders, surfsliders = NULL, write.file = TRUE)

Value

Function returns a 'nsliders-x-3' matrix containing the landmark address of the curve sliders, indicating the landmarks between which the slider landmarks will "slide". If write.file = T the matrix is also written to working directory as "curveslide.csv". Matrix (or "curveslide.csv") is designed for use by gpagen during GPA.

Arguments

landmarks

A matrix containing landmark coordinates of landmarks and semilandmarks, OR A vector containing a sequence of numbers corresponding to the landmarks in the order they appear along the curve (for AUTO mode)

nsliders

Number of landmarks to be semilandmarks that slide along curves

surfsliders

(3D only) If 'landmarks' contains "surface sliders", these should be given as a vector or use surfsliders = T, and function looks for "surfslide.csv" in working directory.

write.file

A logical value indicating whether the matrix is written to file as .csv.

Author

Emma Sherratt & Dean Adams

Details

Function takes a matrix of digitized landmark coordinates, such as made by digitize2d, and helps user choose which landmarks will be treated as "sliders" in Generalized Procrustes analysis gpagen. This type of semilandmark "slides" along curves lacking known landmarks (see Bookstein 1997 for algorithm details). Each sliding semilandmark ("sliders") will slide between two designated points, along a line tangent to the specified curvature.

Defining landmarks is an interactive procedure (see below for 2D routines). The procedure is overlapping. For example: there are 5 landmarks (1:5), 1 and 5 are landmarks and 2,3,4 are sliders, the user must select '1' '2' '3', and then '2' '3' '4', and then '3' '4' '5'.

Selection in 2D

Choosing which landmarks will be sliders involves landmark selection using a mouse in the plot window. To define the sliders, for each sliding landmark along the curve in the format 'before-slider-after', using the LEFT mouse button (or regular button for Mac users), click on the hollow circle to choose the landmark in the following order:

  1. Click to choose the first landmark between which semi-landmark will "slide",

  2. Click to choose sliding landmark,

  3. Click to choose the last landmark between which semi-landmark will "slide", Selected landmarks will be filled in and lines are drawn connecting the three landmarks, and will highlight the sliding semilandmark in red and the flanking landmarks in blue.

Notes for geomorph 4.1

Starting with geomorph version 4.1, interactive module selection in 3D is no longer supported, as RGL is not supported under MacOS Tahoe. Only AUTO mode is available.

AUTO mode

The input 'landmarks' can be simply a vector of numbers corresponding to the "sliders" (semilandmarks) in the order they appear along a curve on the specimen. This can be made by c() or seq() or any other reasonable method.

If the sliders form a closed curve, then the function assumes that the first and last landmarks in the 'landmarks' vector are THE SAME are fixed (not sliders). e.g. if landmark 1 is a fixed landmark, and 2, 3 and 4 are semilandmarks, then sliders = c(1,2,3,4,1).

References

Bookstein, F. J. 1997 Landmark Methods for Forms without Landmarks: Morphometrics of Group Differences in Outline Shape. Medical Image Analysis 1(3):225-243.

See Also

digitize2d, gpagen, digit.curves

Examples

Run this code
 
## (not run)
## Examples of AUTO mode 
 # data(scallops)
 ## 1 curve of sliding semilandmark
 # Define sliders for scallopdata
 #sliders = define.sliders(c(5:16,1))

 ## 2 curves of sliding semilandmarks
 # Define sliders for 10 landmarks, where LMs 1, 5, and 10 fixed
 # 2, 3, and 4 are along a curve between 1 and 5
 # and 6, 7, 8, and 9 are along a curve between 5 and 10.
 #sliders = rbind(define.sliders(1:5), define.sliders(5:10)) 

Run the code above in your browser using DataLab