ROI

Region Of Interest shape. Note: should be a closed path.

Constructor

new ROI(pointsopt)

Parameters:
NameTypeAttributesDescription
pointsArray.<Point2D><optional>

Optional initial point list.

Classes

ROI

Methods

addPoint(point)

Add a point to the ROI.

Parameters:
NameTypeDescription
pointPoint2D

The Point2D to add.

addPoints(rhs)

Add points to the ROI.

Parameters:
NameTypeDescription
rhsArray.<Point2D>

The array of POints2D to add.

getCentroid() → {Point2D}

Get the centroid of the roi. Only valid for a non-self-intersecting closed polygon. Ref: https://en.wikipedia.org/wiki/Centroid#Of_a_polygon.

Returns:

The centroid point.

Type: 
Point2D

getLength() → {number}

Get the length of the point list.

Returns:

The length of the point list.

Type: 
number

getPoint(index) → {Point2D|undefined}

Get a point of the list at a given index.

Parameters:
NameTypeDescription
indexnumber

The index of the point to get (beware, no size check).

Returns:

The Point2D at the given index.

Type: 
Point2D | undefined

getPoints() → {Array.<Point2D>}

Get the point list.

Returns:

The list.

Type: 
Array.<Point2D>