Quickly Erasing lines on direct graphics images [message #46268] |
Sat, 12 November 2005 07:18 |
Richard French
Messages: 173 Registered: December 2000
|
Senior Member |
|
|
I have a Direct Graphics question. How can I quickly erase lines that I have
drawn in displayed images?
For example, let's say I have a distant image of Mars and I want to draw my
initial guess for the location of the outline of the planet. Based on what
the guess looks like, the user will interactively adjust the location of the
assumed center of the planet in the image (using slider widgets for the x
and y offsets of the center location), and then redraw the outline of the
planet. Once this looks 'good enough', an IDL routine will take over and do
the final tweaking, but I need a reasonable initial condition to do the fit.
The question is, how can I keep track of the pixels that were drawn so that
I can erase the initial lines and replace them with the next guesses,
without having to redisplay the entire image? My students are running this
program over the network, so it is very slow to redraw the image just to
erase the points.
Here's an example in metacode of the slow way:
dx=0.0
dy=0.0
Xoutline=[some_array_of_pixel_locations]
Youtline=[another_array_of_pixel_locations]
AGAIN:
Tvscl,MarsImage
Plots,/DEV,Xoutline_+dx,Youtline+dy, THICK=2
Read,prompt='Enter dx,dy offsets:',dx,dy
Goto,AGAIN
How can I avoid the TVSCL step in the loop?
Conceptually, one way to do this would be to figure out exactly what pixels
are being affected by the Plots command (i.e., which pixels are involved in
drawing the thick lines I've requested above) and restore them to the
original values when I want to erase the lines, but I don't know how to do
that step.
Thanks,
Dick French
|
|
|