# Find maxima .. algorithm discription

11 messages
Open this post in threaded view
|

## Find maxima .. algorithm discription

 Is there a document that details the "Find Maxima" algorithm by Michael Schmid? Thanks, HPatel
Open this post in threaded view
|

## Re: Find maxima .. algorithm discription

 Hi, sorry, there is no publication on it (at least none that I am aware of, probably I have reinvented the wheel), but it is rather simple code: (1) Find the local maxima (2) Sort them in descending sequence (3) For each local maximum, do a flood fill algorithm with the gray level tolerance (without modifying the original, it is done on a temporary scratch image). Maxima where flood filling reaches a previously filled area (i.e., area of other maximum within the tolerance) are discarded. (4) In case of 'single points' output, if there are several points having the highest value inside the flood-filled area, use the one that is closest to their geometric center. Segmentation is a bit more difficult (it stems from older ImageJ versions), and I am currently about to see whether it can't be done faster and with better accuracy... Michael _____________________________________________________________________ On Wed, December 9, 2009 22:00, HPatel wrote: > Is there a document that details the "Find Maxima" algorithm by Michael > Schmid? > > Thanks, > HPatel
Open this post in threaded view
|

## Re: Find maxima .. algorithm discription

 Michael, Thanks for this. Do you know if someone has converted this to C++ or C? Thanks, Hitesh Michael Schmid-3 wrote Hi, sorry, there is no publication on it (at least none that I am aware of, probably I have reinvented the wheel), but it is rather simple code: (1) Find the local maxima (2) Sort them in descending sequence (3) For each local maximum, do a flood fill algorithm with the gray level tolerance (without modifying the original, it is done on a temporary scratch image). Maxima where flood filling reaches a previously filled area (i.e., area of other maximum within the tolerance) are discarded. (4) In case of 'single points' output, if there are several points having the highest value inside the flood-filled area, use the one that is closest to their geometric center. Segmentation is a bit more difficult (it stems from older ImageJ versions), and I am currently about to see whether it can't be done faster and with better accuracy... Michael _____________________________________________________________________ On Wed, December 9, 2009 22:00, HPatel wrote: > Is there a document that details the "Find Maxima" algorithm by Michael > Schmid? > > Thanks, > HPatel
Open this post in threaded view
|

## Re: Find maxima .. algorithm discription

 Hi Hitesh, no sorry, no idea about a C or C++ code like this. But it should be   straightforward... Michael ________________________________________________________________ On 11 Dec 2009, at 20:58, HPatel wrote: > Michael, > > Thanks for this. > Do you know if someone has converted this to C++ or C? > > Thanks, > Hitesh > > > > Michael Schmid-3 wrote: >> >> Hi, >> >> sorry, there is no publication on it (at least none that I am   >> aware of, >> probably I have reinvented the wheel), but it is rather simple code: >> (1) Find the local maxima >> (2) Sort them in descending sequence >> (3) For each local maximum, do a flood fill algorithm with the   >> gray level >> tolerance (without modifying the original, it is done on a temporary >> scratch image). Maxima where flood filling reaches a previously   >> filled >> area (i.e., area of other maximum within the tolerance) are   >> discarded. >> (4) In case of 'single points' output, if there are several points   >> having >> the highest value inside the flood-filled area, use the one that is >> closest to their geometric center. >> >> Segmentation is a bit more difficult (it stems from older ImageJ >> versions), and I am currently about to see whether it can't be   >> done faster >> and with better accuracy... >> >> Michael >> _____________________________________________________________________ >> >> >> On Wed, December 9, 2009 22:00, HPatel wrote: >>> Is there a document that details the "Find Maxima" algorithm by   >>> Michael >>> Schmid? >>> >>> Thanks, >>> HPatel >> >> > > -- > View this message in context: http://n2.nabble.com/Find-maxima-  > algorithm-discription-tp4141919p4153412.html > Sent from the ImageJ mailing list archive at Nabble.com.
Open this post in threaded view
|

## Re: Find maxima .. algorithm discription

 In reply to this post by Michael Schmid-3 Hi, sorry, there is no publication on it (at least none that I am aware of, probably I have reinvented the wheel), but it is rather simple code: (1) Find the local maxima (2) Sort them in descending sequence (3) For each local maximum, do a flood fill algorithm with the gray... Dear Michael, I have a followup question about this algorithm. In the ImageJ documentation for "Find Maxima,"  it is stated "Maxima are ignored if they do not stand out from the surroundings by more than [the noise tolerance]." I would have expected that this means that there must be a nonzero number of pixels contiguous with a maximum that exceed the threshold, defined as the maximum minus the noise tolerance. However, when I used the "Maxima within tolerance" option for the output of "Find Maxima", which the documentation suggests should return all contiguous pixels around the maximum that exceed this threshold, it returned numerous maxima with just one point. This seems inconsistent with my interpretation of how the noise tolerance is used to reject maxima that do not stand out from their surroundings. Could you clarify how the noise tolerance is used to decide which maxima are ignored?
Open this post in threaded view
|

## Re: Find maxima .. algorithm discription

 In reply to this post by Michael Schmid-3 Hi, sorry, there is no publication on it (at least none that I am aware of, probably I have reinvented the wheel), but it is rather simple code: (1) Find the local maxima (2) Sort them in descending sequence (3) For each local maximum, do a flood fill algorithm with the gray... Dear Michael, I have a followup question about this algorithm. In the ImageJ documentation for "Find Maxima,"  it is stated "Maxima are ignored if they do not stand out from the surroundings by more than [the noise tolerance]." I would have expected that this means that there must be a nonzero number of pixels contiguous with a maximum that exceed the threshold, defined as the maximum minus the noise tolerance. However, when I used the "Maxima within tolerance" option for the output of "Find Maxima", which the documentation suggests should return all contiguous pixels around the maximum that exceed this threshold, it returned numerous maxima with just one point. This seems inconsistent with my interpretation of how the noise tolerance is used to reject maxima that do not stand out from their surroundings. Could you clarify how the noise tolerance is used to decide which maxima are ignored?
Open this post in threaded view
|

## Re: Find maxima .. algorithm discription

 Hi Ayman, maybe an example is best: Say, you have a maximum of pixel value 100 and the tolerance is 10. If the maximum is a single pixel surrounded by pixels with a value   less than 100-10=90, then 'Maximum within tolerance' will give you   that pixel only. If it has a neighbor of, say, pixel value 95, and everything around   this is below 90, 'Maximum within tolerance' gives you these two   pixels, the one with 100 and with 95. If there are three adjacent pixels in a row, with values 100, 91 and   98, everything else below 90, they will be considered a single   maximum and you will see all three pixels in 'Maximum within tolerance'. If the three pixels in a row are 100, 89, 95, again everything else   below 90, only the '100' will be considered 'Maximum within   tolerance', because the 89 is below the tolerance limit. The 95 is   not separated from the next maximum (the '100') by a value less than   95-10=85, so it is not considered a maximum. If the three pixels are 100, 84, 95, everything around them not   higher than 84, you get two maxima, each one pixel large: the '100'   and the '95'. Michael ________________________________________________________________ On 6 Jul 2011, at 23:12, Ayman wrote: > Hi, > > sorry, there is no publication on it (at least none that I am aware   > of, > probably I have reinvented the wheel), but it is rather simple code: > (1) Find the local maxima > (2) Sort them in descending sequence > (3) For each local maximum, do a flood fill algorithm with the gray... > > Dear Michael, > > I have a followup question about this algorithm. In the ImageJ   > documentation > for "Find Maxima,"  it is stated "Maxima are ignored if they do not   > stand > out from the surroundings by more than [the noise tolerance]." I   > would have > expected that this means that there must be a nonzero number of pixels > contiguous with a maximum that exceed the threshold, defined as the   > maximum > minus the noise tolerance. > > However, when I used the "Maxima within tolerance" option for the   > output of > "Find Maxima", which the documentation suggests should return all   > contiguous > pixels around the maximum that exceed this threshold, it returned   > numerous > maxima with just one point. This seems inconsistent with my   > interpretation > of how the noise tolerance is used to reject maxima that do not   > stand out > from their surroundings. > > Could you clarify how the noise tolerance is used to decide which   > maxima are > ignored? > > -- > View this message in context: http://imagej.588099.n2.nabble.com/  > Find-maxima-algorithm-discription-tp4141919p6556029.html > Sent from the ImageJ mailing list archive at Nabble.com.
Open this post in threaded view
|

## Re: Find maxima .. algorithm discription

 Dear Michael, I searched the source code archive in ImageJ's developer resources and was unable to find the source code for "Find Maxima". Do you know where this code might be available? I ask because there are many different algorithms for flood filling and I'd like to incorporate the one that "Find Maxima" uses. Alternatively, would you be able to provide the source code? Ayman Hi Ayman, maybe an example is best: Say, you have a maximum of pixel value 100 and the tolerance is 10. If the maximum is a single pixel surrounded by pixels with a value   less than 100-10=90, then 'Maximum within tolerance' will give you   that pixel only. If it has a neighbor of, say, pixel value 95, and everything around   this is below 90, 'Maximum within tolerance' gives you these two   pixels, the one with 100 and with 95. If there are three adjacent pixels in a row, with values 100, 91 and   98, everything else below 90, they will be considered a single   maximum and you will see all three pixels in 'Maximum within tolerance'.
Open this post in threaded view
|

## Re: Find maxima .. algorithm discription

 Hi Ayman, On 14.07.2011 6:53 PM, Ayman wrote: > I searched the source code archive in ImageJ's developer resources and was > unable to find the source code for "Find Maxima". Do you know where this > code might be available? I ask because there are many different algorithms > for flood filling and I'd like to incorporate the one that "Find Maxima" > uses. Alternatively, would you be able to provide the source code? When you start "Plugins > Utilities > Find Commands..." or just press [L], and then type your command of interest "Find Maxima" with "Show full information" checked, you will see that the command resides in Find Maxima... (in Process) [ij.plugin.filter.MaximumFinder] You can find the source code for example on Fiji's git repository: http://fiji.sc/cgi-bin/gitweb.cgi?p=imagej.git;a=blob;f=ij/plugin/filter/MaximumFinder.javaHope that helps, Jan