I need to find a way to allow a user to trace an arbitrary region of a
displayed image with a mouse and capture the outlined area as a 'region of
interest' (ROI) I've looked at the Java Advanced Imaging classes and they
seem to have what I need to manage the data.
But is is not clear how to handle the UI part where the user defines the
ROI. I would appreciate any pointers, code snippets, etc on how to
accomplish this. Is there a Java class that will handle the acquisition?
Thanks in advance.
jim cant
Oliver Wong - 23 Mar 2006 21:14 GMT
>I need to find a way to allow a user to trace an arbitrary region of a
>displayed image with a mouse and capture the outlined area as a 'region of
[quoted text clipped - 4 lines]
> ROI. I would appreciate any pointers, code snippets, etc on how to
> accomplish this. Is there a Java class that will handle the acquisition?
Is the user to click on the vertex of every polygon defining the ROI, or
is the user to click and hold down the button to continuously draw the edge
of the shape?
In either cases, you basically need to think of the Polygon class as a
List of Points, and the solution should fall into place. (I wonder why
java.awt.Polygon doesn't implement List<Point> actually).
- Oliver
Roedy Green - 23 Mar 2006 21:43 GMT
On Thu, 23 Mar 2006 15:07:46 -0500, "news.rcn.com"
<cant_jim@hotmail.com> wrote, quoted or indirectly quoted someone who
said :
>But is is not clear how to handle the UI part where the user defines the
>ROI. I would appreciate any pointers, code snippets, etc on how to
>accomplish this. Is there a Java class that will handle the acquisition?
paint the image on a Canvas on JPanel. Then capture mouse move events
You then have the problem of cleaning that up into a polygon. Perhaps
you draw a line as you go making a node at each click and removing the
last one at each right click.
Java In A Nutshell in the Introduction to AWT does a little drawing
program. I'm not sure if it still there in the latest edition.
see http://mindprod.com/jgloss/who.html under Flanagan

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.