Running a Gaussian Fit in a Beanshell Script
Posted by Burni on Mar 30, 2014; 9:40pm
URL: http://imagej.273.s1.nabble.com/Running-a-Gaussian-Fit-in-a-Beanshell-Script-tp5007134.html
Greetings,
I'm writing a little programm with Beanshell and at one point I need to fit a set of points with a Gaussian function.
Theoretically, it should look something like this:
double[] x = new double [] {0, 1, 2, 3, 4, 5};
double[] y = new double [] {0, 0.9, 4.5, 8, 18, 24};
//ij.Fit.doFit("Gaussian", x, y);
ij.IJ.run("Curve Fitting...");
With the last line, I can at least start the Curve Fitter, but I want to automatically use the the values of the arrays x and y. The command I made a comment would work in the ImageJ macro language, but I don't know how to use it in Beanshell.
Also, after the fit is done, I want to automatically extract the values of the fitting parameters (a, b, c....).
Could someone please help me with this?
Burni