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

public class CircleCursor3D<T> extends Object implements net.imglib2.Cursor<T>
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

    Fields
    Modifier and Type
    Field
    Description
    protected final double[]
     
    protected final net.imglib2.Localizable
     
    protected double[]
     
    protected boolean
     
    protected long[]
     
    protected final net.imglib2.RandomAccess<T>
     
    protected final long
     
    protected final net.imglib2.RandomAccessible<T>
     
    protected long
     
    protected final double[]
     
    protected double[]
     
    protected long
     
    protected final double[]
     
    protected double[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CircleCursor3D(net.imglib2.RandomAccessible<T> rai, net.imglib2.Localizable center, long radius, double[] circleNorm)
    Iterates over a Bresenham circle in the target RandomAccessible.
    CircleCursor3D(net.imglib2.RandomAccessible<T> rai, net.imglib2.Localizable center, long radius, double[] xBasis, double[] yBasis)
    Iterates over a Bresenham circle in the target RandomAccessible.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.imglib2.Cursor<T>
     
    void
    fwd()
     
    get()
     
    double
     
    float
     
    int
     
    long
     
    boolean
     
    void
    jumpFwd(long steps)
     
    void
    localize(double[] position)
     
    void
    localize(float[] position)
     
    void
    localize(int[] position)
     
    void
    localize(long[] position)
     
     
    int
     
    void
     
    protected void
    roundPos(double[] doublePos, long[] longPos)
     
    protected void
    setPos(long xScale, long yScale)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.imglib2.Cursor

    copyCursor

    Methods inherited from interface java.util.Iterator

    forEachRemaining, remove

    Methods inherited from interface net.imglib2.Localizable

    localize, localize, positionAsLongArray, positionAsPoint

    Methods inherited from interface net.imglib2.RealLocalizable

    positionAsDoubleArray, positionAsRealPoint

    Methods inherited from interface net.imglib2.Sampler

    getType
  • Field Details

    • rai

      protected final net.imglib2.RandomAccessible<T> rai
    • ra

      protected final net.imglib2.RandomAccess<T> 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 target RandomAccessible. 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 target RandomAccessible. 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 yBasis
      yBasis - 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

      public net.imglib2.Cursor<T> copy()
      Specified by:
      copy in interface net.imglib2.Cursor<T>
      Specified by:
      copy in interface net.imglib2.RealCursor<T>
      Specified by:
      copy in interface net.imglib2.Sampler<T>
    • next

      public T next()
      Specified by:
      next in interface Iterator<T>
      Specified by:
      next in interface net.imglib2.RealCursor<T>
    • jumpFwd

      public void jumpFwd(long steps)
      Specified by:
      jumpFwd in interface net.imglib2.Iterator
    • fwd

      public void fwd()
      Specified by:
      fwd in interface net.imglib2.Iterator
    • setPos

      protected void setPos(long xScale, long yScale)
    • roundPos

      protected void roundPos(double[] doublePos, long[] longPos)
    • reset

      public void reset()
      Specified by:
      reset in interface net.imglib2.Iterator
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<T>
      Specified by:
      hasNext in interface net.imglib2.Iterator
    • localize

      public void localize(float[] position)
      Specified by:
      localize in interface net.imglib2.RealLocalizable
    • localize

      public void localize(double[] position)
      Specified by:
      localize in interface net.imglib2.RealLocalizable
    • localize

      public void localize(int[] position)
      Specified by:
      localize in interface net.imglib2.Localizable
    • localize

      public void localize(long[] position)
      Specified by:
      localize in interface net.imglib2.Localizable
    • getIntPosition

      public int getIntPosition(int d)
      Specified by:
      getIntPosition in interface net.imglib2.Localizable
    • getLongPosition

      public long getLongPosition(int d)
      Specified by:
      getLongPosition in interface net.imglib2.Localizable
    • getFloatPosition

      public float getFloatPosition(int d)
      Specified by:
      getFloatPosition in interface net.imglib2.Localizable
      Specified by:
      getFloatPosition in interface net.imglib2.RealLocalizable
    • getDoublePosition

      public double getDoublePosition(int d)
      Specified by:
      getDoublePosition in interface net.imglib2.Localizable
      Specified by:
      getDoublePosition in interface net.imglib2.RealLocalizable
    • numDimensions

      public int numDimensions()
      Specified by:
      numDimensions in interface net.imglib2.EuclideanSpace
    • get

      public T get()
      Specified by:
      get in interface net.imglib2.Sampler<T>