I have a three dimensional binary image for which I am working on determining the two-point cluster function. The first step to doing this is to define all of the connected regions within the image. I have successfully done so with skimage as:
from skimage.measure import label
from skimage.morphology import remove_small_objects
from skimage.measure import label
from skimage.morphology import remove_small_objects
min = 64
label_file = label(newim_int, return_num=True, connectivity=2)
image_clean = remove_small_objects(label_file[0], min_size=min,connectivity=2, in_place=True)
label_file = label(image_clean, return_num=True, connectivity=2)
with a bunch of stuff missing to read in the file, etc between min= and label_file= I would now like to know the distribution of sizes of the regions labeled here. Unfortunately, skimage.measure.regionprops tells me it only works for 2D images. Is there another way to do this? Thanks