clEsperanto / pyclesperanto_prototype

GPU-accelerated bio-image analysis focusing on 3D+t microscopy image data
http://clesperanto.net
BSD 3-Clause "New" or "Revised" License
213 stars 46 forks source link

3D labeling #309

Open indrajeettambe opened 1 year ago

indrajeettambe commented 1 year ago

Hi,

Is it possible to do vorronoi segmentation of 3d image using points (basically center points for voronoi, I have these points will be provided externally not read from image). After getting 3d voronoi using the points, I want to lable that to a 3d image. Is it possible to impliment using this module?

haesleinhuepf commented 1 year ago

Hi @indrajeettambe ,

this should be possible. You can take the list of points (in format x,y,z) and turn it into a label image using pointlist_to_labelled_spots() and then flood a binary image from these pixels using masked_voronoi_labeling.

Please let me know if this works for you or if you need further guidance.

Best, Robert

indrajeettambe commented 1 year ago

is it possible for you share your email address?

indrajeettambe commented 1 year ago

Hi @haesleinhuepf,

I have tried using pointlist_to_labelled_spots(). Here is the jupyternotebook of the following- labeling.pdf. I have also shared how my data looks like.

After this I am a bit confused to use masked_voronoi_labeling.

I am looking forward to grow these spots with different lable and segment my data.

Data: Screenshot_83

Looking forward to segment like this: Screenshot_82

haesleinhuepf commented 1 year ago

Hi @indrajeettambe

try someting like

cle.masked_voronoi_labeling(spots_image > 0, tomo_compress)

Let me know if this works!

Best, Robert

indrajeettambe commented 1 year ago

Hi @haesleinhuepf,

I have tried using cle.masked_voronoi_labeling. Also used cle.gaussian_blur & cle.threshold_otsu to get a mask from my image. But seems like I have not used it properly as the voronoi is not using my spots. Please request you to have a look. As you can see in code (attached below) that there are 20 spots, so I am expecting to get more than 20 lables or voronoi regins. But I am only getting 2 lables (I have also attached output below). I also can see some region that is not labled. I am not sure where I am going wrong.

Code : labeling.pdf

Output from Napari: Screenshot_85 Screenshot_86

Regards, Indrajeet