Skip to content
Snippets Groups Projects
Commit 5376ab19 authored by Christian Kento Rasmussen's avatar Christian Kento Rasmussen
Browse files

added support for 2d connected components

parent 0b8b4672
No related branches found
No related tags found
1 merge request!48Implemented 3D connected components as wrapper class for scipy.ndimage.label
...@@ -88,10 +88,5 @@ def get_3d_connected_components(image: np.ndarray | torch.Tensor): ...@@ -88,10 +88,5 @@ def get_3d_connected_components(image: np.ndarray | torch.Tensor):
Returns: Returns:
class: Returns class object of the connected components. class: Returns class object of the connected components.
""" """
if image.ndim != 3:
raise ValueError(
f"Given array is not a volume! Current dimension: {image.ndim}"
)
connected_components, num_connected_components = label(image) connected_components, num_connected_components = label(image)
return ConnectedComponents(connected_components, num_connected_components) return ConnectedComponents(connected_components, num_connected_components)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment