overplotting lines over images [message #7401] |
Wed, 13 November 1996 00:00  |
Mirko Vukovic
Messages: 124 Registered: January 1996
|
Senior Member |
|
|
I want to overplot lines over an image. The way I'd like it is to OR
it, in the sense that the line is dark over light parts and light over
dark parts. Thought that I've seen that written or mentioned somewhere,
but cannot find anything in the manual.
Did anyone deal with this before?
tia,
--
Mirko Vukovic, Ph.D 3075 Hansen Way M/S K-109
Varian Associates Palo Alto, CA, 94304
415/424-4969 mirko.vukovic@varian.grc.com
|
|
|
Re: overplotting lines over images [message #7494 is a reply to message #7401] |
Thu, 14 November 1996 00:00  |
Mirko Vukovic
Messages: 124 Registered: January 1996
|
Senior Member |
|
|
Christian Soeller wrote:
>
> Mirko Vukovic <mirko.vukovic@grc.varian.com> writes:
>
>> I want to overplot lines over an image. The way I'd like it is to OR
>> it, in the sense that the line is dark over light parts and light over
>> dark parts. Thought that I've seen that written or mentioned somewhere,
>> but cannot find anything in the manual.
>
The solution I adopted was to use the
device,get_graphics_function=foo,set_graphics_function=xxx
as was suggested to me by Tim ???
thanks again
--
Mirko Vukovic, Ph.D 3075 Hansen Way M/S K-109
Varian Associates Palo Alto, CA, 94304
415/424-4969 mirko.vukovic@varian.grc.com
|
|
|
Re: overplotting lines over images [message #7496 is a reply to message #7401] |
Thu, 14 November 1996 00:00  |
Robert Moss
Messages: 74 Registered: February 1996
|
Member |
|
|
Mirko Vukovic wrote:
>
> I want to overplot lines over an image. The way I'd like it is to OR
> it, in the sense that the line is dark over light parts and light over
> dark parts. Thought that I've seen that written or mentioned somewhere,
> but cannot find anything in the manual.
>
> Did anyone deal with this before?
>
> tia,
> --
> Mirko Vukovic, Ph.D 3075 Hansen Way M/S K-109
> Varian Associates Palo Alto, CA, 94304
> 415/424-4969 mirko.vukovic@varian.grc.com
device, get_graphics_function = oldgr
device, set_graphics_function = 6 ; GXxor
plot, .... ; plot your lines here
device, set_graphics_function = oldgr ; set it back
Typically "oldgr" = 3, which is GXcopy.
See the help for more details.
--
Robert M. Moss, Ph.D. - mossrm@texaco.com - FAX (713)954-6911
------------------------------------------------------------ -----
This does not necessarily reflect the opinions of Texaco Inc.
|
|
|
Re: overplotting lines over images [message #7497 is a reply to message #7401] |
Thu, 14 November 1996 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
Mirko Vukovic wrote:
>
> I want to overplot lines over an image. The way I'd like it is to OR
> it, in the sense that the line is dark over light parts and light over
> dark parts. Thought that I've seen that written or mentioned somewhere,
> but cannot find anything in the manual.
>
You have to change the graphics mode to XOR mode, draw stuff, and
then restore the old graphics mode:
wset, my_window
color = !d.table_size - 1
device, get_graphics = oldg, set_graphics = 6
plots, [x1,x2], [y1,y2], /noclip, /device, color = color
device, set_graphics = oldg
You can later "erase" the line by doing the same commands again.
Hope this helps.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2200
La Jolla, CA 92037
[ UCSD Mail Code 0949 ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|
Re: overplotting lines over images [message #7498 is a reply to message #7401] |
Thu, 14 November 1996 00:00  |
Christian Soeller
Messages: 46 Registered: August 1996
|
Member |
|
|
Mirko Vukovic <mirko.vukovic@grc.varian.com> writes:
> I want to overplot lines over an image. The way I'd like it is to OR
> it, in the sense that the line is dark over light parts and light over
> dark parts. Thought that I've seen that written or mentioned somewhere,
> but cannot find anything in the manual.
one possibility: to draw a line from [x1,y1] to [x2,y2] get the x and y
indices which that line segment would cover in your image, e.g. using
linepts from the jhu library. Now modify all the pixel values in a copy of
your original image to do what you want and display it:
cpy = image ; make copy
linepts, x1, y1, x2, y2, jx, jy ; get pixel indices of line segment
cpy(jx,jy) = max(image)-image(jx,jy) ; invert pixels along that line
tvscl cpy ; and display
Hope this helps,
Christian
------------------------------------------------------------ --------
Christian Soeller mailto: csoelle@sghms.ac.uk
St. Georges Hospital Medical School Dept. of Pharmacology
Cranmer Terrace London SW17 0RE
|
|
|