Skip to main content
. 2021 Mar 22;26(3):036005. doi: 10.1117/1.JBO.26.3.036005

Algorithm 1.

Organoid Segmentation

1. Median filter was applied to remove noise (medfilt2, kernel size: 25×25  pixels).
2. Gaussian filter was applied to estimate the background, and this background was subtracted from the image (imgaussfilt, kernel size: 450×450  pixels).
3. Local standard deviation filter was applied to enhance edges (stdfilt, kernel: 13×13  pixels).
4. Otsu’s method was used to segment the edge-enhanced image into three classes (imquantize, multithresh, and number of threshold values: (2). The lowest class, corresponding to the non-organoid regions, was excluded.
5. Segmented regions less than 100 pixels were removed.
6. Holes in segmented regions were filled in (imfill, option: “holes”).
7. Segmented regions were eroded with a disk structure element (imerode, strel, options: “disk,” 9 pixels).
8. Active contours refined the segmented regions (activecontours, options: “Chan-Vese,” 200 iterations, 0.6 contraction bias).
9. Separation of touching organoids in the mask was achieved via the standard h-Minima-watershed transform algorithm.
10. Holes in segmented regions were filled-in (imfill, option: “holes”).
11. Edges in segmented regions were smoothed with a Gaussian filter (imgaussfilt, kernel size: 5×5  pixels).
12. Segmented regions corresponding to PCOs were filtered based on morphology (regionprops, ismember, options: regions with area >1000  pixels and circularity >0.4).56