public class RoiWrapper extends Object implements IJRealRoiWrapper<Roi>, WritableBox
Roi
as an ImgLib2 Box
. Even though all
ImageJ 1.x ROIs are Rois
, this class should only be used to wrap
ROIs intended to be rectangles.Constructor and Description |
---|
RoiWrapper(double x,
double y,
double width,
double height)
|
RoiWrapper(Roi roi)
|
Modifier and Type | Method and Description |
---|---|
RealLocalizableRealPositionable |
center() |
boolean |
equals(Object obj) |
Roi |
getRoi()
Returns the backing ImageJ 1.x
Roi . |
int |
hashCode() |
double |
realMax(int d) |
double |
realMin(int d) |
void |
setSideLength(int d,
double length)
This will always throw an
UnsupportedOperationException . |
double |
sideLength(int d) |
boolean |
test(RealLocalizable t) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
numDimensions
and, isEmpty, minus, or, realMax, realMax, realMin, realMin, transform, xor
boundaryType, isAll, knownConstant
maxAsDoubleArray, maxAsRealPoint, minAsDoubleArray, minAsRealPoint
public RoiWrapper(double x, double y, double width, double height)
x
- x coordinate of upper left cornery
- y coordinate of upper left cornerwidth
- width of rectangleheight
- height of rectanglepublic boolean test(RealLocalizable t)
In an attempt to be consistent with ImageJ 1.x
Roi.contains(int, int)
, only some of the edges are considered
"contained" by this rectangle. Therefore, this Box has
unspecified
boundary
behavior.
test
in interface Predicate<RealLocalizable>
public double realMin(int d)
realMin
in interface RealInterval
public double realMax(int d)
realMax
in interface RealInterval
public double sideLength(int d)
sideLength
in interface Box
public RealLocalizableRealPositionable center()
center
in interface Box
center
in interface WritableBox
public void setSideLength(int d, double length)
UnsupportedOperationException
.setSideLength
in interface WritableBox
UnsupportedOperationException
- cannot modify width/height of
underlying Roi
public Roi getRoi()
IJRoiWrapper
Roi
.getRoi
in interface IJRoiWrapper<Roi,RealLocalizable>
Roi
public boolean equals(Object obj)
equals
in interface Box
equals
in interface MaskPredicate<RealLocalizable>
equals
in class Object
Copyright © 2014–2022 ImageJ. All rights reserved.