subr pixelmaskarea(pw, window, in, nx, ny) ;pw is the pen width to use for the drawn mask ;returns indices of area masked pencolor,'red' ;ty,'to use: put cursor on start position, click quickly once, and move' ;ty,'mouse with button UP (this is easier for detailed work).' ;ty,'Click again to stop.' ;ty,'Do NOT hold button down or it will just give you a dot.' xdraw, pw, window ;drawn, read back and figure mask xq=tvread(window) nx = dimen(xq,0) ny = dimen(xq,1) in=sieve(xq eq iq) ;now remark the area in green so it doesn't interfere with next area xq(in)=!green_pixel tv,xq endsubr ;============================================================================