| Re: Colors Common Block? [message #12608 is a reply to message #12540] |
Mon, 24 August 1998 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
Dirk Fabian wrote:
>
> A question about color tables:
>
> I want a simple inverted black and white color table, and i define it
> with red, green, and blue arrays that all run from 255 to 0. Then i load
> them in with
>
> tvlct,red,green,blue
>
> No problem. BUT, now I want to play with the stretch and gamma correction
> for this new color table just like with xloadct.
>
> The functions gamma_ct and stretch seem to be designed for this, but they
> always remove my color table and re-establish the old black and white.
> Adding the /Current keyword doesn't help.
Dirk -
Welcome to the weird and wacky world of the COLORS common block!
Seems like a strange implementation to me, IMHO.
Try defining this common block in your code (at the level of your
stretch() call) and define the first 3 variables in this block:
common colors cr, cg, cb, curr, curg, curb
.
.
.
r=reverse(indgen(255))
g=r
b=r
tvlct, r,g,b
cr = r
cg = g
cb = b
; Now stretch() should use your "current" color-table!
Hope this helps.
Dave
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
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 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|
|