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

the limit of union-find array is 65535?

lvbirui opened this issue · comments

commented

I have a big data(102410241024) to use connected-components-3d and got the error : Label 65535 cannot be mapped to union-find array of length 65535.
Is this because the limit of union-find array?
And will you update a feature to cancel the limit of union-find?

Hi lvbirui, the most likely reason for that limitation is if you are using out_dtype=np.uint16. The reason for that is that the output array is also used to store provisional labels and will not be able to represent them above that limit. I limited the size of union-find to the maximum representation size of the output array as it wouldn't be useful beyond that limit and so would save memory.

If you set out_dtype=np.uint32 that would likely solve the problem. If your data are a binary image, you can save memory by setting the dtype of your input array to np.bool which will activate some optimizations.

commented

Thank you for your reply .I solved the problem by change uint16 to uint32