Login  Register

curve fitting

Posted by Kenneth Sloan-2 on Dec 14, 2017; 5:11pm
URL: http://imagej.273.s1.nabble.com/curve-fitting-tp5019764.html

I'm about to have two curve/surface fitting problems.  They aren't necessarily
tied to images, per se - but I see (among other things) an ImageJ plugin called CurveFitter.

I'm interested in opinions:

Constraints:
 
 * I'd like to stick to Java code - either as an ImageJ plugin, or stand-alone.
    I can stumble along in R (and am interested in expanding my R skill set);
    MatLab is completely foreign to me (and I'm not eager to learn it)
    Java is "home" and I'm happy to tackle arbitrarily difficult problems there.

 * In 2D, I'm interested in both polynomial functions and also DoG (difference of Gaussians)
   I could probably live with low degree polynomials (perhaps 4-6?)
    - DoG might be an extravagance.  Of course, something that allowed for
   arbitrary code to define a function f(x) or g(x,y) (and derivatives) would work.

 * Once a fit is found, I'd like derivatives of the fitted function - I mostly care
    about zero-derivatives, but min/max are also of interest.  If I'm using a package
    that allowed/required me to write arbitrary f(x) and f'(x)...that's fine.

 * 3D is interesting, but probably a side project.  Here, I'd love to directly fit
    a smooth 2D surface embedded in 3D.  My functions are "almost radially symmetric" - close
    enough that a radially symmetric answer would be OK, but not optimal.  Again, it
    would be useful to have derivative information.  (hint: it appears that 2D DoG is a
    decent fit to the 2D data, but a 3D DoG is not)

 * assume that my 2D data is a set of x,y pairs (with x's being unique), and that
   my 3D data is a set of x,y,z triples (with unique x,y locations).  2D points are
   likely to be equally spaced in x; 3D points should NOT be assumed to follow any
   particular pattern (and certainly not form an "image" in x,y)

 * assume the data is available as a text file, probably in .csv format

For the 2D case, it's not clear to me that ImageJ is the right platform - but it looks like there has been some useful work done.  For the 3D case, ImageJ seems more likely, even though the data do not necessarily form an "image".

So far, I've found "CurveFitter.java" - an ImageJ plugin.  Comments on how well it fits my constraints, and hints on how to best use it would be most welcome.

I'm not sure if answers are of general interest.  Usually it's best to respond to the entire list.  If you prefer, feel free to contact me directly.

Thanks for your help!

--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.

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