public class PositionableInterval extends AbstractLocalizable implements Positionable, Interval
It is constructed with an initial source interval. After construction it has position 0, and interval bounds that are identical to the initial source interval.
If after that it is moved, both the position and interval bounds move.
Additionally, it is possible to move the origin(), which is useful
for example to make the min corner or the center of the interval coincide
with the position.
| Modifier and Type | Field and Description |
|---|---|
protected long[] |
currentOffset |
protected long[] |
initialMax |
protected long[] |
initialMin |
positionn| Modifier | Constructor and Description |
|---|---|
|
PositionableInterval(Interval initial) |
protected |
PositionableInterval(PositionableInterval other)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
bck(int d)
Move by -1 in one dimension.
|
long |
dimension(int d)
Default implementation of
Dimensions.dimension(int). |
void |
dimensions(long[] dimensions)
Write the number of pixels in each dimension into long[].
|
void |
fwd(int d)
Move by 1 in one dimension.
|
long |
max(int d)
Get the maximum in dimension d.
|
void |
max(long[] max)
Write the maximum of each dimension into long[].
|
void |
max(Positionable max)
Sets a
Positionable to the maximum of this Interval |
long |
min(int d)
Get the minimum in dimension d.
|
void |
min(long[] min)
Write the minimum of each dimension into long[].
|
void |
min(Positionable min)
Sets a
Positionable to the minimum of this Interval |
void |
move(int[] distance)
Move the element relative to its current location using an int[] as
distance vector.
|
void |
move(int distance,
int d)
Move the element in one dimension for some distance.
|
void |
move(Localizable localizable)
Move the element relative to its current location using an
Localizable as distance vector. |
void |
move(long[] distance)
Move the element relative to its current location using a long[] as
distance vector.
|
void |
move(long distance,
int d)
Move the element in one dimension for some distance.
|
PositionableLocalizable |
origin()
Get the
Positionable, Localizable origin of this
interval. |
void |
realMax(double[] max)
Write the maximum of each dimension into double[].
|
double |
realMax(int d)
Default implementation of
RealInterval.realMax(int). |
void |
realMax(RealPositionable max)
Sets a
RealPositionable to the maximum of this Interval |
void |
realMin(double[] min)
Write the minimum of each dimension into double[].
|
double |
realMin(int d)
Default implementation of
RealInterval.realMin(int). |
void |
realMin(RealPositionable min)
Sets a
RealPositionable to the minimum of this Interval |
void |
setPosition(int[] pos)
Set the position of the element.
|
void |
setPosition(int pos,
int d)
Set the position of the element for one dimension.
|
void |
setPosition(Localizable localizable)
Place the element at the same location as a given
Localizable |
void |
setPosition(long[] pos)
Set the position of the element.
|
void |
setPosition(long pos,
int d)
Set the position of the element for one dimension.
|
String |
toString() |
getDoublePosition, getFloatPosition, getIntPosition, getLongPosition, localize, localize, localize, localizenumDimensionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitmaxAsLongArray, maxAsPoint, minAsLongArray, minAsPointmaxAsDoubleArray, maxAsRealPoint, minAsDoubleArray, minAsRealPointallPositive, allPositive, dimensions, dimensionsAsLongArray, dimensionsAsPoint, verify, verify, verifyAllPositive, verifyAllPositivenumDimensionslocalize, positionAsLongArray, positionAsPointlocalize, positionAsDoubleArray, positionAsRealPointprotected final long[] currentOffset
protected final long[] initialMin
protected final long[] initialMax
public PositionableInterval(Interval initial)
protected PositionableInterval(PositionableInterval other)
public PositionableLocalizable origin()
Positionable, Localizable origin of this
interval.
The origin is the relative offset of the position to the minimum. For
example if a positionable (bitmask) region is made from a BitType
image with a circular pattern, then it is more natural if the region
position refers to the center of the pattern instead of the upper left
corner of the BitType image. This can be achieved by positioning
the origin.
Assume a region is created from a 9x9 bitmask. The region initially has
min=(0,0), max=(8,8), position=(0,0). Because both position and min are
(0,0), initially origin=(0,0). Now assume the origin is moved to the
center of the bitmask using
origin().setPosition(new int[]{4,4}). After this,
min=(-4,-4), max=(4,4), position=(0,0), and origin=(4,4).
public void fwd(int d)
Positionablefwd in interface Positionabled - dimensionpublic void bck(int d)
Positionablebck in interface Positionabled - dimensionpublic void move(int distance,
int d)
Positionablemove in interface Positionabledistance - relative offset in dimension dd - dimensionpublic void move(long distance,
int d)
Positionablemove in interface Positionabledistance - relative offset in dimension dd - dimensionpublic void move(Localizable localizable)
PositionableLocalizable as distance vector.move in interface Positionablelocalizable - relative offset, EuclideanSpace.numDimensions() must be
≥ EuclideanSpace.numDimensions()public void move(int[] distance)
Positionablemove in interface Positionabledistance - relative offset, length must be ≥ EuclideanSpace.numDimensions()public void move(long[] distance)
Positionablemove in interface Positionabledistance - relative offset, length must be ≥ EuclideanSpace.numDimensions()public void setPosition(Localizable localizable)
PositionableLocalizablesetPosition in interface Positionablelocalizable - absolute position, EuclideanSpace.numDimensions() must be
≥ EuclideanSpace.numDimensions()public void setPosition(int[] pos)
PositionablesetPosition in interface Positionablepos - absolute position, length must be ≥
EuclideanSpace.numDimensions()public void setPosition(long[] pos)
PositionablesetPosition in interface Positionablepos - absolute position, length must be ≥
EuclideanSpace.numDimensions()public void setPosition(int pos,
int d)
PositionablesetPosition in interface Positionablepos - absolute position in dimension dd - dimensionpublic void setPosition(long pos,
int d)
PositionablesetPosition in interface Positionablepos - absolute position in dimension dd - dimensionpublic double realMin(int d)
IntervalRealInterval.realMin(int).realMin in interface IntervalrealMin in interface RealIntervald - dimensionpublic void realMin(double[] min)
RealIntervalrealMin in interface RealIntervalpublic void realMin(RealPositionable min)
RealIntervalRealPositionable to the minimum of this IntervalrealMin in interface RealIntervalpublic double realMax(int d)
IntervalRealInterval.realMax(int).realMax in interface IntervalrealMax in interface RealIntervald - dimensionpublic void realMax(double[] max)
RealIntervalrealMax in interface RealIntervalpublic void realMax(RealPositionable max)
RealIntervalRealPositionable to the maximum of this IntervalrealMax in interface RealIntervalpublic long min(int d)
Intervalpublic void min(long[] min)
Intervalpublic void min(Positionable min)
IntervalPositionable to the minimum of this Intervalpublic long max(int d)
Intervalpublic void max(long[] max)
Intervalpublic void max(Positionable max)
IntervalPositionable to the maximum of this Intervalpublic void dimensions(long[] dimensions)
Dimensionsdimensions in interface Dimensionspublic long dimension(int d)
IntervalDimensions.dimension(int).dimension in interface Dimensionsdimension in interface IntervalCopyright © 2015–2022 ImgLib2. All rights reserved.