create_voronoi_image#

create_voronoi_image(image: BioImage, channel: int, iterations: int, height: int) ndarray[source]#

Apply Voronoi tessellation to image.

Parameters:
  • image – Segmentation image.

  • channel – Image channel.

  • iterations – Number of boundary estimation steps.

  • height – Target height in voxels.

Returns:

Voronoi tessellation.

create_boundary_mask(array: ndarray, iterations: int) ndarray[source]#

Creates filled boundary mask around regions in array.

Parameters:
  • array – Image array.

  • iterations – Number of boundary estimation steps.

Returns:

Boundary mask array.

get_mask_bounds(array: ndarray, target_range: int) tuple[int, int][source]#

Calculates the indices of z axis bounds with given target range.

If the current range between z axis bounds (the minimum and maximum indices in the z axis where there exist non-zero entries) is wider than the target range, the current bound indices are returned.

Parameters:
  • array – Image array.

  • target_range – Target distance between bounds.

Returns:

Lower and upper bound indices.

get_array_slices(array: ndarray) tuple[slice, slice, slice][source]#

Calculate bounding box slices around binary array.

Parameters:

array – Binary array.

Returns:

Slices in the z, y, and x directions.

calculate_voronoi_array(array: ndarray) ndarray[source]#

Calculates voronoi on image array using distance transform.

Parameters:

array – Image array.

Returns:

Voronoi array.