Package net.imglib2.img.cell
Class Cell<A>
- java.lang.Object
-
- net.imglib2.img.cell.Cell<A>
-
- All Implemented Interfaces:
java.io.Serializable,Dimensions,EuclideanSpace,Interval,RealInterval
public class Cell<A> extends java.lang.Object implements Interval, java.io.Serializable
A cell of anAbstractCellImg.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private Adataprotected int[]dimensionsprotected long[]minprotected intnprivate intnumPixelsprivate static longserialVersionUIDprotected int[]steps
-
Constructor Summary
Constructors Constructor Description Cell(int[] dimensions, long[] min, A data)Create a newCell.Cell(CellGrid.CellDimensionsAndSteps dims, long[] min, A data)Create a newCell.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longdimension(int d)Get the number of pixels in a given dimension d.voiddimensions(int[] dim)Write the number of pixels in each dimension into int[].AgetData()Get the basic type array that stores this cell's pixels.intglobalPositionToIndex(long[] position)Compute the index in the underlying flat array of this cell which corresponds to the specified globalposition.longindexToGlobalPosition(int index, int d)voidindexToGlobalPosition(int index, long[] position)longmax(int d)Get the maximum in dimension d.longmin(int d)Get the minimum in dimension d.intnumDimensions()Gets the space's number of dimensions.longsize()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.imglib2.Dimensions
dimensions, dimensions, dimensionsAsLongArray, dimensionsAsPoint
-
Methods inherited from interface net.imglib2.Interval
max, max, maxAsLongArray, maxAsPoint, min, min, minAsLongArray, minAsPoint, realMax, realMin
-
Methods inherited from interface net.imglib2.RealInterval
maxAsDoubleArray, maxAsRealPoint, minAsDoubleArray, minAsRealPoint, realMax, realMax, realMin, realMin
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
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 Detail
-
Cell
public Cell(int[] dimensions, long[] min, A data)Create a newCell.The arguments are not copied. Therefore,
dimensionsandminarrays may be modified and re-used to create otherCells.
-
Cell
public Cell(CellGrid.CellDimensionsAndSteps dims, long[] min, A data)
Create a newCell.Note that the arguments are not copied. So for example, the
minarray should not be modified and re-used to create otherCells.- Parameters:
dims- dimensions, steps, and numPixels of the cellmin- min coordinate of the celldata- pixel storage
-
-
Method Detail
-
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 globalposition.- Parameters:
position- a global position- Returns:
- corresponding index
-
numDimensions
public int numDimensions()
Description copied from interface:EuclideanSpaceGets the space's number of dimensions.- Specified by:
numDimensionsin interfaceEuclideanSpace
-
min
public long min(int d)
Get the minimum in dimension d.
-
max
public long max(int d)
Get the maximum in dimension d.
-
dimension
public long dimension(int d)
Get the number of pixels in a given dimension d.- Specified by:
dimensionin interfaceDimensions- Specified by:
dimensionin interfaceInterval- Parameters:
d-
-
dimensions
public void dimensions(int[] dim)
Write the number of pixels in each dimension into int[].- Parameters:
dim-
-
-