Login  Register

Re: custom curve fit side effect?

Posted by Rasband, Wayne (NIH/NIMH) [E] on May 30, 2010; 5:04am
URL: http://imagej.273.s1.nabble.com/custom-curve-fit-side-effect-tp3688135p3688136.html

On May 29, 2010, at 9:37 PM, Chuck Harrison wrote:

> Hi all,
>
> I have a problem with macros becoming uninterruptible after doing a curve fit.
>
> Any ideas?
>
> Chuck

This bug is fixed in the 1.44b13 daily build.

-wayne


> ---- begin included text ----
>
> // Unexpected behavior with custom curve fit (observed in v1.44a)
> // After executing a custom fit, the macro interpreter no longer responds to ESC
>
>  x=newArray (1, 2, 3);
>  y=newArray (2, 4, 6);
>
>  // User-defined fit
>  lineEquation = "y = a + b*x";
>  initialGuesses = newArray(1, 1);
>
>  print("standard fit");
>  Fit.doFit("Straight Line", x, y);
>  Fit.plot();
>
>  print("you CAN interrupt me with ESC here");
>  for(i=0;i<5;i++) {
>    wait(1000);
>    print(i);
>  }
>
>  print("custom fit");
>  Fit.doFit(lineEquation, x, y, initialGuesses);
>  Fit.plot();
>
>  print("you CAN'T interrupt me with ESC here");
>  for(i=0;i<5;i++) {
>    wait(1000);
>    print(i);
>  }
>
>  print("finished.");
>
> ---- end included text ----