public class CircleCursor<T> extends Object implements net.imglib2.Cursor<T>
Each point of the circle is iterated exactly once, and there is no "hole" in the circle. Contrary to the algorithm linked below, the circles generated by this cursor are "slim": each pixel of the circle is connected with 8-connectivity. For instance, a bitmap excerpt from such a circle looks like this:
.......... OOO....... ...OO..... .....O.... .....O....
| Constructor and Description |
|---|
CircleCursor(net.imglib2.RandomAccessible<T> rai,
net.imglib2.Localizable center,
long radius)
Iterates over a Bresenham circle in the target
RandomAccessible. |
CircleCursor(net.imglib2.RandomAccessible<T> rai,
net.imglib2.Localizable center,
long radius,
int dimX,
int dimY)
Iterates over a Bresenham circle in the target
RandomAccessible. |
| Modifier and Type | Method and Description |
|---|---|
net.imglib2.Cursor<T> |
copy() |
void |
fwd() |
T |
get() |
double |
getDoublePosition(int d) |
float |
getFloatPosition(int d) |
int |
getIntPosition(int d) |
long |
getLongPosition(int d) |
T |
getType() |
boolean |
hasNext() |
void |
jumpFwd(long steps) |
void |
localize(double[] position) |
void |
localize(float[] position) |
void |
localize(int[] position) |
void |
localize(long[] position) |
T |
next() |
int |
numDimensions() |
void |
reset() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcopyCursorforEachRemaining, removelocalize, localize, positionAsLongArray, positionAsPointpositionAsDoubleArray, positionAsRealPointpublic CircleCursor(net.imglib2.RandomAccessible<T> rai, net.imglib2.Localizable center, long radius)
RandomAccessible.
Each point of the circle is iterated exactly once, and there is no "hole"
in the circle.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. Must be at least of dimension 2. Dimensions
0 and 1 are used to specify the circle center.radius - the circle radius. The circle is written in a plane in
dimensions 0 and 1.public CircleCursor(net.imglib2.RandomAccessible<T> rai, net.imglib2.Localizable center, long radius, int dimX, int dimY)
RandomAccessible.
Each point of the circle is iterated exactly once, and there is no "hole"
in the circle.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. Must at least contain dimensions specified
dimX and dimY.radius - the circle radius.dimX - the first dimension of the plane in which to draw the circle.dimY - the second dimension of the plane in which to draw the circle.public void reset()
public void fwd()
public void localize(float[] position)
localize in interface net.imglib2.RealLocalizablepublic void localize(double[] position)
localize in interface net.imglib2.RealLocalizablepublic float getFloatPosition(int d)
getFloatPosition in interface net.imglib2.LocalizablegetFloatPosition in interface net.imglib2.RealLocalizablepublic double getDoublePosition(int d)
getDoublePosition in interface net.imglib2.LocalizablegetDoublePosition in interface net.imglib2.RealLocalizablepublic int numDimensions()
numDimensions in interface net.imglib2.EuclideanSpacepublic T get()
get in interface net.imglib2.Sampler<T>public T getType()
getType in interface net.imglib2.Sampler<T>getType in interface net.imglib2.Typed<T>public void jumpFwd(long steps)
public T next()
next in interface Iterator<T>next in interface net.imglib2.RealCursor<T>public void localize(int[] position)
localize in interface net.imglib2.Localizablepublic void localize(long[] position)
localize in interface net.imglib2.Localizablepublic int getIntPosition(int d)
getIntPosition in interface net.imglib2.Localizablepublic long getLongPosition(int d)
getLongPosition in interface net.imglib2.Localizablepublic net.imglib2.Cursor<T> copy()
copy in interface net.imglib2.Cursor<T>copy in interface net.imglib2.RealCursor<T>copy in interface net.imglib2.Sampler<T>Copyright © 2009–2026 ImgLib2. All rights reserved.