kevinjohncutler / omnipose

Omnipose: a high-precision solution for morphology-independent cell segmentation
https://omnipose.readthedocs.io
Other
96 stars 29 forks source link

Contour missing #101

Closed WuJunxu closed 1 month ago

WuJunxu commented 3 months ago

Thanks for your great work! While I tried to get the unique contour by calling the function omnipose.core.get_contour(), I got contour missing.

contour_map, contour_list, unique_L = omnipose.core.get_contour(msk, affinity_graph, coords, cardinal_only=1)

The white region in mask is the background, and the missing contour is in the transition of bg and fg. The missing contour present bellow (red rectangle region):

mask boundary contour
image image image
kevinjohncutler commented 2 months ago

@WuJunxu that is interesting! It also looks like it is not properly returning the contours between masks. They should be pairs of closed loops (indexed from 0 to N-1 where N is the number of pixels on the contour) but only one side of each interface is getting a contour. Also the edges of the image are not recognized as part of the contour. I'll have to look up my code for using this function, as it was more for internal development. Stay tuned.

kevinjohncutler commented 2 months ago

@WuJunxu could you share this example mask when you get the chance?

kevinjohncutler commented 2 months ago

Here is a link to a new docs page I have added to demo the use of the contour function: https://omnipose.readthedocs.io/contours.html

kevinjohncutler commented 1 month ago

@WuJunxu closing now, please reopen if the example code does not resolve your issue. Thanks!