Package sc.fiji.snt.util
Class CircleCursor3D<T>
java.lang.Object
sc.fiji.snt.util.CircleCursor3D<T>
- All Implemented Interfaces:
Iterator<T>,net.imglib2.Cursor<T>,net.imglib2.EuclideanSpace,net.imglib2.Iterator,net.imglib2.Localizable,net.imglib2.RealCursor<T>,net.imglib2.RealLocalizable,net.imglib2.Sampler<T>,net.imglib2.Typed<T>
- Direct Known Subclasses:
DiskCursor3D
Iterate the pixels of an oriented circle in 3-space using Bresenham's algorithm, where the
circle is constructed from the unit normal to the circle plane, the center point, and radius. Alternatively,
x and y basis vectors may be used in place of the circle normal.
- Author:
- Cameron Arshadi
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final double[]protected final net.imglib2.Localizableprotected double[]protected booleanprotected long[]protected final net.imglib2.RandomAccess<T> protected final longprotected final net.imglib2.RandomAccessible<T> protected longprotected final double[]protected double[]protected longprotected final double[]protected double[] -
Constructor Summary
ConstructorsConstructorDescriptionCircleCursor3D(net.imglib2.RandomAccessible<T> rai, net.imglib2.Localizable center, long radius, double[] circleNorm) Iterates over a Bresenham circle in the targetRandomAccessible.CircleCursor3D(net.imglib2.RandomAccessible<T> rai, net.imglib2.Localizable center, long radius, double[] xBasis, double[] yBasis) Iterates over a Bresenham circle in the targetRandomAccessible. -
Method Summary
Modifier and TypeMethodDescriptionnet.imglib2.Cursor<T> copy()voidfwd()get()doublegetDoublePosition(int d) floatgetFloatPosition(int d) intgetIntPosition(int d) longgetLongPosition(int d) booleanhasNext()voidjumpFwd(long steps) voidlocalize(double[] position) voidlocalize(float[] position) voidlocalize(int[] position) voidlocalize(long[] position) next()intvoidreset()protected voidroundPos(double[] doublePos, long[] longPos) protected voidsetPos(long xScale, long yScale) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.imglib2.Cursor
copyCursorMethods inherited from interface java.util.Iterator
forEachRemaining, removeMethods inherited from interface net.imglib2.Localizable
localize, localize, positionAsLongArray, positionAsPointMethods inherited from interface net.imglib2.RealLocalizable
positionAsDoubleArray, positionAsRealPointMethods inherited from interface net.imglib2.Sampler
getType
-
Field Details
-
rai
-
ra
-
centerPoint
protected final net.imglib2.Localizable centerPoint -
center
protected final double[] center -
xBasis
protected final double[] xBasis -
yBasis
protected final double[] yBasis -
radius
protected final long radius -
xVec
protected double[] xVec -
yVec
protected double[] yVec -
longPos
protected long[] longPos -
doublePos
protected double[] doublePos -
x
protected long x -
y
protected long y -
hasNext
protected boolean hasNext
-
-
Constructor Details
-
CircleCursor3D
public CircleCursor3D(net.imglib2.RandomAccessible<T> rai, net.imglib2.Localizable center, long radius, double[] circleNorm) Iterates over a Bresenham circle in the targetRandomAccessible. Each point of the circle is iterated exactly once, and there is no "hole" in the circle.- Parameters:
rai- the random accessible. It is the caller's responsibility to ensure it can be accessed everywhere the circle will be iterated.center- the circle center. Must be at least of dimension 3. Dimensions 0, 1 and 2 are used to specify the circle center.radius- the circle radius.circleNorm- the unit normal to the circle plane, must be 3-dimensional. The "new" x and y basis vectors will be constructed from this vector.
-
CircleCursor3D
public CircleCursor3D(net.imglib2.RandomAccessible<T> rai, net.imglib2.Localizable center, long radius, double[] xBasis, double[] yBasis) Iterates over a Bresenham circle in the targetRandomAccessible. Each point of the circle is iterated exactly once, and there is no "hole" in the circle.- Parameters:
rai- the random accessible. It is the caller responsibility to ensure it can be accessed everywhere the circle will be iterated.center- the circle center.radius- the circle radius.xBasis- the vector representing the "new" x-axis of the circle plane. Should be orthogonal to both the circle normal and the yBasisyBasis- the vector representing the "new" y-axis of the circle plane. Should be orthogonal to both the circle normal and the xBasis
-
-
Method Details
-
copy
-
next
-
jumpFwd
public void jumpFwd(long steps) - Specified by:
jumpFwdin interfacenet.imglib2.Iterator
-
fwd
public void fwd()- Specified by:
fwdin interfacenet.imglib2.Iterator
-
setPos
protected void setPos(long xScale, long yScale) -
roundPos
protected void roundPos(double[] doublePos, long[] longPos) -
reset
public void reset()- Specified by:
resetin interfacenet.imglib2.Iterator
-
hasNext
public boolean hasNext() -
localize
public void localize(float[] position) - Specified by:
localizein interfacenet.imglib2.RealLocalizable
-
localize
public void localize(double[] position) - Specified by:
localizein interfacenet.imglib2.RealLocalizable
-
localize
public void localize(int[] position) - Specified by:
localizein interfacenet.imglib2.Localizable
-
localize
public void localize(long[] position) - Specified by:
localizein interfacenet.imglib2.Localizable
-
getIntPosition
public int getIntPosition(int d) - Specified by:
getIntPositionin interfacenet.imglib2.Localizable
-
getLongPosition
public long getLongPosition(int d) - Specified by:
getLongPositionin interfacenet.imglib2.Localizable
-
getFloatPosition
public float getFloatPosition(int d) - Specified by:
getFloatPositionin interfacenet.imglib2.Localizable- Specified by:
getFloatPositionin interfacenet.imglib2.RealLocalizable
-
getDoublePosition
public double getDoublePosition(int d) - Specified by:
getDoublePositionin interfacenet.imglib2.Localizable- Specified by:
getDoublePositionin interfacenet.imglib2.RealLocalizable
-
numDimensions
public int numDimensions()- Specified by:
numDimensionsin interfacenet.imglib2.EuclideanSpace
-
get
- Specified by:
getin interfacenet.imglib2.Sampler<T>
-