This function reads digitized shape and scaling data from a StereoMorph shape file or files into a list structure.
readShapes(file, fields=NULL)
A shape file, a vector of shape files or a folder containing shape files to be read.
Objects to be returned from the shape file. If NULL
, all objects in the file will be returned.
a list of class "shapes"
containing any number of the following elements:
A vector of image names.
A vector of image IDs.
A vector of the scaling (real-world units per pixel) of the image.
A vector of the units of scaling
.
A vector of the interval of the digitized ruler points in pixels.
A vector of the interval of the digitized ruler points in real-world units.
A vector of the number of internal corners of a checkerboard pattern along one dimension.
A vector of the number of internal corners of a checkerboard pattern along the other dimension.
A vector of the best-fit checkerboard square size in pixels.
A vector of the best-fit checkerboard square size in real-world units.
A matrix or array of landmark coordinates in pixels.
A matrix or array of scaled landmark coordinates.
A matrix or array of ruler points in pixels.
A matrix or array of checkerboard points in pixels.
A list of Bezier curve control points in pixels.
A list of Bezier curve points in pixels.
A list of scaled Bezier curve points.
If any of the above objects are absent from the shape file they will be NULL.
The digitizeImage
function makes it possible to save shape and scaling data into a single shape file. This shape file has an XML-like format that allows the readShapes()
function to read multiple object types (including vectors, matrices and lists) into a list structure using a generalized routine. All these objects are saved to a list as several elements. The particular elements in the output list will depend on which objects are present in the file. If the object is not present in the file, a call to that object will return NULL. The contents will also differ if multiple files are input. For instance, if one file is input landmarks.pixel
will be a matrix but if multiple files are input it will be an array.
The output of print()
on the entire output list is formatted for readability given the potentially large matrices contained within the list.