The Roi.drawPixels() method draws the selection outline on the image
using the current drawing color, which is set using
ImageProcessor.setColor(). Here is an example:
ImagePlus imp = new ImagePlus(pathOrURL);
ImageProcessor ip = imp.getProcessor();
imp.show();
Roi roi = new Roi(100,100,50,50);
imp.setRoi(roi);
ip.setColor(Color.RED);
roi.drawPixels(ip);
imp.updateAndDraw();
-wayne
On Sep 1, 2006, at 10:13 AM,
[hidden email] wrote:
> Hi all,
> I'm trying to use IJ api, but ROI does not work at all.
> I attach a fragment of my code.
>
> ------------------
> ImagePlus _imp = new ImagePlus(_pathOrURL);
> ImageProcessor _ip = _imp.getProcessor();
> _imp.setTitle("test image");
> _imp.show();
>
> Roi _roi = new Roi(250,305,300,420);
> _roi.setImage(_imp);
> _roi.setName("test_roi_use");
> _roi.setColor(Color.RED);
>
> _roi.drawPixels();
> _imp.updateAndRepaintWindow();
> -----------------------------------
>
> roi is correctly display but it is BLACK and NOT RED how it should be..
> Where I mistake?
> Thanks all, by
>
> Nicola B.
>