I have a segmentation image of CT scan (only 1 and 0 values). I use the function "label" from skimage.measure to get a ndarray of the connected component. Now I need to get only the largest connected component from the "label" output (ndarray). Do you have any idea how can I do it?
My code looks like this:
from skimage.measure import label
def getLargestCC(segmentation):
labels = label(segmentation)
// now I need to get only the largest connected component and return it
return largestCC
Thanks a lot!
segmentation
for testing? – Devoid