Vince Hradil writes:
> a clever use if "where()" comes to mind...
Well, with an intelligent use of BYTSCL, too. :-)
Image pixels, no matter what they are *have*
to be displayed. No getting around it.
If you don't what certain pixels to "mean" anything,
then what is typically done is to assign those
pixels the same value as the background color.
This assumes you know how to reserve certain colors
for the image and certain colors for the background.
Something like this should work:
Window, XSIZE=400, YSIZE=400
Loadct, 13, NCOLORS=250
TVLCT, 255, 255, 255, 251 ; White background color.
TVLCT, 0, 0, 0, 252 ; Black drawing color.
image = dist(400)
image [10:50, 300:350] = -999
badpixels = Where(image EQ -999)
Device, Decomposed=0, Get_Decomposed=theState
Erase, COLOR=251
pos = [0.1, 0.1, 0.9, 0.75]
scaled = BytScl(image, TOP=249, MIN=0, MAX=max(image))
scaled[badpixels] = 251
TVImage, scaled, Position=pos, /KEEP_ASPECT
Colorbar, NCOLORS=250, AnnotateColor='black', $
Position=[0.1, 0.85, 0.9, 0.9]
Device, decomposed=theState
END
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")


|