How to use Macro built in function in my plugin?

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

How to use Macro built in function in my plugin?

jiajian shen
Hi All,

Sorry to bother again.  This list really helps me a lot in ImageJ coding.

I have another question about the Marco and plugin.  I wrote a Marco code
and it runs well.  Due to some reason, I want to change the Macro to a
PluginFilter.  Now the problem is that a lot of the convenient built in
functions in Macro can not be recognized by Plugin, "makeLine(xc, yc, xb,
yb)".  My question is that where I can find the source codes of these built
in functions?  If I find these built in function source codes, I can get the
idea how these functions are built, and then I can rewrite these functions
in my plugin?  Am I right? Or is there an better way to link the Macro
functions to plugin?

Thanks a lot,
Jiajian
Reply | Threaded
Open this post in threaded view
|

Re: How to use Macro built in function in my plugin?

Albert Cardona
jiajian shen,

Explore the java API, particularly the ImagePlus and ImageProcessor classes.
They have most of what you need.

http://rsb.info.nih.gov/ij/developer/api/index.html

Albert

--
Albert Cardona
http://www.mcdb.ucla.edu/Research/Hartenstein/acardona
Reply | Threaded
Open this post in threaded view
|

Re: How to use Macro built in function in my plugin?

Wayne Rasband
In reply to this post by jiajian shen
The built in macro functions are implemented in the
ij/macro/Functions.java source file, which is online at

     
http://rsbweb.nih.gov/ij/developer/source/ij/macro/Functions.java.html

You should probably convert the macro to a PlugIn rather than a
PlugInFilter.  IJ.run("Command") calls can cause "image locked" errors
in a PlugInFilter.

-wayne

On Jan 31, 2008, at 12:22 PM, jiajian shen wrote:

> Hi All,
>
> Sorry to bother again.  This list really helps me a lot in ImageJ
> coding.
>
> I have another question about the Marco and plugin.  I wrote a Marco
> code
> and it runs well.  Due to some reason, I want to change the Macro to a
> PluginFilter.  Now the problem is that a lot of the convenient built in
> functions in Macro can not be recognized by Plugin, "makeLine(xc, yc,
> xb,
> yb)".  My question is that where I can find the source codes of these
> built
> in functions?  If I find these built in function source codes, I can
> get the
> idea how these functions are built, and then I can rewrite these
> functions
> in my plugin?  Am I right? Or is there an better way to link the Macro
> functions to plugin?
>
> Thanks a lot,
> Jiajian
>