readShapes: Reads a StereoMorph shape file

View source: R/readShapes.R

readShapesR Documentation

Reads a StereoMorph shape file

Description

This function reads digitized shape and scaling data from a StereoMorph shape file or files into a list structure.

Usage

readShapes(file, fields=NULL)

Arguments

file

A shape file, a vector of shape files or a folder containing shape files to be read.

fields

Objects to be returned from the shape file. If NULL, all objects in the file will be returned.

Details

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.

Value

a list of class "shapes" containing any number of the following elements:

image.name

A vector of image names.

image.id

A vector of image IDs.

scaling

A vector of the scaling (real-world units per pixel) of the image.

scaling.units

A vector of the units of scaling.

ruler.pixel

A vector of the interval of the digitized ruler points in pixels.

ruler.interval

A vector of the interval of the digitized ruler points in real-world units.

checkerboard.nx

A vector of the number of internal corners of a checkerboard pattern along one dimension.

checkerboard.ny

A vector of the number of internal corners of a checkerboard pattern along the other dimension.

square.pixel

A vector of the best-fit checkerboard square size in pixels.

square.size

A vector of the best-fit checkerboard square size in real-world units.

landmarks.pixel

A matrix or array of landmark coordinates in pixels.

landmarks.scaled

A matrix or array of scaled landmark coordinates.

ruler.points

A matrix or array of ruler points in pixels.

checker.pixel

A matrix or array of checkerboard points in pixels.

curves.control

A list of Bezier curve control points in pixels.

curves.pixel

A list of Bezier curve points in pixels.

curves.scaled

A list of scaled Bezier curve points.

If any of the above objects are absent from the shape file they will be NULL.

Author(s)

Aaron Olsen

See Also

digitizeImage


StereoMorph documentation built on May 25, 2022, 5:06 p.m.