T - public abstract class AbstractCursor<T> extends AbstractEuclideanSpace implements Cursor<T>
Cursor. Java's Iterator
interface is implemented by mapping to abstract Iterator.fwd() and
Sampler.get().
For localization, default implementations are available that all build on the abstract long variant. For particular cursors, this may be implemented more efficiently saving at least one loop over n.
n| Constructor and Description |
|---|
AbstractCursor(int n) |
| Modifier and Type | Method and Description |
|---|---|
abstract AbstractCursor<T> |
copy() |
double |
getDoublePosition(int d)
Return the current position in a given dimension.
|
float |
getFloatPosition(int d)
Return the current position in a given dimension.
|
int |
getIntPosition(int d)
Return the current position in a given dimension.
|
void |
localize(double[] pos)
Write the current position into the passed array.
|
void |
localize(float[] pos)
Write the current position into the passed array.
|
void |
localize(int[] pos)
Write the current position into the passed array.
|
String |
toString() |
numDimensionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcopyCursornextforEachRemaining, hasNext, removegetLongPosition, localize, localize, localize, positionAsLongArray, positionAsPointpositionAsDoubleArray, positionAsRealPointnumDimensionspublic AbstractCursor(int n)
n - number of dimensions in the Img.public void localize(float[] pos)
RealLocalizablelocalize in interface RealLocalizablepos - receives current position, length must be ≥ EuclideanSpace.numDimensions()public void localize(double[] pos)
RealLocalizablelocalize in interface RealLocalizablepos - receives current position, length must be ≥ EuclideanSpace.numDimensions()public void localize(int[] pos)
Localizablelocalize in interface Localizablepos - receives current position, length must be ≥ EuclideanSpace.numDimensions()public float getFloatPosition(int d)
RealLocalizablegetFloatPosition in interface LocalizablegetFloatPosition in interface RealLocalizabled - dimensionpublic double getDoublePosition(int d)
RealLocalizablegetDoublePosition in interface LocalizablegetDoublePosition in interface RealLocalizabled - dimensionpublic int getIntPosition(int d)
LocalizablegetIntPosition in interface Localizabled - dimensionpublic abstract AbstractCursor<T> copy()
copy in interface Cursor<T>copy in interface RealCursor<T>copy in interface Sampler<T>Sampler in the same state accessing the same
values.
It does NOT copy T, just the state of the Sampler.
Otherwise use T.copy() if available.
Sampler.copy().get() == Sampler.get(), i.e. both hold the same
value, not necessarily the same instance (this is the case for an
ArrayCursor for example)Copyright © 2009–2024 ImgLib2. All rights reserved.