An interactive function to digitize two-dimensional(2D) landmarks from .jpg files.
digitize2d(filelist, nlandmarks, scale = NULL, tpsfile,
MultScale = FALSE, verbose = TRUE)
A list of names of jpeg images to be digitized.
Number of landmarks to be digitized.
A vector containing the length of the scale to be placed on each image.
The name of a TPS file to be created or read
A logical option indicating if the coordinates should be pre-multiplied by scale
logical. User decides whether to digitize in verbose or silent format (see details), default is verbose
Function returns a tps file containing the digitized landmark coordinates.
This function may be used for digitizing 2D landmarks from jpeg images (.jpg). The user provides
a list of image names, the number of landmarks to be digitized, and the name of an output
TPS file. An option is included to allow the user to digitize a scale on each image to convert
the landmark coordinates from pixels into meaningful units. Landmarks to be digitized can include
both fixed landmarks and semi-landmarks, the latter of which are to be designated as "sliders"
for subsequent analysis (see the function define.sliders
).
Digitizing landmarks from 2D photos requires that a scale bar is placed in the image in order to scale the coordinate data. The 'scale' option requires: a single number (e.g. 10) which means that the scale to be measured in all images is a 10mm scale bar; OR a vector the same length as the filelist containing a number for the scale of each image. If scale=NULL, then the digitized coordinates will not be scaled. This option is NOT recommended.
Users may digitize all specimens in one session, or may return at a later time to complete digitizing. In the latter case, the user provides the same filelist and TPS file and the function will determine where the user left off.
If specimens have missing landmarks, these can be incorporated during the digitizing process using the 'a' option as described below (a=absent).
Digitizing landmarks involves landmark selection using a mouse in the plot window, using the LEFT mouse button (or regular button for Mac users):
Digitize the scale bar (if requested) by selecting the two end points. Use a single click for start and end points. The user is asked whether the system should keep or discard the digitized scale bar.
Digitize each landmark with single click and the landmark is shown in red.
To digitize a missing landmark, simply click on any location in the image. Then, when prompted to keep selection, choose 'a' (for absent). Missing landmarks can only be included during the digitizing process when verbose=TRUE.
If verbose = FALSE the digitizing of landmarks is continuous and uninterrupted. Here the user will not be prompted to approve each landmark selection.
At the end of digitizing, the landmark coordinates are written to a TPS file. By default, the x,y values are unscaled if a vector of scales is included, and the scale is returned on line SCALE= after each specimen x,y data. Optionally, one may have the coordinates pre-multiplied by scale by using the option MultScale=TRUE.
readJPEG
(for JPEG input)