Posted by
gankaku on
Aug 19, 2014; 4:10pm
URL: http://imagej.273.s1.nabble.com/Run-macros-commands-in-Plugin-tp5000744p5009270.html
Hi Mia,
Your first problem might be related the activation of an image. For simple
IJ-functions it is best and easiest if you record your commands with the
Macro Recorder (>Plugins >Macros > Record...).
Therefore, you need to select "Java" from the dropdown menu to not record
it in the IJ macro language.
In your first case, I would expect something like this:
IJ.run(imp, "Enhance Contrast...", "saturated=0 normalize");
the "imp" makes sure that the enhancement is applied to the ImagePlus you
really want to apply it, so you need to specify the correct one.
The same is true for the "Despeckle" command and so on.
IJ.run(imp, "Despeckle", "");
This might solve the problem.
If you are more familiar with Java you can also implement it directly by
using the respective methods (
http://rsbweb.nih.gov/ij/developer/api/).
I can unfortunately not comment on your second "Class not found" problem at
the moment.
Kind regards,
Jan
2014-08-19 17:17 GMT+02:00 mia589 <
[hidden email]>:
> Hi,
>
> I was wondering if someone can help with a related problem.
>
> I've been trying to implement the IJ.run() command in my ImageJ plugin to
> call upon some ImageJ functions.
> However, it doesn't seem to work even though the syntax of my code is
> correct. When I write the following code to enhance contrast, the IJ.run()
> command works:
>
> IJ.run("Enhance Contrast");
>
> But when I want to run a denoising command "Despeckle" or use a "Median..."
> filter the code doesn't initiate any processes. I am writing the code for
> these as follows:
>
> IJ.run("Despeckle");
> IJ.run("Median...");
>
> Similarly, I am also having trouble using the IJ.runPlugIn() command where
> I
> get the error message "Class not found" even though the target PlugIn class
> is in the ImageJ plugin directory.
>
> Your advice would be most appreciated!
> Thank you!
>
>
>
> --
> View this message in context:
>
http://imagej.1557.x6.nabble.com/Run-macros-commands-in-Plugin-tp5000744p5009268.html> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
--
CEO: Dr. rer. nat. Jan Brocher
phone: +49 (0)6234 917 03 39
mobile: +49 (0)176 705 746 81
e-mail:
[hidden email]
info:
[hidden email]
inquiries:
[hidden email]
web: www.biovoxxel.de
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html