Skip to main content
. 2019 Aug 30;10(9):666. doi: 10.3390/genes10090666
Algorithm 1: SP-k-Means Clustering Algorithm
1. Input: Pre-processed cryo-EM image Ip
2. Return: Super-clustered image Isc
3. Set number of clusters, K
4. Generate the 2D super-pixel from the super-clustered image
5. begin/* SLIC */
6.  Initialize Ck=lk,xk,ykT/* the cluster centers */
7.  Move the cluster center cluster centers to the lowest gradient position in a 3 × 3 neighborhood.
8.  Set label li=1 for each pixel i.
9.  Set distance di= for each pixel i.
10.  repeat
11.   for k=1 to K do
12.    for each pixel i in 2S×2S region around Ck do
13.     Compute distance D between Ck and i.
14.      if D<di then
15.       set di=D.
16.       set li=k.
17.      end if
18.    end for
19.   end for
20.   Compute new cluster center θk.
21.   Compute residual error E.
22.  until Ethreshold
23.  generate binary mask
24.  end/* SLIC */
25.  repeat
26.   for n = 1 to N do
27.    Determine the closest representative, θk, for xn
28.    Set label for data point n to k
29.   end for
30.   for k = 1 to K do
31.    Update cluster representative θk to the mean with cluster label k
32.                  θk=n=1Nunkxnn=1Nunk
33.   end for
34.  until change in cluster centers are small
35.   for k = 1 to to K do/* foe each clustered image */
36.   IscMinNonzeroIk/* extract the total number of the non-zero element in each cluster and select the cluster that has the minimum total number of the non-zero element */
37.   end for