definition of 2-D ROI by cursor in VB5 
Author Message
 definition of 2-D ROI by cursor in VB5

Does anybody know a simple way to define an irregular (a polygon) 2-D
ROI by drawing a contour by mouse on a displayed image, i.e. to obtain
either coordinate arrays of all pixels inside the contour or a new
images with outside pixel values, say, 0, and inside pixel values equal
to 1?

Is there a simple & fast solution using API? If not, is there a
shareware library that has such a procedure?

(The way I know does not seem to be to be simple: checking every pixel
acquisitin&location when mouse is moving, editing the coordinate array
of the contour, closing the contour, writing routine for filling the
ROI, extraction of coordinate arrays of filled-in pixels, ...)

Thanks,
Jerry



Fri, 29 Oct 1999 03:00:00 GMT  
 definition of 2-D ROI by cursor in VB5

I'm not sure about your question but I think I know what you mean.
To store the points set up a type such as:

Type Pnts
        x as integer
        y as integer
End type

This'll set you up for one point, so now define an array from it:

dim n as Pnts()

and ReDim it as you need (Redim n (index)).

As you draw the countour redim the array and stick the new points in (in
every mousemove events or on a timer). When you want to draw the polygon
use the dll I mentioned earlier, by passing the Pnts type to it.
If you're not sure of the polygon dll I've included my Shapes.bas file,
which has my own functions (poly) and the original DLL. Hope this helps,
and I haven't got entirely the wrong end of the stick!



Quote:
> Does anybody know a simple way to define an irregular (a polygon) 2-D
> ROI by drawing a contour by mouse on a displayed image, i.e. to obtain
> either coordinate arrays of all pixels inside the contour or a new
> images with outside pixel values, say, 0, and inside pixel values equal
> to 1?

> Is there a simple & fast solution using API? If not, is there a
> shareware library that has such a procedure?

> (The way I know does not seem to be to be simple: checking every pixel
> acquisitin&location when mouse is moving, editing the coordinate array
> of the contour, closing the contour, writing routine for filling the
> ROI, extraction of coordinate arrays of filled-in pixels, ...)

> Thanks,
> Jerry

begin 600 SHAPES.BAS
<uuencoded_portion_removed>

`
end


Sun, 07 Nov 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Ado update (informix)-cursor definition?

2. Help - How to make docking forms/toolbars like in VB5 IDE/DS IDE

3. ODBC 3.0 API function definitions for Visual Basic or SQLSetEnvAttr definition

4. WordXP Open DS for MailMerge

5. problem with BindingContext(Ds).EndCurrentEdit()

6. Active DS Type Library

7. System.Drawing.SafeNativeMethods

8. Does ds.execute throw error properly?

9. Ds.Updatable is always false

10. Cursor issue?: UPDATE to DB2 using VB5

11. ds.Move (move to row)

12. Controlling cursor position in Richtext box (VB5)

 

 
Powered by phpBB® Forum Software