public class Grids extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Grids.CreateAndCropBlockToFitInterval |
static interface |
Grids.GetForDimension
Helper interface to get current value of specified dimension
|
static class |
Grids.GetGridCoordinates |
static interface |
Grids.MoveForDimension
Helper interface for moving by a specified distance along a specified
dimension.
|
static interface |
Grids.SetForDimension
Helper interface to set position of specified dimension.
|
| Constructor and Description |
|---|
Grids() |
| Modifier and Type | Method and Description |
|---|---|
static List<Interval> |
collectAllContainedIntervals(long[] dimensions,
int[] blockSize)
Get all blocks of size
blockSize contained within an interval
specified by dimensions and their positions within a cell grid. |
static List<Interval> |
collectAllContainedIntervals(long[] min,
long[] max,
int[] blockSize)
Get all blocks of size
blockSize contained within an interval
specified by min, max and their positions within a cell
grid. |
static List<Pair<Interval,long[]>> |
collectAllContainedIntervalsWithGridPositions(long[] dimensions,
int[] blockSize)
Get all blocks of size
blockSize contained within an interval
specified by dimensions and their positions within a cell grid. |
static List<Pair<Interval,long[]>> |
collectAllContainedIntervalsWithGridPositions(long[] min,
long[] max,
int[] blockSize)
Get all blocks of size
blockSize contained within an interval
specified by min, max and their positions within a cell
grid. |
static List<long[]> |
collectAllOffsets(long[] dimensions,
int[] blockSize)
Get all blocks of size
blockSize contained within an interval
specified by dimensions. |
static <T> List<T> |
collectAllOffsets(long[] dimensions,
int[] blockSize,
Function<long[],T> func)
Get all blocks of size
blockSize contained within an interval
specified by dimensions. |
static List<long[]> |
collectAllOffsets(long[] min,
long[] max,
int[] blockSize)
Get all blocks of size
blockSize contained within an interval
specified by min and max. |
static <T> List<T> |
collectAllOffsets(long[] min,
long[] max,
int[] blockSize,
Function<long[],T> func)
Get all blocks of size
blockSize contained within an interval
specified by min and max. |
static Function<long[],Pair<Interval,long[]>> |
croppedIntervalAndGridPosition(long[] dimensions,
int[] blockSize) |
static Function<long[],Pair<Interval,long[]>> |
croppedIntervalAndGridPosition(long[] min,
long[] max,
int[] blockSize)
|
static void |
forEachOffset(long[] min,
long[] max,
int[] blockSize,
Consumer<long[]> runAtOffset)
Execute
runAtOffset for each offset of a grid defined by
min, max, and blockSize. |
static void |
forEachOffset(long[] min,
long[] max,
int[] blockSize,
Grids.SetForDimension setOffsetForDimension,
Grids.GetForDimension getOffsetForDimension,
Grids.MoveForDimension moveForDimension,
Runnable runAtEachOffset)
|
static <P extends Positionable & Localizable> |
forEachOffset(long[] min,
long[] max,
int[] blockSize,
P p,
Runnable runAtOffset)
Execute
runAtOffset for each offset of a grid defined by
min, max, and blockSize. |
public static <P extends Positionable & Localizable> void forEachOffset(long[] min, long[] max, int[] blockSize, P p, Runnable runAtOffset)
runAtOffset for each offset of a grid defined by
min, max, and blockSize. The offset object
p must be provided by the caller.min - max - blockSize - p - runAtOffset - public static void forEachOffset(long[] min,
long[] max,
int[] blockSize,
Consumer<long[]> runAtOffset)
runAtOffset for each offset of a grid defined by
min, max, and blockSize.min - max - blockSize - runAtOffset - public static void forEachOffset(long[] min,
long[] max,
int[] blockSize,
Grids.SetForDimension setOffsetForDimension,
Grids.GetForDimension getOffsetForDimension,
Grids.MoveForDimension moveForDimension,
Runnable runAtEachOffset)
Runnable for each offset of a grid defined by
min, max, and blockSize.
This method is agonstic of the object that represents the current offset.
Instead, the caller provides setOffsetForDimension,
getOffsetForDimension, and moveForDimension to move the
offset object in the correct positions. Consequently,
runAtEachOffset needs to be a stateful object that is aware of
the current position.
See forEachOffset(long[], long[], int[], Consumer) and
forEachOffset(long[], long[], int[], Positionable, Runnable)
for example/convenience implementations for long[] and
Positionable & Lozalizable offset objects.min - max - blockSize - setOffsetForDimension - getOffsetForDimension - moveForDimension - runAtEachOffset - public static List<Pair<Interval,long[]>> collectAllContainedIntervalsWithGridPositions(long[] dimensions, int[] blockSize)
blockSize contained within an interval
specified by dimensions and their positions within a cell grid.dimensions - blockSize - Interval and the position
within a cell grid.public static List<Pair<Interval,long[]>> collectAllContainedIntervalsWithGridPositions(long[] min, long[] max, int[] blockSize)
blockSize contained within an interval
specified by min, max and their positions within a cell
grid.min - max - blockSize - Interval and the position
within a cell grid.public static List<Interval> collectAllContainedIntervals(long[] dimensions, int[] blockSize)
blockSize contained within an interval
specified by dimensions and their positions within a cell grid.dimensions - blockSize - Intervalpublic static List<Interval> collectAllContainedIntervals(long[] min, long[] max, int[] blockSize)
blockSize contained within an interval
specified by min, max and their positions within a cell
grid.min - max - blockSize - Intervalpublic static List<long[]> collectAllOffsets(long[] dimensions, int[] blockSize)
blockSize contained within an interval
specified by dimensions.dimensions - blockSize - public static <T> List<T> collectAllOffsets(long[] dimensions, int[] blockSize, Function<long[],T> func)
blockSize contained within an interval
specified by dimensions.dimensions - blockSize - func - Apply this function to each block, e.g. create a
Interval for each block.funkpublic static List<long[]> collectAllOffsets(long[] min, long[] max, int[] blockSize)
blockSize contained within an interval
specified by min and max.min - max - blockSize - public static <T> List<T> collectAllOffsets(long[] min, long[] max, int[] blockSize, Function<long[],T> func)
blockSize contained within an interval
specified by min and max.min - max - blockSize - func - Apply this function to each block, e.g. create a
Interval for each block.funkpublic static Function<long[],Pair<Interval,long[]>> croppedIntervalAndGridPosition(long[] dimensions, int[] blockSize)
Copyright © 2015–2022 ImgLib2. All rights reserved.