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

Home » Public Forums » archive » Function BYTSCL
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: Function BYTSCL [message #24773 is a reply to message #24652] Wed, 11 April 2001 12:32 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Steffen Kernchen (steffen.kernchen@student.uni-magdeburg.de) writes:

> I�m just starting with IDL, so here is my first question: ;-)
>
> what function(s) can I use instead of BYTSCL?
> I have an array and I want to transform it to get a better contrast.
> But I should NOT use BYTSCL.... :(

Alright, enough time has passed that Seffen has
probably passed or failed the final. Here is
my take on what BYTSCL does:

FUNCTION Daves_Bytscl, array, Top=maxVal
minVal = 0.
IF N_Elements(maxVal) EQ 0 THEN maxVal = 255. ELSE maxVal = Float(maxVal)
minVec = Min(array, Max=maxVec)
sf = [((minVal * maxVec)-(maxVal * minVec)) / $
(maxVec - minVec), (maxVal - minVal) / (maxVec - minVec)]
RETURN, Byte(array*sf[1] + sf[0])
END

To test it:

IDL> array = Dist(150, 150)
IDL> Window, XSize=450, YSize=150
IDL> TV, array, 0
IDL> TV, Daves_BytScl(array), 1
IDL> TV, BytScl(array), 2

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
Previous Topic: OVERLAYING IMAGES
Next Topic: open file > 2 GB

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

Current Time: Fri Oct 10 07:06:32 PDT 2025

Total time taken to generate the page: 1.12050 seconds