public class CellGrid extends Object
AbstractCellImg
geometry and translates between image, cell,
and grid coordinates.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 a given dimension
d.
|
void |
cellDimensions(int[] dimensions)
Write the number of pixels in a standard cell in each dimension into
long[].
|
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 . |
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.
|
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() |
long[] |
getImgDimensions()
Get the number of pixels in each dimension as a new long[].
|
long |
gridDimension(int d) |
void |
gridDimensions(long[] s) |
int |
hashCode() |
long |
imgDimension(int d)
Get the number of pixels in a given dimension d.
|
void |
imgDimensions(long[] dimensions)
Write the number of pixels in each dimension into long[].
|
int |
numDimensions() |
String |
toString() |
public CellGrid(long[] dimensions, int[] cellDimensions)
public CellGrid(CellGrid grid)
public int numDimensions()
public long[] getGridDimensions()
public void gridDimensions(long[] s)
public long gridDimension(int d)
public long[] getImgDimensions()
public void imgDimensions(long[] dimensions)
dimensions
- public long imgDimension(int d)
d
- public void cellDimensions(int[] dimensions)
dimensions
- public int cellDimension(int d)
d
- 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 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.Copyright © 2015–2022 ImgLib2. All rights reserved.