Skip to content
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

Question about "Extended Maxima" #47

Closed
tischi opened this issue Feb 8, 2021 · 5 comments
Closed

Question about "Extended Maxima" #47

tischi opened this issue Feb 8, 2021 · 5 comments

Comments

@tischi
Copy link

tischi commented Feb 8, 2021

@dlegland triggered by the discussion on the forum (https://forum.image.sc/t/call4help-3d-dense-nuclei-segmentation-challenge/23462/21) I had a look at MLJ.

I am confused about this function:

public final static ImageStack extendedMaxima(ImageStack image,

And this (corresponding?) menu entry: Plugins › MorphoLibJ › Minima and Maxima › Extended Min & Max 3D

Reading the name ("Extended Min & Max 3D") of the menu entry I would expect that it takes all regional maxima and extends them, including all connected pixels with v > (v_regional_max - dynamic).

However, what it seems to do is to (also?) filter out some maxima, i.e. I am getting less maxima using the "Extended" vs. the "Regional" algorithm. Is that correct? If so, according to which criteria does the "Extended" version filter maxima?

@dlegland
Copy link
Contributor

dlegland commented Feb 8, 2021

Hi,

I would expect that it takes all regional maxima and extends them,
This is not really how it works. In facts, some pixels/voxels may belong to a regional minima/maxima, without being included in an extended minima/maxima.

One way to consider things is to imagine the (morphological) reconstruction of the image, constrained by the same image minus the value of the dynamic. Then, a minima with a small dynamic will disappear after the reconstruction.

So the criterium to remove minima/maxima is the value of the dynamic value uused to remove them. Hope this makes things more clear? Maybe I will eed to update the manual also!!!

best,
David

@tischi
Copy link
Author

tischi commented Feb 8, 2021

Thanks!
So this is in fact something like the tolerance/h-maxima/prominence?
I think it would be very helpful to have a (1D) example of the workflow, including how the images look before and after the reconstruction a.s.o.
Do you think this is doable? Otherwise pretty hard to understand even for professional bioimage analysts ;-)

@dlegland
Copy link
Contributor

dlegland commented Feb 8, 2021

I have started an illustration in 1D case. You can find it here:
https://github.com/ijpb/MorphoLibJ/blob/master/doc/MorphoLibJ-manual/images/reconstruction/extendedMaxima.png

I have the book of Soille under the eyes, the workflow is as follow:

  1. start from function f (-> the dark curve)
  2. consider function f-h, where h is the contrast or dynamic (-> the dashed curve)
  3. perform morphological reconstruction by dilation of (f-h) under f (-> the blue region)
  4. compute the regional maxima of the reconstruction (-> the dark blocks)

On the example, a value of two units was used for the dynamic. Note that the position of the maxima may change for larger value of dynamic. For example, using a dynamic of 1 unit results in same number of maxima, but smaller. Using a value of 3 units will make the left-most maxima disappear.

It is possible to value the maxima depending on the dynamic value that make them disappear, but this is not (yet?) implemented in MLJ.

@tischi
Copy link
Author

tischi commented Feb 9, 2021

@dlegland This is great! Thank you very much!
I think one has all the functions to do this in MLJ, right?
So I could write a macro with line profiles in ImageJ to reproduce this, isn't it?

@dlegland
Copy link
Contributor

dlegland commented Feb 9, 2021

you're welcome! Figure should be included in manual as well, but I'm currently fighting with LaTeX...

Otherwise yes, you can reproduce with macro. The critical point is the reconstruction, but it is easily scriptable.

best!
David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants