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. Ic1imopenIc/* apply image opening on the cluster image to enlarge small blobs */
4. LbwlabelIc1/* 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.  IobjectstateLk/* get each particle where k is the total number of objects in the cluster cryo-EM */
7.  IobjectremovestateLk /* 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. objnumberis memberIobject/* extract the number of object (particles) */
11. Lbwlabel/* 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.         keeperObjectsprops.label> p/* remove each object that less than 8-connected component in the binary image */
16.  Ic2keeperObjects /* get actual index numbers instead of a logical vector */
17.  IccbwareaopenIc2/* produce new binary image with only the small, or non-connected object */
18. end for
19. Generate and getting a new binary image