T
- public abstract class AbstractSpecialCursor<T extends Type<T>> extends Object implements LocalizableCursor<T>
LocalizableByDimCursor
whose iteration domain is imposed.
This abstract class itself is not really interesting, see sub-classes.Modifier and Type | Field and Description |
---|---|
protected LocalizableByDimCursor<T> |
cursor
The cursor that will be used internally to iterate in the domain.
|
protected boolean |
hasNext
True if the iteration is not done yet.
|
protected Image<T> |
img
The Image this cursors operates on.
|
Constructor and Description |
---|
AbstractSpecialCursor() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
int[] |
createPositionArray() |
void |
fwd(long steps) |
int |
getArrayIndex() |
int[] |
getDimensions() |
void |
getDimensions(int[] position) |
Image<T> |
getImage() |
abstract int |
getNPixels()
Return the number of pixels this cursor will iterate on (or, the number of iterations
it will do before exhausting).
|
int |
getNumDimensions() |
int[] |
getPosition()
Return a copy of the current position.
|
int |
getPosition(int dim)
Return the current position in a given dimension.
|
void |
getPosition(int[] position)
Write the current position into the passed array.
|
String |
getPositionAsString()
Create a human-readable
String representation of the current
position. |
Container<T> |
getStorageContainer() |
int |
getStorageIndex() |
T |
getType() |
boolean |
hasNext() |
boolean |
isActive() |
Iterator<T> |
iterator() |
T |
next() |
void |
remove() |
void |
setDebug(boolean debug) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
forEach, spliterator
protected LocalizableByDimCursor<T extends Type<T>> cursor
protected boolean hasNext
public abstract int getNPixels()
DiscCursordc = new DiscCursor(img, center, 5); int arrraySize = sc.getNPixels(); float[] pixelVal = new float[arraySize]; int index = 0; while (sc.hasNext()) { sc.fwd(); pixelVal[index] = sc.getType().getRealFloat(); index++; }
public int[] createPositionArray()
createPositionArray
in interface Cursor<T extends Type<T>>
public int getArrayIndex()
getArrayIndex
in interface Cursor<T extends Type<T>>
public Container<T> getStorageContainer()
getStorageContainer
in interface Cursor<T extends Type<T>>
public int getStorageIndex()
getStorageIndex
in interface Cursor<T extends Type<T>>
public void setDebug(boolean debug)
public final boolean hasNext()
public int[] getDimensions()
getDimensions
in interface Dimensionality
public void getDimensions(int[] position)
getDimensions
in interface Dimensionality
public int getNumDimensions()
getNumDimensions
in interface Dimensionality
public int[] getPosition()
Localizable
getPosition
in interface Localizable
public void getPosition(int[] position)
Localizable
getPosition
in interface Localizable
public int getPosition(int dim)
Localizable
getPosition
in interface Localizable
public String getPositionAsString()
Localizable
String
representation of the current
position.getPositionAsString
in interface Localizable
Copyright © 2015–2021 Fiji. All rights reserved.