I looked for a way to cluster a binary image and came across
nilearn.regions.connected_regions and its keyword argument
extract_type = 'connected_components'. The clustering seems to work fine (I guess?..Confirmations on this method and/or general approaches for clustering binary images are greatly appreciated), but from the documentation it’s not clear to me which specific algorithm is used for that. From the source code of
nilearn.regions.connected_regions it seems that
scipy.ndimage.label is used behind the scenes, is that correct? Nilearn’s documentation on that is a little bit sparse:
If ‘connected_components’, each component/region in the image is extracted automatically by labelling each region based upon the presence of unique features in their respective regions.