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

Home » Public Forums » archive » tvrd failure on v5 on win95
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
tvrd failure on v5 on win95 [message #9112] Tue, 03 June 1997 00:00 Go to next message
Mirko Vukovic is currently offline  Mirko Vukovic
Messages: 124
Registered: January 1996
Senior Member
ok I just wasted about 4 hours on the following problem on idlv5,
windows95 and pentium.

Basically, tvrd is not returning the image. Here is a piece of code:

surfdata = shift(dist(20),10,10)
surfdata = bytscl(exp(-(surfdata/5)^2))



loadct,25 ;,ncolo=100
shade_surf,surfdata,shades=surfdata
clr_surf = tvrd()

loadct,0
end

(some of you may recognize it as part of Struan's surface plotting
tutorial).

_depending_ on the color table loaded with LOADCT (I tried 6 and 25),
clr_surf contains a severely defficient image. Do a tv,clr_surf, and you
will get either only the axes drawn (for color table 25) or a surface
image but with colors that do not correspond to the original (for color
table 6)

If you look at the histogram of the image you will see that only few of
the 255 available values are used (two for color table 25 and several
for table 6).

I tried playing with device,decomposed=x, retaining done by IDL, but to
no avail. I also tried not using the top 20 colors (as this is used by
windows), but this did not help much.

Any clues?

Tia,


--
Mirko Vukovic, Ph.D 3075 Hansen Way M/S K-109
Varian Associates Palo Alto, CA, 94304
415/424-4969 mirko.vukovic@varian.grc.com
Re: tvrd failure on v5 on win95 [message #9221 is a reply to message #9112] Thu, 05 June 1997 00:00 Go to previous message
William Thompson is currently offline  William Thompson
Messages: 8
Registered: June 1997
Junior Member
David Foster wrote:

...

> I had many problems with TVRD() with IDL 4.0.1 and earlier, under
> Solaris 2.X.
> I wrote a routine I called SAFE_TVRD(), that uses the DEVICE, COPY=[]
> command
> to read from the window. This routine solved the problem we were having.
> I have
> mailed it to you; hopefully it may help with your problem. It is a bit
> slower,
> because it has to create an extra pixmap window first, but if it
> works...

Could you also post that routine?

Thanks,

Bill Thompson
Re: tvrd failure on v5 on win95 [message #9235 is a reply to message #9112] Wed, 04 June 1997 00:00 Go to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
Mirko Vukovic wrote:
>
> ok I just wasted about 4 hours on the following problem on idlv5,
> windows95 and pentium.
>
> Basically, tvrd is not returning the image. Here is a piece of code:
>
> surfdata = shift(dist(20),10,10)
> surfdata = bytscl(exp(-(surfdata/5)^2))
>
>
>
> loadct,25 ;,ncolo=100
> shade_surf,surfdata,shades=surfdata
> clr_surf = tvrd()
>
> loadct,0
> end
>
> (some of you may recognize it as part of Struan's surface plotting
> tutorial).
>
> _depending_ on the color table loaded with LOADCT (I tried 6 and 25),
> clr_surf contains a severely defficient image. Do a tv,clr_surf, and you
> will get either only the axes drawn (for color table 25) or a surface
> image but with colors that do not correspond to the original (for color
> table 6)
>
> If you look at the histogram of the image you will see that only few of
> the 255 available values are used (two for color table 25 and several
> for table 6).
>
> I tried playing with device,decomposed=x, retaining done by IDL, but to
> no avail. I also tried not using the top 20 colors (as this is used by
> windows), but this did not help much.
>

Mirko -

I had many problems with TVRD() with IDL 4.0.1 and earlier, under
Solaris 2.X.
I wrote a routine I called SAFE_TVRD(), that uses the DEVICE, COPY=[]
command
to read from the window. This routine solved the problem we were having.
I have
mailed it to you; hopefully it may help with your problem. It is a bit
slower,
because it has to create an extra pixmap window first, but if it
works...

It was confirmed by RSI tech support that there were problems with
TVRD() under
Solaris 2.X/OpenWindows, even when backing store was provided by IDL
(yes, I tried
that first). There were problems with TVRD() if the window was obscured
or iconified, or if the graphics window was a scrollable draw widget.

I haven't verified yet whether any of these problems persist with IDL
5.0. I DO
know that SAFE_TVRD() is still safe! ;-)

Dave
--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2200
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~

"I have this theory that if we're told we're bad,
then that's the only idea we'll ever have.
But maybe if we are surrounded in beauty,
someday we will become what we see." - Jewel Kilcher
Re: tvrd failure on v5 on win95 [message #9244 is a reply to message #9112] Wed, 04 June 1997 00:00 Go to previous message
Mirko Vukovic is currently offline  Mirko Vukovic
Messages: 124
Registered: January 1996
Senior Member
Struan Gray wrote:
>
> Mirko Vukovic, mirko.vukovic@grc.varian.com writes:
>
>> (some of you may recognize it as part of Struan's
>> surface plotting tutorial).
>
> I thought it looked familiar :-)
>
>> _depending_ on the color table loaded with LOADCT (I
>> tried 6 and 25), clr_surf contains a severely defficient
>> image. Do a tv,clr_surf, and you will get either only the
>> axes drawn (for color table 25) or a surface image but with
>> colors that do not correspond to the original (for color
>> table 6)
>
> It could be a bug in v5.0 but I would guess you are doing this on
> a 16-bit or 24-bit display where TVRD doesn't return the colour index
> used to plot the image, but instead gives you whichever of the red,
> green and blue values for each pixel is largest. With some colour
> tables this can give very different results from what you get on an
> 8-bit display.

I'll look into that, but I am doubtfull, since I am already specifying
device,/decomposed=0 (to enforce the 8bit mode).

thanks
--
Mirko Vukovic, Ph.D 3075 Hansen Way M/S K-109
Varian Associates Palo Alto, CA, 94304
415/424-4969 mirko.vukovic@varian.grc.com
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL signal processing procedures
Next Topic: Re: Gradient of an Image in IDL

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

Current Time: Wed Oct 08 15:13:37 PDT 2025

Total time taken to generate the page: 0.00610 seconds