How to use "Find Maxima" in a stack



Hello everyone! I’m trying to make a script using Image J macro to count cells in brain tissue.
I would like to know how to use “find maxima” command in a stack. I’m using 1.51 version in a Macbook.


Hello @Paubonaccorso,

If by using it in a stack, you mean using it to find 3D maxima, you can use

3D Maxima Finder
Hope this helps


hi @oburri and @Paubonaccorso,

Yes the 3D maxima finder implements the same algorithm than the 2D algorithm for ImageJ, however note that can be quite slow process :wink: . You may want to try first the classical 3D local maxima as part as the 3D Fast Filters.




Thank you!! It was very helpful!!


Thank you very much!! I will try this option too!


Dear Oliver, I have tried using 3D maxima finder, but it is not as accurate as find maxima. The problem with 3D maxima finder is that I lost many cells; on the other hand the problem with “find maxima” is that I have to process images one by one.
Until I find something better I will have to make a choice between those two.


Hi @Paubonaccorso,

The maxima finder 3D works in 3D, if you do a find maxima 2D you may find the same cell in two adjacent slices. For maxima finder 3D only the local maximum is found in 3D and you get only one dot per cell. You may want to dilate the dot corresponding to the centre using 3D maximum.

Hope this helps.



Enlarge or redraw 3D ROIs