harpy.sh.create_voronoi_boundaries#
- harpy.sh.create_voronoi_boundaries(sdata, shapes_name='segmentation_mask_boundaries', output_shapes_name=None, radius=0, overwrite=False)#
Create Voronoi boundaries from the shapes element of the provided SpatialData object.
Given a SpatialData object and a radius, this function calculates Voronoi boundaries and expands these boundaries based on the radius.
- Parameters:
sdata (
SpatialData) – The spatial data object on which Voronoi boundaries will be created.shapes_name (
str(default:'segmentation_mask_boundaries')) – The name of the shapes element insdataused to derive Voronoi boundaries. Default is “segmentation_mask_boundaries”.output_shapes_name (
str|None(default:None)) – Name of the resulting shapes element that will be added tosdata.radius (
int(default:0)) – The expansion radius for the Voronoi boundaries, by default 0. If provided, Voronoi boundaries will be expanded by this radius. Must be non-negative.overwrite (
bool(default:False)) – If True, overwrites theoutput_shapes_nameif it already exists insdata.
- Return type:
- Returns:
: Modified
sdataobject with the Voronoi boundaries created and possibly expanded.- Raises:
ValueError – If the provided radius is negative.