Login  Register

Re: Finding Multiple Peaks in a Plot Profile

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:

> Hello,
>
> this is my first post in this forum and I'm not very experienced with
> ImageJ.
> I've been looking for help with a particular problem where I'll probably be
> using the Plot Profile of an image.
> The following is an example of the raw image I'll be using:
>
> <http://imagej.1557.x6.nabble.com/file/n5006959/HITRAP_IH_EA_2011.09.21_21.05.42.752_ImgID_245.png>
>
> This one is basicly the same, but I adjusted the contrast a little so you
> can better see what's happening.
>
> <http://imagej.1557.x6.nabble.com/file/n5006959/HITRAP_IH_EA_2011.09.21_21.05.42.752_ImgID_245_Edit.png>
>
> When I generate the Plot Profile of that image using control+alt+k (I
> specifically need this one, not the one using control+k), I get this:
>
> <http://imagej.1557.x6.nabble.com/file/n5006959/PlotProfile.png>
>
> What I'm finally looking for is a way to reliable find the positions (or
> more specifically the x-coordinates) of these peaks in whatever Plot Profile
> I generate. There is a different number and height of peaks depending on
> each picture.
>
> <http://imagej.1557.x6.nabble.com/file/n5006959/PlotProfile_Peaks.png>
>
> My first guess was to use the fitting tool of ImageJ, but it seems to be too
> limited to use it for this task.
> I'm not even sure if fitting would be necessary at all.
> I would be very thankful for any suggestions on how to go about this
> problem.
> I uploaded the raw image below.
>
> Thanks in advance to anyone, who might help me.
>
> HITRAP_IH_EA_2011.09.21_21.05.42.752_ImgID_245.png
> <http://imagej.1557.x6.nabble.com/file/n5006959/HITRAP_IH_EA_2011.09.21_21.05.42.752_ImgID_245.png>  
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Finding-Multiple-Peaks-in-a-Plot-Profile-tp5006959.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html