seung-lab / connected-components-3d

Connected components on discrete and continuous multilabel 3D & 2D images. Handles 26, 18, and 6 connected variants; periodic boundaries (4, 8, & 6)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is the output label of largest_k ordered?

hhuang91 opened this issue · comments

Hi,

I'm wondering if the output label of largest_k is ordered?

For example, if I have
labels_out = cc3d.largest_k(labels_in, k=3, connectivity=6)
Does that mean (labels_out==3).sum() > (labels_out==2).sum() > (labels_out==1).sum() ,
or (labels_out==3).sum() < (labels_out==2).sum() < (labels_out==1).sum() ,
or there is no particular order?

I'm asking because I have seen cases where larger label has larger number of components, but also cases where larger number has very small number of components, sometime even 1.

Thank you!

Hi! No, there is no particular ordering on the output label. There may be some loose spatial ordering to it, but it's the result of the output of union-find and a renumbering scan over the volume.

Thank you for the clarification!