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 
Switch to threaded view of this topic Create a new topic Submit Reply
Function BYTSCL [message #24652] Tue, 10 April 2001 01:29 Go to next message
Steffen Kernchen is currently offline  Steffen Kernchen
Messages: 4
Registered: April 2001
Junior Member
Hi...

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.... :(


bye

steffen
Re: Function BYTSCL [message #24765 is a reply to message #24652] Wed, 11 April 2001 23:12 Go to previous message
Steffen Kernchen is currently offline  Steffen Kernchen
Messages: 4
Registered: April 2001
Junior Member
hi david...


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

no, I�m just here. ;-)
I only had no time to answer. sorry.


this problem is solved! thx to you and all the other, who helped me, especially
Marc Schellens!
but I know, there�re many problems, I never dreamed of! *g*
but now I have some time to think about it. next exercise is in 3 weeks.
I hope it is enough time!


cheers,
steffen
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: OVERLAYING IMAGES
Next Topic: open file > 2 GB

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

Current Time: Wed Oct 08 15:14:29 PDT 2025

Total time taken to generate the page: 0.00467 seconds