public class CellGrid extends Object
AbstractCellImg geometry and translates between image, cell,
and grid coordinates.| Modifier and Type | Class and Description |
|---|---|
class |
CellGrid.CellIntervals |
| Constructor and Description |
|---|
CellGrid(CellGrid grid) |
CellGrid(long[] dimensions,
int[] cellDimensions) |
| Modifier and Type | Method and Description |
|---|---|
int |
cellDimension(int d)
Get the number of pixels in a standard cell in dimension
d. |
void |
cellDimensions(int[] dimensions)
Write the number of pixels in a standard cell in each dimension into the
provided
dimensions array. |
CellGrid.CellIntervals |
cellIntervals() |
boolean |
equals(Object obj) |
int |
getCellDimension(int d,
long cellGridPosition)
From the position of a cell in the grid, compute the size of the cell in
dimension
d. |
int[] |
getCellDimensions()
Get the number of pixels in a standard cell in each dimension as a new int[].
|
void |
getCellDimensions(long[] cellGridPosition,
long[] cellMin,
int[] cellDims)
From the position of a cell in the grid, compute the image position of
the first pixel of the cell (the offset of the cell in image coordinates)
and the dimensions of the cell.
|
void |
getCellDimensions(long index,
long[] cellMin,
int[] cellDims)
From the index of a cell in the grid, compute the image position of the
first pixel of the cell (the offset of the cell in image coordinates) and
the dimensions of the cell.
|
void |
getCellGridPositionFlat(long index,
long[] cellGridPosition)
From the flattened index of a cell in the grid, compute the position of a
cell in the grid.
|
void |
getCellInterval(long[] cellGridPosition,
long[] cellMin,
long[] cellMax) |
long |
getCellMin(int d,
long cellGridPosition)
From the position of a cell in the grid, compute the image position in
dimension
d of the first pixel of the cell (the offset of the
cell in image coordinates). |
void |
getCellPosition(long[] position,
long[] cellPos)
Get the grid position of the cell containing the element at
position. |
void |
getCellPosition(long[] position,
Positionable cellPos)
Get the grid position of the cell containing the element at
position. |
long[] |
getGridDimensions()
Get the number of cells in each dimension as a new long[].
|
long[] |
getImgDimensions()
Get the number of pixels in each dimension as a new long[].
|
long |
gridDimension(int d)
Get the number of cells in dimension
d. |
void |
gridDimensions(long[] dimensions)
Write the number of cells in each dimension into the provided
dimensions array. |
int |
hashCode() |
long |
imgDimension(int d)
Get the number of pixels in dimension
d. |
void |
imgDimensions(long[] dimensions)
Write the number of pixels in each dimension into the provided
dimensions array. |
int |
numDimensions() |
String |
toString() |
public CellGrid(long[] dimensions,
int[] cellDimensions)
dimensions - the dimensions of the image (in pixels, not in cells).cellDimensions - the dimensions of a standard cell (in pixels). Cells on the max border
of the image may be cut off and have different dimensions.public CellGrid(CellGrid grid)
public int numDimensions()
public long[] getGridDimensions()
public void gridDimensions(long[] dimensions)
dimensions array.public long gridDimension(int d)
d.public long[] getImgDimensions()
public void imgDimensions(long[] dimensions)
dimensions array. Note, that this is the number of pixels in all cells
combined, not the number of cells!public long imgDimension(int d)
d. Note, that this is the number
of pixels in all cells combined, not the number of cells!public int[] getCellDimensions()
public void cellDimensions(int[] dimensions)
dimensions array. Cells on the max border of the image may be
cut off and have different dimensions.public int cellDimension(int d)
d. Cells on the
max border of the image may be cut off and have different dimensions.public void getCellDimensions(long index,
long[] cellMin,
int[] cellDims)
cellDimensions unless the cell is at the border of the image in
which case it might be truncated.
Note, that this method assumes that the cell grid has flat iteration
order. It this is not the case, use
getCellDimensions(long[], long[], int[]).
index - flattened grid coordinates of the cell.cellMin - offset of the cell in image coordinates are written here.cellDims - dimensions of the cell are written here.public void getCellDimensions(long[] cellGridPosition,
long[] cellMin,
int[] cellDims)
cellDimensions unless the cell is at the border of the image in
which case it might be truncated.cellGridPosition - grid coordinates of the cell.cellMin - offset of the cell in image coordinates are written here.cellDims - dimensions of the cell are written here.public void getCellInterval(long[] cellGridPosition,
long[] cellMin,
long[] cellMax)
public int getCellDimension(int d,
long cellGridPosition)
d. The size will be the standard
cellDimensions unless the cell is at the border of the image in
which case it might be truncated.d - dimension indexcellGridPosition - grid coordinates of the cell in dimension d.d.public long getCellMin(int d,
long cellGridPosition)
d of the first pixel of the cell (the offset of the
cell in image coordinates).d - dimension indexcellGridPosition - grid coordinates of the cell in dimension d.d (in image coordinates).public void getCellGridPositionFlat(long index,
long[] cellGridPosition)
index - flattened grid coordinates of the cell.cellGridPosition - grid coordinates of the cell are written here.public void getCellPosition(long[] position,
long[] cellPos)
position.position - position of an element in the image.cellPos - is set to the grid position of the cell containing the element.public void getCellPosition(long[] position,
Positionable cellPos)
position.position - position of an element in the image.cellPos - is set to the grid position of the cell containing the element.public CellGrid.CellIntervals cellIntervals()
Copyright © 2009–2023 ImgLib2. All rights reserved.