voronoi_edges(shape: List[int], ncells: int, r: int = 0, flat_faces: bool = True)[source]#

Create an image from the edges of a Voronoi tessellation.

  • shape (array_like) – The size of the image to generate in [Nx, Ny, <Nz>] where Ni is the number of voxels in each direction. If Nz is not given a 2D image is returned.

  • ncells (int) – The number of Voronoi cells to include in the tesselation.

  • radius (int, optional) – The radius to which Voronoi edges should be dilated in the final image. If not given then edges are a single pixel/voxel thick.

  • flat_faces (bool) – Whether the Voronoi edges should lie on the boundary of the image (True), or if edges outside the image should be removed (False).


image – A boolean array with True values denoting the pore space

Return type:



Click here to view online example.