Posted by
Michael Schmid on
Mar 18, 2014; 6:43pm
URL: http://imagej.273.s1.nabble.com/Finding-Multiple-Peaks-in-a-Plot-Profile-tp5006959p5006976.html
Hi Burni,
here is an idea for a different approach:
- Duplicate the image and smooth it (if it is just 8 bits like your example, convert it to float before). On the example, the 'mean' or 'border limited mean' of the Fast Filters plugin with a radius of 5 in x and 1 in y may be reasonable. Maybe smooth twice.
- Run 'Find Maxima' with suitable tolerance to find the maxima (use preview), output type List (i.e., Results Table).
- On the original image, create a rectangle of fixed width (rather large) and height (rather small) for each, do a profile and fit it.
All this can be automated in a macro.
- It may happen that rectangles overlap. The 'Find Maxima' output is sorted in descending height. So, after creating a profile for each rectangle, you might set the pixel values to NaN (not a number; needs a float image). In the line profile, you have to eliminate the NaN's before fitting. This is a crude way of avoiding too much influence of a large peak on the small one. Of course, it does not account for overlapping peaks, where you would have to subtract one from the other.
--
Already a while ago, I thought about adding a 'double Gaussian' fit to ImageJ (with and without constant background). The problem is finding suitable starting values; without them such a fit will usually fail. If someone knows a good algorithm that also works with overlapping peaks, let me know!
--
Another thought: If all your peaks should have the same shape (instrument response function, etc), it is actually a deconvolution problem, and you might try various deconvolution plugins.
--
By the way, when cranking up the contrast your images show a pattern of parallel (roughly diagonal) stripes, and also other spots in the FFT. Also the peaks seem to be modulated by this periodicity. It would be good to get rid of such artifacts, that would make peak fitting easier!
Michael
________________________________________________________________
On Mar 17, 2014, at 23:51, Burni wrote:
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html