|
Algorithm 3: SP-IBC Clustering Algorithm
|
| 1. Input: Pre-processed cryo-EM image
|
| 2. Return: Super-clustered image
|
| 3. Set number of clusters,
|
| 4. Generate the 2D super-pixel over segmentation image |
| 5. begin/* SLIC */ |
| 6. Initialize the cluster centers
|
| 7. Move the cluster center cluster centers to the lowest gradient position in a 3 × 3 neighborhood. |
| 8. Set label for each pixel . |
| 9. Set distance for each pixel . |
| 10. repeat
|
| 11. for
to
do
|
| 12. for each pixel in region around
do
|
| 13. Compute distance D between and . |
| 14. if
then
|
| 15. Set . |
| 16. Set . |
| 17. end if
|
| 18. end for
|
| 19. end for
|
| 20. Compute new cluster center . |
| 21. Compute residual error . |
| 22. until
|
| 23. Generate binary mask |
| 24. end/* SLIC */ |
| 25. Transform the intermedia 2D image map into 1D which has the intensity values of all the pixels. |
| 26. ← height × width where is the total number of pixels in the
|
| 27. ← /* maximum values of intensity in the image */ |
| 28. ← /* minimum values of intensity in the image */ |
| 29. K← 4/* set the number of initial cluster based on the interval size = 0.15 */ |
| 30. for
= 1 to
do
|
| 31. ← * set the interval size as the vector of intensity range (max min) divided by the cluster number */ |
| 32. end for
|
| 33. for
= 1 to
do
|
| 34. /* initialize the cluster center based on the interval size */ |
| 35. end for
|
| 36. repeat
|
| 37. for
= 1 to
do
|
| 38. for
= 1 to do |
| 39. /* assign the cluster whose center ( is closest to according to the absolute intensity difference between the two */ |
| 40. end for
|
| 41. end for
|
| 42. for
= 1 to
do
|
| 43. /* update the mean of each cluster by calculating the average intensity values of the pixels assigned to the cluster */. |
| 44. end for
|
| 45. until there is no change in cluster centers. |