Outline: Class containing basic information about flat outlines

OutlineR Documentation

Class containing basic information about flat outlines

Description

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

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 the X-Y plane in arbitrary units

scalez

The length of one unit of P in the Z-direction 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 cut of that point (which will be to itself initially)

im

An image as a raster object

dm

Depthmap, with same dimensions as im, which indicates height of each pixel in Z-direction

A.fragments

Areas of fragments

dm.inferna.window.min

Minimum window size (in pixels) for inferring missing values in depthmaps

dm.inferna.window.max

Minimum window size (in pixels) for inferring missing values in depthmaps

Methods

Public methods

Inherited methods

Method new()

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

Usage
Outline$new(
  fragments = list(),
  scale = NA,
  im = NULL,
  scalez = NA,
  dm = NULL,
  units = NA
)
Arguments
fragments

A list of N-by-2 matrix of points for each fragment of the Outline

scale

The length of one unit of P in arbitrary units

im

The image as a raster object

scalez

The length of one unit of P in the Z-direction in arbitrary units. If NA, the depthmap is ignored.

dm

Depthmap, with same dimensions as im, which indicates height of each pixel in Z-direction

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 getDepth()

Get depth of points P

Usage
Outline$getDepth(P)
Arguments
P

matrix containing unscaled X-Y coordinates of points

Returns

Vector of unscaled Z coordinates of points P


Method addPoints()

Add points to the outline register of points

Usage
Outline$addPoints(P, fid)
Arguments
P

2 or 3 column matrix of points to add

fid

ID of fragment to which to add the points

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 getFragmentPointIDs()

Get the point IDs in a fragment

Usage
Outline$getFragmentPointIDs(fid)
Arguments
fid

fragment id of the points

Returns

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


Method getFragmentPoints()

Get the points in a fragment

Usage
Outline$getFragmentPoints(fid)
Arguments
fid

fragment id of the points

Returns

Vector of points


Method getFragment()

Get fragment

Usage
Outline$getFragment(fid)
Arguments
fid

Fragment ID

Returns

The Fragment object with ID fid


Method getFragmentIDsFromPointIDs()

Get fragment IDs from point IDS

Usage
Outline$getFragmentIDsFromPointIDs(pids)
Arguments
pids

Vector of point IDs

Returns

The Fragment ID to which each point belongs


Method getFragmentIDs()

Get fragment IDs

Usage
Outline$getFragmentIDs()
Returns

IDs of all fragments


Method getPoints()

Get unscaled mesh points

Usage
Outline$getPoints(pids = NULL)
Arguments
pids

IDs of point to return

Returns

Matrix with columns X, Y and Z


Method getPointsXY()

Get X-Y coordinates of unscaled mesh points

Usage
Outline$getPointsXY(pids = NULL)
Arguments
pids

IDs of point to return

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.

Author(s)

David Sterratt


retistruct documentation built on April 3, 2025, 5:58 p.m.