Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

How to define Region of Interest in an image with mouse

Thread view: 
news.rcn.com - 23 Mar 2006 21:07 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
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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.