After clustering engine 112 has clustered the superpixels and optionally precalculated the distances between them, storage interface 113 may store into a memory (e.g., memory 116 or any other volatile and/or non-volatile memory embedded in or coupled to system 100) either the centroid vectors of all the clusters, or the precalculated distances between the clusters, or both. It will be appreciated that for some image processing tasks, such as the segmentation task discussed in more detail below, only the differences (i.e., distances) between the different superpixels may be required. Thus, in some embodiments, only the precalculated distances between the clusters, without the clusters' centroid vectors can be stored, thereby further reducing the amount of stored data. The precalculated distances can be stored, for example, in a table such as a look-up table, or in any other type of data structure. For image processing tasks that do require the absolute values of the different image features (or at least their approximations), the clusters' centroid vectors can be stored, and the distances between the clusters may not be precalculated or stored.
In addition to storing centroid vectors of and/or distances between the clusters, storage interface 113 may store, for each superpixel, clustering information identifying the cluster to which the superpixel has been assigned. Clustering information can identify the cluster by a number (e.g., 1?K) or by any other type of identifier. Furthermore, in some embodiments, storage interface 113 may also store position information identifying the position of each superpixel within the biological sample image, or at least its relative position to other superpixels.