Skip to main content
. 2019 Aug 30;10(9):666. doi: 10.3390/genes10090666
Algorithm 4: Image Cleaning
1. Input: Ic/* cluster cryo-EM image */
2. Return: Icc/* cleaned cluster image */
3. Ic1←imopenIc/* apply image opening on the cluster image to enlarge small blobs */
4. L←bwlabelIc1/* label each object in the cluster image which returns a label matrix L that contains 8-connected object in the cluster */
5. for i=1 to L do/* for each object in the clustered image */
6.  Iobject←stateLk/* get each particle where k is the total number of objects in the cluster cryo-EM */
7.  Iobject←removestateLk /* remove all the connected components that are smaller than the p pixels */
8.  centroid=statsk.Centroid/* mark and get the actual index numbers and the centroid of each object */
9. end for
10. objnumber←is memberIobject/* extract the number of object (particles) */
11. L←bwlabel/* label each object (particle) */
12. for i = 1 to L do/* for each object (particles) */
13.  Do size filtering and roundness filtering
14.  p ←props.label/* extract the 8-connectedlabeld object */
15.         keeperObjects←props.label> p/* remove each object that less than 8-connected component in the binary image */
16.  Ic2←keeperObjects /* get actual index numbers instead of a logical vector */
17.  Icc←bwareaopenIc2/* produce new binary image with only the small, or non-connected object */
18. end for
19. Generate and getting a new binary image