Automate FWHM and s:n calculation of more than one peak in a varied data set

I have a macro which exports the line profiles along each z-plane of all 3D images (z-stacks) in a folder in a txt file (1 text file for each z-stack). Depending on the sample I might have more than one peak (right now I have between 3 and 6). The line profiles vary dramatically in terms of s:n and peak height.
I want to extend it now to output the FWHM of each peak and the s:n (which is probably trickier) for each slice as well.
I started writing a code now in Python to help me quantify (or visualise) these line profiles, but it would be a lot easier to keep it all in Fiji since I don’t know who will be using the code later on.
In ImageJ: Analyze -> Tools -> Curve fitting -> Gaussian - seems to detect only one peak.
Any help would be appreciated!

Hi @Isq

When I’ve done this before, I’ve used scripting to loop through all the peaks in the image and do the curve fitting for each one sequentially.

If that sounds helpful, you may find parts of this macro code useful:

https://bitbucket.org/davemason/fwhm_spotanalysis

1 Like

thank sso much for sharing your code, I haven’t had the chance to finish this because I got busy with other stuff but will take a look at it now, I hope it’s ok if I ask questions if I have any :slight_smile:

1 Like