macro to plugin issues

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

macro to plugin issues

jvander
Hello,

I recorded a macro and then converted to a plug-in and got unexpected errors.  Most commands
worked but a few didn't.  For example

duplicate image worked and close image did not.

After closer examination, I figured out that the Macro to plug-in converter was incorrectly
'translating.'  For example, duplicate correctly went from

run("Duplicate...", "title=Herm_pos");

to

IJ.run("Duplicate...", "title=name1");

but close went from

close();

to

IJ.close();

but should have been

IJ.run("Close");

Am I doing something wrong in making the conversion?   To create a plug-in, I record a macro,
run it and then choose "convert to plug-in".

Or is this a problem with the converter?

I am running ImageJ 1.34s Java 1.4.2_09 on Mac OS 10.4.5

thanks,

Joe van der Gracht
Reply | Threaded
Open this post in threaded view
|

Curve Fitting in a macro

Michael Cammer
I would love to be able to get results from a curve fit using a macro.

I'm getting a list of numbers from an image that I need to fit to a simple
exponential.  I would love to be able to do something like:

   X = newArray(256);
   Y = newArray(256);
   Xfit = newArray(256);
   Yfit = newArray(256);
   //do some stuff here to load X and Y with meaningful values
   fitCurve(X, Y, Xfit, Yfit, "exponential");
   // do some stuff here to look at the arrays with the fits

For my need, having the other results listed in the Log window is fine.

Is this possible?

Thanks!
____________________________________________________________________________
Michael Cammer   Analytical Imaging Facility   Albert Einstein Coll. of Med.
URL:  http://www.aecom.yu.edu/aif/ 
Reply | Threaded
Open this post in threaded view
|

Re: Curve Fitting in a macro

Wayne Rasband
On Mar 24, 2006, at 10:18 AM, Michael Cammer wrote:

> I would love to be able to get results from a curve fit using a macro.
>
> I'm getting a list of numbers from an image that I need to fit to a
> simple exponential.  I would love to be able to do something like:
>
>   X = newArray(256);
>   Y = newArray(256);
>   Xfit = newArray(256);
>   Yfit = newArray(256);
>   //do some stuff here to load X and Y with meaningful values
>   fitCurve(X, Y, Xfit, Yfit, "exponential");
>   // do some stuff here to look at the arrays with the fits
>
> For my need, having the other results listed in the Log window is fine.
>
> Is this possible?

It will be possible when I add a fitCurve() function to the macro
language. This is on my "to do" list.

-wayne