trying to learn ImageJ

Posted by Charles R Parker on
URL: http://imagej.273.s1.nabble.com/User-interaction-in-Macros-tp3693110p3693112.html

I am beginning (again) to learn ImageJ by creating simple macros and
plugins. However, when I created the following macro using the Recorder,
and converted it to a Plugin using the Edit>Convert to Plugin command, the
resulting plugin fails to compile. The IJ.roiManager("Add") and
IJ.roiManager("Label") lines result in "cannot find symbol" errors

Why is that?

Is there a better way to perform those functions in a Plugin? (I'm using
ImageJ 1.42k with Java 1.6)

Recorded macro:
        run("ROI Manager...");
        makeRectangle(1788, 1392, 489, 249);
        roiManager("Add");
        roiManager("Label");

Converted to Plugin:
        import ij.*;
        import ij.process.*;
        import ij.gui.*;
        import java.awt.*;
        import ij.plugin.*;

        public class TestroiManager_ implements PlugIn {

                        public void run(String arg) {
                        IJ.run("ROI Manager...");
                        IJ.makeRectangle(1788, 1392, 489, 249);
                        IJ.roiManager("Add");
                        IJ.roiManager("Label");
                }

        }

Thanks,
Chuck
=========================
Charles R. Parker, Ph.D.
Research Aquatic Biologist
U. S. Geological Survey
1316 Cherokee Orchard Road
Gatlinburg, TN 37738

E-mail: [hidden email]
Phone: (865) 436-1704