Alpha blending with object graphics - different color palettes do not work [message #75790] |
Wed, 04 May 2011 04:11 |
LNpellen
Messages: 37 Registered: November 2009
|
Member |
|
|
Hi,
I'm trying to move from direct to object graphics and I have the
following problem:
I want to display a CT image in greyscale overlayed with a colored
dosemap.
The CT is an indexed image. The display seems fine: greyscale.
The dose map is also originally indexed, but I've converted it to a
[2,n,m] bytarr to add the alpha channel.
The blending seems fine, but the palette is greyscale, not rainbow as
I hoped for.
I have the RETAIN=2 defined in widget_draw
I have the DEVICE, RETAIN=2, DECOMPOSED=0 just after the XMANAGER part
in the GUI file
I'm setting the pallette both the CT image and the dose image
oPaletteCT->LoadCT, 0
oImageCT = OBJ_NEW('IDLgrImage', temp, PALETTE=oPaletteCT)
oPaletteDose->LoadCT, 13
oImageDose = OBJ_NEW('IDLgrImage', alphaDose , BLEND_FUNCTION = [3,
4], $
ALPHA_CHANNEL=0.50, PALETTE=oPaletteDose)
This is how I create the alphaDose:
alphaDose = BYTARR(2, size[0], size[1], /NOZERO)
alphaDose[0,*,*]=dose
alphaDose[1,*,*]=255*alpha ; where alpha is a factor between 0 and 1
Why isn't the rainbow (LoadCT, 13) working for me?
Best regards,
LNpellen
|
|
|