Class CellLocalizingCursor<T extends NativeType<T>, C extends Cell<?>>
java.lang.Object
net.imglib2.AbstractEuclideanSpace
net.imglib2.AbstractLocalizable
net.imglib2.AbstractLocalizingCursor<T>
net.imglib2.img.cell.CellLocalizingCursor<T,C>
- All Implemented Interfaces:
Iterator<T>, Cursor<T>, EuclideanSpace, AbstractCellImg.CellImgSampler<C>, Iterator, Localizable, RealCursor<T>, RealLocalizable, Sampler<T>, Typed<T>
public class CellLocalizingCursor<T extends NativeType<T>, C extends Cell<?>>
extends AbstractLocalizingCursor<T>
implements AbstractCellImg.CellImgSampler<C>
Localizing
Cursor on a AbstractCellImg.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected long[]protected long[]protected intThe current index of the type.protected booleanCaches cursorOnCells.hasNext().protected intprotected final Tprotected final IndexFields inherited from class AbstractLocalizable
positionFields inherited from class AbstractEuclideanSpace
n -
Constructor Summary
ConstructorsModifierConstructorDescriptionCellLocalizingCursor(AbstractCellImg<T, ?, C, ?> img) protectedCellLocalizingCursor(CellLocalizingCursor<T, C> cursor) -
Method Summary
Modifier and TypeMethodDescriptioncopy()voidfwd()Move forward.get()Access the actual T instance providing access to a pixel, sub-pixel or integral region value theSamplerpoints at.getCell()getType()Get an instance ofT.booleanhasNext()Returns true if another step forward is possible.voidjumpFwd(long steps) Move steps × forward.private voidMove cursor right before the first element of the next cell.voidreset()Reset theIterator, that is put it to where it would be if newly created.Methods inherited from class AbstractLocalizable
getDoublePosition, getFloatPosition, getIntPosition, getLongPosition, localize, localize, localize, localizeMethods inherited from class AbstractEuclideanSpace
numDimensionsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Cursor
copyCursorMethods inherited from interface EuclideanSpace
numDimensionsMethods inherited from interface Iterator
forEachRemaining, removeMethods inherited from interface Localizable
getDoublePosition, getFloatPosition, getIntPosition, getLongPosition, localize, localize, localize, localize, positionAsLongArray, positionAsPointMethods inherited from interface RealCursor
nextMethods inherited from interface RealLocalizable
localize, localize, positionAsDoubleArray, positionAsRealPoint
-
Field Details
-
type
-
typeIndex
-
cursorOnCells
-
lastIndexInCell
protected int lastIndexInCell -
currentCellMin
protected long[] currentCellMin -
currentCellMax
protected long[] currentCellMax -
index
protected int indexThe current index of the type. It is faster to duplicate this here than to access it through type.getIndex(). -
isNotLastCell
protected boolean isNotLastCellCaches cursorOnCells.hasNext().
-
-
Constructor Details
-
CellLocalizingCursor
-
CellLocalizingCursor
-
-
Method Details
-
getCell
- Specified by:
getCellin interfaceAbstractCellImg.CellImgSampler<T extends NativeType<T>>- Returns:
- the cell the sampler is currently in.
-
get
-
getType
Description copied from interface:TypedGet an instance ofT.It should not be assumed that the returned
Tinstance is an independent copy. In particular, repeated calls togetType()may return the same instance.- Specified by:
getTypein interfaceSampler<T extends NativeType<T>>- Specified by:
getTypein interfaceTyped<T extends NativeType<T>>- Returns:
- an instance of
T
-
copy
- Specified by:
copyin interfaceCursor<T extends NativeType<T>>- Specified by:
copyin interfaceRealCursor<T extends NativeType<T>>- Specified by:
copyin interfaceSampler<T extends NativeType<T>>- Specified by:
copyin classAbstractLocalizingCursor<T extends NativeType<T>>- Returns:
- - A new
Samplerin the same state accessing the same values. It does NOT copy T, just the state of theSampler. 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 anArrayCursorfor example)
-
hasNext
public boolean hasNext()Description copied from interface:IteratorReturns true if another step forward is possible. -
jumpFwd
-
fwd
-
reset
-
moveToNextCell
private void moveToNextCell()Move cursor right before the first element of the next cell. Update type, position, and index variables.
-