Login  Register

Re: Running a Gaussian Fit in a Beanshell Script

Posted by bnorthan on Mar 31, 2014; 10:27am
URL: http://imagej.273.s1.nabble.com/Running-a-Gaussian-Fit-in-a-Beanshell-Script-tp5007134p5007143.html

Hi Burni

You can access the plot function of the plugin.

http://rsb.info.nih.gov/ij/developer/source/ij/plugin/frame/Fitter.java.html

You need to pass the plot function the CurveFitter instance.  This line
should do it -

ij.plugin.frame.Fitter.plot(fitter);

//////////////////////////////////////////////////////////////////////////

double[] x = new double [] {0, 1, 2, 3, 4, 5};
double[] y = new double [] {0, 0.9, 4.5, 8, 18, 24};

CurveFitter fitter=new CurveFitter(x, y);

fitter.doFit(1);

double[] results=fitter.getParams();

for (double d:results)
{
    print(d);
}

ij.plugin.frame.Fitter.plot(fitter);


On Mon, Mar 31, 2014 at 5:31 AM, Burni <[hidden email]> wrote:

> Hi Brian,
>
> thanks for your help! Is there a way to activate the plot window that would
> be shown when using the curve fitter in ImageJ manually? For example this:
>
> <http://imagej.1557.x6.nabble.com/file/n5007142/GaussianFit.png>
>
> I know the getresiduals function gives me the error values, but having the
> actual image of the fitted curve and the points is an easy way to get a
> quick impression of the quality of the fit.
>
> Burni
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/Running-a-Gaussian-Fit-in-a-Beanshell-Script-tp5007134p5007142.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