Painting over the ROI

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

Painting over the ROI

Daniel Lélis Baggio
Hi,
I've been trying to make a plug in paint it's anchor points over the ROI
points.
I'm using a polygon Roi, like this:
**********
            Polygon p = new Polygon(selx,sely,size[0]+selSize);

            pRoi = new PolygonRoi(p,Roi.FREELINE);
            img.setRoi(pRoi);
            paintPoints();
***********
And selx and sely points to a vector of points of the selection.
But there are a few points of the selections that I store in another
ArrayList, and I wanted to highlight them.
To do this, I call the paintPoints() function, which is something like:
************************************
private void paintPoints() {
        ImageCanvas ic;
        ic = img.getCanvas();
        Graphics g = ic.getGraphics();
        g.setColor(Roi.getColor());
        for(int i=0;i<anchor.size();i++){
            int myx = (int) ((Point)(anchor.get(i))).getX();
            int myy = (int) ((Point)(anchor.get(i))).getY();

            g.drawRect(    ic.screenX(myx),
                        ic.screenY(myy),10,10);
        }
    }
}
****************************
The Rectangles are drawn on the desired points, but, somewhere in the code,
the repaint function is called, and they start to flicker, giving the user a
bad sensation.
Has anyone dealed with this problem in someplugin?
If so, what's the easiest way to go around it?
Thanks for your feedback.
[]'s
Reply | Threaded
Open this post in threaded view
|

Re: Painting over the ROI

Daniel Lélis Baggio
Well, it seems that the best way around it is to extend the PolygonRoi class
and overide the draw method. Does Wayne agree with it?
Thanks OOP!
[]'s
Reply | Threaded
Open this post in threaded view
|

plotting measurements through a stack

Robert Martin-3
Hi,

I am wondering if anyone has written a plug-in to plot the average  
(of a region of interest) versus slice number; and, if so, how  
difficult would it be to do the same for other measurements (std  
deviation etc)?  Could these values be output to other programs as well?

Robert  Martin
Reply | Threaded
Open this post in threaded view
|

Re: plotting measurements through a stack

Wayne Rasband
> I am wondering if anyone has written a plug-in to plot the average (of
> a region of interest) versus slice number; and, if so, how difficult
> would it be to do the same for other measurements (std deviation etc)?
>  Could these values be output to other programs as well?

The Image>Stacks>Plot Z-axis Profile command does this. Use the
Analyze>Set Measurements command to specify other measurements such as
standard deviation. Output the values to other programs by right
clicking on the Results window and selecting "Save As" or "Copy".

-wayne