Learn R Programming

retistruct (version 0.6.3)

Outline: Class containing basic information about flat outlines

Description

An Outline has contains the polygon describing the outline and an image associated with the outline.

Arguments

Super class

retistruct::OutlineCommon -> Outline

Public fields

P

A N-by-2 matrix of points of the Outline arranged in anticlockwise order

scale

The length of one unit of P in arbitrary units

units

String giving units of scaled P, e.g. “um”

gf

For each row of P, the index of P that is next in the outline travelling anticlockwise (forwards)

gb

For each row of P, the index of P that is next in the outline travelling clockwise (backwards)

h

For each row of P, the correspondence of that point (which will be to itself initially)

im

An image as a raster object

Methods

Public methods

Method new()

Construct an outline object. This sanitises the input points P.

Usage

Outline$new(P = NULL, scale = NA, im = NULL, units = NA)

Arguments

P

An N-by-2 matrix of points of the Outline

scale

The length of one unit of P in arbitrary units

im

The image as a raster object

units

String giving units of scaled P, e.g. “um”

Method getImage()

Image accessor

Usage

Outline$getImage()

Returns

An image as a raster object

Method replaceImage()

Image setter

Usage

Outline$replaceImage(im)

Arguments

im

An image as a raster object

Method mapFragment()

Map the point IDs of a Fragment on the point IDs of this Outline

Usage

Outline$mapFragment(fragment, pids)

Arguments

fragment

Fragment to map

pids

Point IDs in Outline of points in Fragment

Method mapPids()

Map references to points

Usage

Outline$mapPids(x, y, pids)

Arguments

x

References to point indices in source

y

References to existing point indices in target

pids

IDs of points in point register

Returns

New references to point indices in target

Method addPoints()

Add points to the outline register of points

Usage

Outline$addPoints(P)

Arguments

P

2 column matrix of points to add

Returns

The ID of each added point in the register. If points already exist a point will not be created in the register, but an ID will be returned

Method getPoints()

Get unscaled mesh points

Usage

Outline$getPoints()

Returns

Matrix with columns X and Y

Method getPointsScaled()

Get scaled mesh points

Usage

Outline$getPointsScaled()

Returns

Matrix with columns X and Y which is exactly scale times the matrix returned by getPoints

Method getRimSet()

Get set of points on rim

Usage

Outline$getRimSet()

Returns

Vector of point IDs, i.e. indices of the rows in the matrices returned by getPoints and getPointsScaled

Method getOutlineSet()

Get points on the edge of the outline

Usage

Outline$getOutlineSet()

Returns

Vector of points IDs on outline

Method getOutlineLengths()

Get lengths of edges of the outline

Usage

Outline$getOutlineLengths()

Returns

Vector of lengths of edges connecting neighbouring points

Method addFeatureSet()

Add a FeatureSet, e.g. a PointSet or LandmarkSet

Usage

Outline$addFeatureSet(fs)

Arguments

fs

FeatureSet to add

Method clone()

The objects of this class are cloneable with this method.

Usage

Outline$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.