public abstract class AbstractNeighborhood<T> extends Object implements Positionable, IterableInterval<T>
Positionable IterableInterval that serves as a local
neighborhood, e.g. in filtering operation.
This particular class implements a movable nD domain, defined by a
span long[] array. The span array is such that the
bounding box of the neighborhood in dimension d will be
2 x span[d] + 1.
| Modifier and Type | Field and Description |
|---|---|
protected long[] |
center
The pixel coordinates of the center of this regions.
|
protected ExtendedRandomAccessibleInterval<T,RandomAccessibleInterval<T>> |
extendedSource |
protected int |
n |
protected OutOfBoundsFactory<T,RandomAccessibleInterval<T>> |
outOfBounds |
protected RandomAccessibleInterval<T> |
source |
protected long[] |
span
The span of this neighborhood, such that the size of the bounding box in
dimension
d will be 2 x span[d] + 1. |
| Constructor and Description |
|---|
AbstractNeighborhood(int numDims,
OutOfBoundsFactory<T,RandomAccessibleInterval<T>> outOfBounds) |
| Modifier and Type | Method and Description |
|---|---|
void |
bck(int d)
Move by -1 in one dimension.
|
abstract AbstractNeighborhood<T> |
copy()
Copies the
AbstractNeighborhood. |
long |
dimension(int d)
Default implementation of
Dimensions.dimension(int). |
void |
dimensions(long[] dimensions)
Write the number of pixels in each dimension into long[].
|
T |
firstElement()
Return the element at the top-left corner of this nD neighborhood.
|
void |
fwd(int d)
Move by 1 in one dimension.
|
Object |
iterationOrder()
Returns the iteration order of this
IterableRealInterval. |
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.
|
int |
numDimensions()
Gets the space's number of dimensions.
|
void |
realMax(double[] max)
Write the maximum of each dimension into double[].
|
double |
realMax(int d)
Get the maximum in dimension d.
|
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)
Get the minimum in dimension d.
|
void |
realMin(RealPositionable min)
Sets a
RealPositionable to the minimum of this Interval |
void |
setPosition(int[] position)
Set the position of the element.
|
void |
setPosition(int position,
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[] position)
Set the position of the element.
|
void |
setPosition(long position,
int d)
Set the position of the element for one dimension.
|
void |
setSpan(long[] span)
Set the span of this neighborhood.
|
void |
updateSource(RandomAccessibleInterval<T> source)
Updates the source.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcursor, localizingCursorsizeforEach, iterator, spliteratormaxAsLongArray, maxAsPoint, minAsLongArray, minAsPointmaxAsDoubleArray, maxAsRealPoint, minAsDoubleArray, minAsRealPointallPositive, allPositive, dimensions, dimensionsAsLongArray, dimensionsAsPoint, verify, verify, verifyAllPositive, verifyAllPositiveprotected final long[] center
protected final long[] span
d will be 2 x span[d] + 1.protected ExtendedRandomAccessibleInterval<T,RandomAccessibleInterval<T>> extendedSource
protected RandomAccessibleInterval<T> source
protected OutOfBoundsFactory<T,RandomAccessibleInterval<T>> outOfBounds
protected int n
public AbstractNeighborhood(int numDims,
OutOfBoundsFactory<T,RandomAccessibleInterval<T>> outOfBounds)
public void setSpan(long[] span)
The neighborhood span is such that the size of the neighborhood in
dimension d will be 2 x span[d] + 1.
span - this array content will be copied to the neighborhood internal
field.public int numDimensions()
EuclideanSpacenumDimensions in interface EuclideanSpacepublic 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[] position)
PositionablesetPosition in interface Positionableposition - absolute position, length must be ≥
EuclideanSpace.numDimensions()public void setPosition(long[] position)
PositionablesetPosition in interface Positionableposition - absolute position, length must be ≥
EuclideanSpace.numDimensions()public void setPosition(int position,
int d)
PositionablesetPosition in interface Positionableposition - absolute position in dimension dd - dimensionpublic void setPosition(long position,
int d)
PositionablesetPosition in interface Positionableposition - absolute position in dimension dd - dimensionpublic T firstElement()
firstElement in interface IterableRealInterval<T>public Object iterationOrder()
IterableRealIntervalIterableRealInterval. If the
returned object equals (Object.equals(Object)) the iteration
order of another IterableRealInterval f then they can be
copied by synchronous iteration. That is, having an Iterator on
this and another Iterator on f, moving both in synchrony
will point both of them to corresponding locations in their source
domain. In other words, this and f have the same iteration order
and means and the same number of elements.iterationOrder in interface IterableRealInterval<T>IterableRealInterval.FlatIterationOrderpublic double realMin(int d)
RealIntervalrealMin 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)
RealIntervalrealMax 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 Intervalpublic void updateSource(RandomAccessibleInterval<T> source)
public abstract AbstractNeighborhood<T> copy()
AbstractNeighborhood.Copyright © 2015–2022 ImgLib2. All rights reserved.