florin.tiling¶
Utilities for tiling images and volumes.
Functions¶
- tile_generator
- Subdivide an array into equally-sized tiles.
- join_tiles
- Join a sequence of tiles into a single array.
Functions
join (tiles) |
Join a set of tiles into a single array. |
join_tiles (tiles) |
Join a set of tiles into a single array. |
tile (img[, shape, stride, offset, tile_store]) |
Tile data into n-dimensional subdivisions. |
tile_generator (img[, shape, stride, offset, …]) |
Tile data into n-dimensional subdivisions. |
Exceptions
DimensionMismatchError |
|
InvalidTileShapeError |
|
InvalidTileStepError |
|
ShapeStepMismatchError |
-
exception
florin.tiling.
DimensionMismatchError
[source]¶ -
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
exception
florin.tiling.
InvalidTileShapeError
[source]¶ -
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
exception
florin.tiling.
InvalidTileStepError
[source]¶ -
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
exception
florin.tiling.
ShapeStepMismatchError
[source]¶ -
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
florin.tiling.
join
(tiles)¶ Join a set of tiles into a single array.
Parameters: - tiles (collection of FlorinArray) – The collection of tiles to join.
- shape (tuple of int) – The shape of the joined array.
Returns: joined – The array created by joining the tiles and inserting them into the correct positions.
Return type: array_like
-
florin.tiling.
join_tiles
(tiles)[source]¶ Join a set of tiles into a single array.
Parameters: - tiles (collection of FlorinArray) – The collection of tiles to join.
- shape (tuple of int) – The shape of the joined array.
Returns: joined – The array created by joining the tiles and inserting them into the correct positions.
Return type: array_like
-
florin.tiling.
tile
(img, shape=None, stride=None, offset=None, tile_store=None)¶ Tile data into n-dimensional subdivisions.
Parameters: - img (array_like) – The data to subdivide.
- shape (tuple of int) – The shape of the subdivisions.
- stride (tuple of int) – The stride between subdivisions.
Yields: - tile (florin.FlorinVolume) – A subdivision of
img
. Subdivisions are yielded in sequence from the start ofimg
. - metadata (dictionary) – Key/value store of metadata, e.g. for joining tiles.
Notes
Everything up to the for loop will be run exactly once when the first tile is requested.
-
florin.tiling.
tile_generator
(img, shape=None, stride=None, offset=None, tile_store=None)[source]¶ Tile data into n-dimensional subdivisions.
Parameters: - img (array_like) – The data to subdivide.
- shape (tuple of int) – The shape of the subdivisions.
- stride (tuple of int) – The stride between subdivisions.
Yields: - tile (florin.FlorinVolume) – A subdivision of
img
. Subdivisions are yielded in sequence from the start ofimg
. - metadata (dictionary) – Key/value store of metadata, e.g. for joining tiles.
Notes
Everything up to the for loop will be run exactly once when the first tile is requested.