Closed 1999kevin closed 2 years ago
Solve it by expanding 2D to 3D by adding one axis
I wasn't sure if anyone was going to use voxel connectivity graph in 3d let alone 2d. I'm glad you found it helpful! It was made for a very specific purpose I had in mind (and still have yet to do). I'll consider fixing it up in 2D.
~Can you share an example of the code that broke?~ Nevermind, I think voxel_connectivity_graph
should work, but I can see why contacts
and region_graph
are breaking in 2D.
~Can you share an example of the code that broke?~ Nevermind, I think
voxel_connectivity_graph
should work, but I can see whycontacts
andregion_graph
are breaking in 2D.
Thank you for your reply. A 2D input array with dimension (h,w) can produce such a bug. However, I make contacts
work by expanding one axis using such a command: a = np.expand_dims(a, axis=2)
.
I develop an greedy algorigm to convert a segmentation map with a lot of labels to a map with specific number of labels, and I find your contacts
is useful to find the neighbor for each label
The new version of cc3d should have this fixed. Let me know if you need more help!
Nice job!. I want to find the neighborhood of each label in 2D segmentation and I think it is the function of contacts. However, I find that these functions could not be applied to 2D segmentation and report "TypeError: No matching signature found".
Could you please help you to fix this bug?