Dynamic ROI

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

Dynamic ROI

matheus_viana
Hi Guys.

I'm trying to implement a sort of snake algorithm, but I'm having hard time to figure out how to update the ROI coordinates. Basically I know how to retrieve the x/y coordinates by using the roi.getPolygon().x/ypoints. But then, After performing a given operation over these points, how to update the roi? And then show the updated version on screen?

Let's say we want to move the ROI 50 pixels in x. Right now my code would look like this:

Roi ROI = IM.getRoi();
Polygon P = ROI.getPolygon();
for (int i = 0; i < P.npoints; i++) {
        P.xpoints[i] += 50;
}

Then, what to do next?

Best,
Matheus