-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add voronoi_tessellation
tool
#108
Conversation
Squashed commit of the following: commit 3cf5e31 Author: Leonid Kostrykin <[email protected]> Date: Sat Mar 9 19:04:19 2024 +0100 Fix test results commit c7c193a Author: Leonid Kostrykin <[email protected]> Date: Sat Mar 9 18:29:04 2024 +0100 Fix bugs commit e67e183 Author: Leonid Kostrykin <[email protected]> Date: Sat Mar 9 17:19:02 2024 +0000 Fix bug commit 91c0f8b Author: Leonid Kostrykin <[email protected]> Date: Sat Mar 9 17:15:47 2024 +0000 Fix citation commit 6d96123 Author: Leonid Kostrykin <[email protected]> Date: Sat Mar 9 17:05:34 2024 +0000 Add tests commit c2531b3 Author: Leonid Kostrykin <[email protected]> Date: Sat Mar 9 17:54:11 2024 +0100 Fix XML commit a0a9b16 Author: Leonid Kostrykin <[email protected]> Date: Sat Mar 9 16:20:50 2024 +0000 Implement `voronoi_tessellation` tool commit 05b5849 Author: Leonid Kostrykin <[email protected]> Date: Sat Mar 9 16:02:43 2024 +0000 Add `voronoi_tesselation` tool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand much about images, but are both images included here supposed to be black and the same size?
Short answer: The images are fine, I just double-checked them. Long answer: They are not really black :) In [1]: import skimage.io
In [2]: skimage.io.imread('input1.tiff')
Out[2]:
array([[0, 0, 0, 0, 0, 0, 3, 3, 3, 3],
[0, 1, 1, 0, 0, 0, 3, 3, 3, 3],
[0, 1, 1, 0, 0, 0, 3, 3, 3, 3],
[0, 0, 0, 0, 0, 0, 3, 3, 3, 3],
[0, 0, 0, 0, 0, 0, 3, 3, 3, 3],
[0, 0, 0, 0, 0, 0, 3, 3, 3, 3],
[0, 0, 0, 0, 0, 0, 0, 4, 4, 4],
[0, 2, 2, 0, 0, 0, 0, 4, 4, 4],
[0, 2, 2, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], dtype=uint8)
In [3]: skimage.io.imread('input1_result.tiff')
Out[3]:
array([[1, 1, 1, 1, 3, 3, 3, 3, 3, 3],
[1, 1, 1, 1, 1, 3, 3, 3, 3, 3],
[1, 1, 1, 1, 1, 3, 3, 3, 3, 3],
[1, 1, 1, 1, 3, 3, 3, 3, 3, 3],
[1, 1, 1, 1, 3, 3, 3, 3, 3, 3],
[2, 2, 2, 2, 3, 3, 3, 3, 3, 3],
[2, 2, 2, 2, 2, 3, 3, 4, 4, 4],
[2, 2, 2, 2, 2, 4, 4, 4, 4, 4],
[2, 2, 2, 2, 2, 4, 4, 4, 4, 4],
[2, 2, 2, 2, 2, 2, 4, 4, 4, 4]], dtype=uint8) The pixel values just all are very close to 0, which makes it look black, but in fact it's very dark gray. The exact values do not really matter, they are just arbitrary labels for distinct image regions. |
Ok, as I said, I have no clue about images ;) |
For the contributor:
The added tool takes an image with labels as input and yields an image with the corresponding Voronoi tessellation (aka Voronoi diagram, Dirichlet tessellation). This mimics the behavior of the ImageJ function Process ‣ Binary ‣ Voronoi: https://bioimagebook.github.io/chapters/2-processing/6-transforms/imagej.html#voronoi
xref #105