04-01-2011 04:58 PM
I am trying to capture roi at two different instances. One at mouse click down and the next at mouse up - see attached image for reference. Please can someone suggest a way to accomplish this process? None of my implementations has worked satisfactorily.
04-04-2011 02:42 PM
Hi aderogba,
I'm not exactly sure how you are producing that image in your VI, but if you are placing it in a control on the front panel, you should be able to use an Event Structure to trigger events on your Mouse Down and Mouse Up events from that Control.
Check out this link as a starting point for using Event Structures: http://decibel.ni.com/content/docs/DOC-5347
Have a great day,
Chris
04-04-2011 04:55 PM
Yes I am using event structure. Any suggestion on to separately capture mouse down and mouse up ROI?
04-05-2011 12:02 PM
Hi aderogba,
The elliptical ROI tool, which you have used in your example image, requires 4 coordinates that define a Global Rectangle that encompasses the elliptical ROI selection. That being said, for you to select an ROI on both the mouse down and mouse up events, you'll have to specify some of the points in the global rectangle as constants otherwise you won't be providing enough information to construct the ROI.
If you want to post some of your code I may be able to take a look at it to see what you're doing wrong.
Paul M
04-06-2011 11:34 AM - edited 04-06-2011 11:36 AM
I dont want to have to specify constant. My objective is simply to capture ROI before mouse click and ROI after mouse click (I expect user to at least change the shape) then compute my delta x and delta y based on the dimension of the rectangles that define captured ROIs. If no change was made then my delta will be 0.
04-08-2011 09:17 AM
Hi aderogba,
I think I understand what you're trying to do now. However, my only confusions is how the ROI is going to be defined in the first place. If you are selecting an ROI on an image with your mouse then you need to have both the mouse down and mouse up in order to provide enough information to define the ROI.
Do you have any code that you can post so that I can get a better idea of what you're actually trying to accomplish?
As I mentioned before the mouse down click when selecting an ROI on an image only defines two of the four boundaries required to create the ROI. This is why I'm finding it difficult to understand how you would actually capture an entire ROI with a single mouse down.
Paul M