Skip to content

Stitch Prediction

Source

Prediction utility functions.

stitch_prediction(tiles, tile_infos)

Stitch tiles back together to form a full image(s).

Tiles are of dimensions SC(Z)YX, where C is the number of channels and can be a singleton dimension.

Parameters:

Name Type Description Default
tiles list of numpy.ndarray

Cropped tiles and their respective stitching coordinates. Can contain tiles from multiple images.

required
tile_infos list of TileInformation

List of information and coordinates obtained from dataset.tiled_patching.extract_tiles.

required

Returns:

Type Description
list of numpy.ndarray

Full image(s).

stitch_prediction_single(tiles, tile_infos)

Stitch tiles back together to form a full image.

Tiles are of dimensions SC(Z)YX, where C is the number of channels and can be a singleton dimension.

Parameters:

Name Type Description Default
tiles list of numpy.ndarray

Cropped tiles and their respective stitching coordinates.

required
tile_infos list of TileInformation

List of information and coordinates obtained from dataset.tiled_patching.extract_tiles.

required

Returns:

Type Description
ndarray

Full image, with dimensions SC(Z)YX.

stitch_prediction_vae(predictions, dset)

Stitch predictions back together using dataset's index manager.

Parameters:

Name Type Description Default
predictions ndarray

Array of predictions with shape (n_tiles, channels, height, width).

required
dset Dataset

Dataset object with idx_manager containing tiling information.

required

Returns:

Type Description
ndarray

Stitched predictions.