Coder Social home page Coder Social logo

Watershed bugs about clij2 HOT 8 OPEN

clij avatar clij commented on September 1, 2024
Watershed bugs

from clij2.

Comments (8)

psobolewskiPhD avatar psobolewskiPhD commented on September 1, 2024 1

I can concur here.
Using CLIJ2_watershed gave rather strange results in the case of thresholded images of Hoechst stained nuclei (I've attached a representative image, a merged tile scan, as .TIF in the zip.)
It often cuts symmetric, but oval shapes at an angle. see:
CLIJ_WS_1
But misses seemingly obvious objects to cut:
CLIJ_WS_2
Process>Binary>Watershed cuts the left object in half as expected.
And then there are a few objects like this, where I have no idea what is going on:
CLIJ_WS_3
(Nota bene, the Process>Binary>Watershed also cuts this object in half for some reason, but just once.)
CLIJ2_parametricWatershed is better behaved, although it's not entirely clear to me how to choose sigma. My objects are on avg. around 40 px in diameter, so radii largely in the 15-30 px range.
Naively, I first tried 30 px and then 15 px and got no cuts.
Smaller sigma got me close to the Process>Binary>Watershed
1 px brings back the odd cuts of intact objects, while still missing cuts as above.
3 px eliminates the clearly spurious cuts, but still misses a couple that seem rather obvious to me, that are cut byt Process>Binary>Watershed.
5 px produces the same results as 3 px
at 10 px start to see cuts missed.

2021040_H33342_L929_24w_A3_tilescan.lif - A3 Region1_Merged.tif.zip

from clij2.

haesleinhuepf avatar haesleinhuepf commented on September 1, 2024 1

Hey @psobolewskiPhD ,

I'd recommend using the approaches by MorpholibJ, SimpleITK and ImageJ1. All are available as CLIJ extensions and can thus be called as other CLIJ functions from Macro:
https://clij.github.io/clij2-docs/reference_morphoLibJClassicWatershed
https://clij.github.io/clij2-docs/reference_morphoLibJMarkerControlledWatershed
https://clij.github.io/clij2-docs/reference_simpleITKMorphologicalWatershed
https://clij.github.io/clij2-docs/reference_imageJWatershed

See the installation instructions for the extensions:
https://clij.github.io/assistant/installation#extensions

from clij2.

psobolewskiPhD avatar psobolewskiPhD commented on September 1, 2024 1

I already switched to
Ext.CLIJx_imageJWatershed(opened, WS);
Based on the code example from @mycroscopy via Twitter.
The results are—for me—better.

Briefly checking out the other options (copy pasta coding), they don't "work"—I guess they need greyscale as input and I'm already thresholding, etc.?
Also, perhaps the CLIJ docs could link to the morphoLib docs where appropriate?

from clij2.

haesleinhuepf avatar haesleinhuepf commented on September 1, 2024 1

I don't understand the proper usage

I see. I just added a mini tutorial. It will be automatically linked from the documentation after it's rebuilt.
https://clij.github.io/clij2-docs/md/morpholibj_classic_watershed/

I will also add links to the MorphoLibJ documentation. Thanks for the suggestion!

Let me know if there remains something unclear.

from clij2.

psobolewskiPhD avatar psobolewskiPhD commented on September 1, 2024 1

The tutorial is amazing—going well above the call of duty! You really didn't have to do that!
The MorphoLib documentation is quite good, so I would have (probably) figured out something myself; I just haven't had time.

from clij2.

haesleinhuepf avatar haesleinhuepf commented on September 1, 2024

Briefly checking out the other options (copy pasta coding), they don't "work"—I guess they need greyscale as input and I'm already thresholding, etc.?

Can you please precisely write what you tried and what didn't work? It's otherwise very hard to answer that. If it's related to other operations and not watershed, please open a new github issue or image.sc thread, post example code and data. I will then give my best to assist you 🙂

from clij2.

psobolewskiPhD avatar psobolewskiPhD commented on September 1, 2024

Oh, sorry for expressing myself poorly.
I wasn't able to get my code to work with those as "drop ins" for the
Ext.CLIJx_imageJWatershed(opened, WS);
(which works perfectly, so for me the issue—bizarre watershed results from CLIJ—is solved.

Regarding the other options, it's not that the commands/extensions don't work, but that I don't understand the proper usage, just from the CLIJ docs. E.g.
Ext.CLIJx_morphoLibJClassicWatershed(Image gradient_input, Image binary_restriction_input, Image destination, Number h_min, Number h_max);
My input is a binary obtained by thresholding & binary open, so I think it's just not the proper input to that morphoLib process. I need to spend some time with the morphoLib docs at some point to figure out if changing anything/everything is worth it. (and frankly, your Otsu-Voronoi extension may just be the best options anyways.)

from clij2.

haesleinhuepf avatar haesleinhuepf commented on September 1, 2024

No big deal, it was made with imagejmacromarkdown ;-)

from clij2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.