Measuring pore diameter automatically

Hello,

I have CT scans of porous tissues and I created segmentation for my ROI. I usually have multiple pores even if the ROI is small (as in the picture) and I want to measure the diameter of these pores.
I saw there was a similar thing in VMTK to calculate cross-sectional area of vessels but I am not sure it is the same as what I want since here there is no “main vessel” to get its Centerline plus I don’t want to do it by hand.

I was thinking something more like random point assignment in the segmentation and growing a circle in 2D (or sphere in 3D) to reach the boundary of the segment.

Is there a way in 3dslicer to do so? can you please provide me the code for it as I don’t use the GUI.

Thanks in advance!