<html><body>
<p>&quot;nikolaus heger&quot; &lt;nikolaus.heger@gmail.com&gt;<tt>&nbsp;wrote on 08/06/2006 13:20:36:<br>
<br>
&gt; Hi,</tt><br>
<tt>&gt; &nbsp;</tt><br>
<tt>&gt; I have a problem where textures over 2000 pixels show up as white <br>
&gt; rectangles on my computer. </tt><br>
<tt>&gt; &nbsp;</tt><br>
<tt>&gt; It seems to be isolated to ATI cards - I have an X1600 with 256M / 512M RAM.</tt><br>
<tt>&gt; &nbsp;</tt><br>
<tt>&gt; Does anyone know if this affects all ATI cards, or can this be fixed<br>
&gt; with a new driver or with vtk 5.0? </tt><br>
<tt>&gt; &nbsp;</tt><br>
<tt>&gt; Demo code in [1] shows the problem.</tt><br>
<tt>&gt; &nbsp;</tt><br>
<tt>&gt; Thanks for any help or info! </tt><br>
<tt>&gt; &nbsp;</tt><br>
<tt>&gt; Nik</tt><br>
<tt>&gt; [1]</tt><br>
<tt>&gt; import Tkinter<br>
&gt; from Tkinter import *<br>
&gt; import math, os, sys<br>
&gt; from vtkpython import *<br>
&gt; import vtk</tt><br>
<tt>&gt; from vtk.tk.vtkLoadPythonTkWidgets import vtkLoadPythonTkWidgets</tt><br>
<tt>&gt; filename = &quot;demo_lg.jpg&quot; # 2300 pixel high image - displays as white<br>
&gt; rectangle on ATI cards.</tt><br>
<tt>&gt; #filename = &quot;demo.jpg&quot; # 2000 pixel high image - TOTALLY FINE</tt><br>
<br>
<tt>I have experienced the white rectangle problem, on an ATI card too, but it just seems to be a physical limitation on maximum texture size. In C++ I used the following OpenGL call from inside my vtk app to find out the maximum:</tt><br>
<br>
<tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; long maxDimGL;</tt><br>
<tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; glGetIntegerv(GL_MAX_TEXTURE_SIZE,&amp;maxDimGL);</tt><br>
<br>
<tt>I have no idea if you can access this in Tcl/Tk. I think there are OpenGL testbench programs out there that may report this number, perhaps you could look for one.</tt><br>
<tt>The bottom line is this looks to be a hardware limit, you would have to add code to resample images down if they were larger than the reported limit on a given machine.</tt><br>
<br>
<tt>&nbsp; regards</tt><br>
<tt>&nbsp; &nbsp; Dave P</tt><br>
<tt>&gt; <br>
&gt; reader = vtk.vtkImageReader2Factory.CreateImageReader2(filename) &nbsp;<br>
&gt; reader.SetFileName(filename)</tt><br>
<tt>&gt; # set the window/level <br>
&gt; viewer = vtkImageViewer2()<br>
&gt; viewer.SetInput(reader.GetOutput())<br>
&gt; viewer.SetColorWindow(100.0)<br>
&gt; viewer.SetColorLevel(127.5)</tt><br>
<tt>&gt; viewer.Render()</tt><br>
<tt>&gt; #make interface<br>
&gt; viewer.Render()</tt><br>
<tt>&gt; windowToimage = vtkWindowToImageFilter()<br>
&gt; windowToimage.SetInput(viewer.GetRenderWindow())</tt><br>
<tt>&gt; frame = Frame()<br>
&gt; frame.mainloop()</tt><br>
<tt>&gt; &nbsp;_______________________________________________<br>
&gt; This is the private VTK discussion list. <br>
&gt; Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk">http://www.vtk</a>.<br>
&gt; org/Wiki/VTK_FAQ<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</tt></body></html>