Re: tvrd failure on v5 on win95 [message #9235 is a reply to message #9112] |
Wed, 04 June 1997 00:00   |
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
|
|
|