extract_voxel_contours#

extract_voxel_contours(all_voxels: list[tuple[int, int, int]], projection: str, box: tuple[int, int, int]) list[list[tuple[int, int]]][source]#

Extract contours from list of voxels in specified projection direction.

Parameters:
  • all_voxels – List of all voxels in region.

  • projection – Projection direction.

  • box – Bounding box.

Returns:

List of list of contour points.

get_array_edges(array: ndarray) list[list[tuple[int, int]]][source]#

Get edges of region in binary array.

Parameters:

array – Binary array.

Returns:

List of unconnected region edges.

connect_array_edges(edges: list[list[tuple[int, int]]]) list[list[tuple[int, int]]][source]#

Group unconnected region edges into connected contour edges.

Parameters:

edges – List of unconnected region edges.

Returns:

List of connected contour edges.

merge_contour_edges(contour: list[tuple[int, int]]) list[tuple[int, int]][source]#

Merge connected contour edges.

Parameters:

contour – List of connected contour edges.

Returns:

List of connected contours.