comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » thresholding/color question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: thresholding/color question [message #18799 is a reply to message #18707] Sat, 05 February 2000 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Patty Howell (p.a.howell@larc.nasa.gov) writes:

> I want to display all values of an image with
> amplitudes greater than a given threshold limit in
> red, while leaving the rest of the image in
> greyscale. I know there has to be a simple way to
> do this, but I sure can't find it.

I'd set up the colors like this:

LoadCT, 0, NColors=!D.Table_Size-3 ; Gray-Scale
TVLCT, 255, 0, 0, !D.Table_Size-2 ; Red pixel.

Then, I'd scale my image data like this:

scaledImage = BytScl(image, Top=!D.Table_Size-4)

I'd find the red pixels and assign them like this:

redPixels = Where(image GT threshold, count)
IF count GT 0 THEN scaledImage[redPixels] = !D.Table_Size-2

Display the data like this:

TV, scaledImage

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Cannot save MPEG
Next Topic: Q: Scientific notation in Obj. graphics

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Nov 30 01:14:04 PST 2025

Total time taken to generate the page: 0.40207 seconds