Re: Calling CurveFitter from Java; only 4 fit functions work

Posted by Tihamer on
URL: http://imagej.273.s1.nabble.com/Calling-CurveFitter-from-Java-only-4-fit-functions-work-tp5022103p5022109.html

Thanks for the quick reply, Wayne.

Executive Summary:  I can't get a copy of the 1.52o38 jar file.

You wrote:
     >The following JavaScript version of your program should work better.

As far as I can tell, your JavaScript is pretty much identical to the Java I
must use. In psudocode:
1. Create a new CurveFitter with the x and y data.
2. Call doFit().
3. Print the results.

     >It requires the latest ImageJ daily build (1.52o38),

Unfortunately, the maven repo at
https://mvnrepository.com/artifact/net.imagej/ij only goes up to 1.52n. Do
you have any idea when that will get updated?  Do you push to it every once
in a while, or do you depend on them to pull?

I found the latest source code (version 1.52o40) at
https://github.com/imagej/imagej1/blob/c56624301df300ae7e30c26ad9c71ff9025eae46/ij/measure/CurveFitter.java 
So I tried to download the entire ImageJ 1.x repository from
https://github.com/imagej/imagej1/tree/c56624301df300ae7e30c26ad9c71ff9025eae46
but it's a non-maven project that I couldn't pull into Eclipse to generate
my own jar. I noticed the build.xml file. Um... oh, yeah, ant.  I remember
using ant about a decade or two ago, but it would take me a long time to get
back up to speed.  :-(

So I tried getting ImageJA (the maven version of ImageJ), but that only goes
up to version 1.52n.  :-(

Finally, I tried grabbing just your new CurveFitter.java, but it broke with
the same array Index Out of Bounds exception.  :-(  Obviously, there are
more dependencies here--I would probably need to grab all the files manually
to make sure I have to entire fix for the Array Out of Bounds problem.  :-(

     > which fixes a CurveFitter.getResultString() bug that caused it to
fail when there was a fitting error.

The 1.52n code is breaking during the doFit() step, not during the output
printing step, though I do see how you improved CurveFitter.getResultString.

     > Note that you have to construct a new CurveFitter for each fit.

Yes, I did that. Does it look like I didn't?

I hope you can create a 1.52o38 (or later) jar file for the maven repo, or
update ImageJA sometime soon.

Thanks again for your help so far.






--
Sent from: http://imagej.1557.x6.nabble.com/

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