public class PolygonRoiWrapper extends AbstractPolygonRoiWrapper implements WritablePolygon2D
PolygonRoi
as an ImgLib2 Polygon2D
.Constructor and Description |
---|
PolygonRoiWrapper(float[] xPoints,
float[] yPoints)
Creates an ImageJ 1.x
PolygonRoi and wraps it as an ImgLib2
Polygon2D . |
PolygonRoiWrapper(float[] xPoints,
float[] yPoints,
int nPoints)
Creates an ImageJ 1.x
PolygonRoi and wraps it as an ImgLib2
Polygon2D . |
PolygonRoiWrapper(int[] xPoints,
int[] yPoints,
int nPoints)
Creates an ImageJ 1.x
PolygonRoi and wraps it as an ImgLib2
Polygon2D . |
PolygonRoiWrapper(PolygonRoi poly)
Wraps an ImageJ 1.x
PolygonRoi as an ImgLib2 Polygon2D . |
Modifier and Type | Method and Description |
---|---|
void |
addVertex(int index,
RealLocalizable vertex)
This will always throw an
UnsupportedOperationException . |
void |
addVertices(int index,
Collection<RealLocalizable> vertices)
This will always throw an
UnsupportedOperationException . |
boolean |
equals(Object obj) |
int |
hashCode() |
void |
removeVertex(int index)
If the wrapped
PolygonRoi is not associated with an
ImagePlus , then this method will always throw an
UnsupportedOperationException . |
boolean |
test(RealLocalizable t) |
RealLocalizableRealPositionable |
vertex(int pos) |
getRoi, numDimensions, numVertices, realMax, realMin
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addVertex
hashCode, maskType, numDimensions
equals, numVertices, vertices
and, isEmpty, minus, or, realMax, realMax, realMin, realMin, transform, xor
boundaryType, isAll, knownConstant
maxAsDoubleArray, maxAsRealPoint, minAsDoubleArray, minAsRealPoint, realMax, realMin
public PolygonRoiWrapper(int[] xPoints, int[] yPoints, int nPoints)
PolygonRoi
and wraps it as an ImgLib2
Polygon2D
.xPoints
- x coordinates of the verticesyPoints
- y coordinates of the verticesnPoints
- number of verticespublic PolygonRoiWrapper(float[] xPoints, float[] yPoints, int nPoints)
PolygonRoi
and wraps it as an ImgLib2
Polygon2D
.xPoints
- x coordinates of the verticesyPoints
- y coordinates of the verticesnPoints
- number of verticespublic PolygonRoiWrapper(float[] xPoints, float[] yPoints)
PolygonRoi
and wraps it as an ImgLib2
Polygon2D
. The length of xPoints
will be used to determine
the number of vertices this Polygon2D
has.xPoints
- x coordinates of the verticesyPoints
- y coordinates of the verticespublic PolygonRoiWrapper(PolygonRoi poly)
PolygonRoi
as an ImgLib2 Polygon2D
.poly
- the PolygonRoi
to be wrappedpublic boolean test(RealLocalizable t)
Since PolygonRoi.contains(int, int)
uses the "pnpoly" algorithm for
real space polygons, so does this implementation. Thus resulting in a
Polygon2D
with unspecified
boundary behavior.
test
in interface Predicate<RealLocalizable>
public RealLocalizableRealPositionable vertex(int pos)
vertex
in interface Polyshape
vertex
in interface WritablePolyshape
public void addVertex(int index, RealLocalizable vertex)
UnsupportedOperationException
.addVertex
in interface WritablePolyshape
UnsupportedOperationException
- cannot add a new vertex to the
underlying PolygonRoi
public void addVertices(int index, Collection<RealLocalizable> vertices)
UnsupportedOperationException
.addVertices
in interface WritablePolyshape
UnsupportedOperationException
- cannot add new vertices to the
underlying PolygonRoi
public void removeVertex(int index)
PolygonRoi
is not associated with an
ImagePlus
, then this method will always throw an
UnsupportedOperationException
. Otherwise, the vertex will be
removed provided the index is valid.removeVertex
in interface WritablePolyshape
public boolean equals(Object obj)
equals
in interface Polygon2D
equals
in interface MaskPredicate<RealLocalizable>
equals
in class Object
Copyright © 2014–2022 ImageJ. All rights reserved.