Class Cell<A>

java.lang.Object
net.imglib2.img.cell.Cell<A>
All Implemented Interfaces:
Serializable, Dimensions, EuclideanSpace, Interval, RealInterval

public class Cell<A> extends Object implements Interval, Serializable
A cell of an AbstractCellImg.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • n

      protected final int n
    • dimensions

      protected final int[] dimensions
    • steps

      protected final int[] steps
    • min

      protected final long[] min
    • numPixels

      private final int numPixels
    • data

      private final A data
  • Constructor Details

    • Cell

      public Cell(int[] dimensions, long[] min, A data)
      Create a new Cell.

      The arguments are not copied. Therefore, dimensions and min arrays may be modified and re-used to create other Cells.

    • Cell

      public Cell(CellGrid.CellDimensionsAndSteps dims, long[] min, A data)
      Create a new Cell.

      Note that the arguments are not copied. So for example, the min array should not be modified and re-used to create other Cells.

      Parameters:
      dims - dimensions, steps, and numPixels of the cell
      min - min coordinate of the cell
      data - pixel storage
  • Method Details

    • getData

      public A getData()
      Get the basic type array that stores this cell's pixels.
      Returns:
      underlying basic type array.
    • size

      public long size()
    • indexToGlobalPosition

      public long indexToGlobalPosition(int index, int d)
    • indexToGlobalPosition

      public void indexToGlobalPosition(int index, long[] position)
    • globalPositionToIndex

      public int globalPositionToIndex(long[] position)
      Compute the index in the underlying flat array of this cell which corresponds to the specified global position.
      Parameters:
      position - a global position
      Returns:
      corresponding index
    • numDimensions

      public int numDimensions()
      Description copied from interface: EuclideanSpace
      Gets the space's number of dimensions.
      Specified by:
      numDimensions in interface EuclideanSpace
    • min

      public long min(int d)
      Get the minimum in dimension d.
      Specified by:
      min in interface Interval
      Parameters:
      d - dimension
      Returns:
      minimum in dimension d.
    • max

      public long max(int d)
      Get the maximum in dimension d.
      Specified by:
      max in interface Interval
      Parameters:
      d - dimension
      Returns:
      maximum in dimension d.
    • dimension

      public long dimension(int d)
      Get the number of pixels in a given dimension d.
      Specified by:
      dimension in interface Dimensions
      Specified by:
      dimension in interface Interval
      Parameters:
      d -
    • dimensions

      public void dimensions(int[] dim)
      Write the number of pixels in each dimension into int[].
      Parameters:
      dim -