freehand ROI and mask with IDLanROI. Solution. [message #35082] |
Wed, 14 May 2003 13:17 |
Sergey Koposov
Messages: 7 Registered: April 2003
|
Junior Member |
|
|
Hello,All!
Recently, I have posted the message with the question, how to create the
freehand ROI and mask , using classes IDL??ROI, but without using
superfluous programs as xroi :).The problem was in fact that IDLgrROI
does not contain freehand lines. ANd IDLanROI contain freehand line, but
the mask maked by standart functions of class can be only the boundary
of freehand line.
David (in reply to my message) have proposed one (nondirect ) method.
But I have invent a small piece of code which allow to construct the
freehand ROI , and after that compute the mask using standart fuctions
of class.
;to test this code the image must
;be loaded
oROI = OBJ_NEW('IDLanROI', TYPE=2) ;I want to point that in spite of
CURSOR, x_cur, y_cur, /UP, /DEVICE ; option "TYPE=2" the ROI will
oROI->AppendData, x_cur, y_cur ; bounded by freehand line
PLOTS, x_cur, y_cur, PSYM=1, /DEVICE
while !mouse.button ne 4 do begin
cursor,x_cur,y_cur,2, /DEVICE
plots,x_cur,y_cur,/continue,/device
oROI->AppendData, x_cur, y_cur
end
; mask can be computed using:
mask=oROI->ComputeMask(dimensions=[dimx,dimy],mask_rule=2)
I think that my idea could be useful.
Please correct me if it was evident from the very outset and if I
wrongly understand something - I'm not the big professional in IDL
programming :)
Excuse me for the BIG message
Sergey
|
|
|