<html><body bgcolor="#FFFFFF"><div>Windows does have 64 bit file functions available. You just have to special case for them. When I get to work I will post the code that I use in my own projects. <br><br><div>----- </div>
<div>Mike Jackson                      <a href="http://www.bluequartz.net"><a href="http://www.bluequartz.net">www.bluequartz.net</a></a></div><div>Principal Software Engineer       <a href="mailto:mike.jackson@bluequartz.net"><a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a></a></div>
<div>BlueQuartz Software               Dayton, Ohio</div></div><div><br>On Aug 12, 2010, at 5:21, &quot;Leo van Ruijven&quot; &lt;<a href="mailto:LvRuijven@gmx.com">LvRuijven@gmx.com</a>&gt; wrote:<br><br></div><div></div>
<blockquote type="cite"><div><p><span style="font-family:Verdana;"><font size="2"></font></span></p><font size="2"><div> <p><span style="font-family:Verdana;"><font size="2">As Mike said, you do not have to change the API to correct the issue. </font></span><span style="font-family:Verdana;"><font size="2">Just use 64 bit precision calculations inside the methods (for vtkImageReader2  the method SeekFile() must also be corrected).<br>
</font></span></p> <p style="font-family:Verdana;"><br><font size="2"><span></span></font></p> <p style="font-family:Verdana;"><font size="2"><span>However, on my computer (Windows XP and Visual Studio 8) that did not yet solve the problem. </span></font><font size="2"><span>In windows the file positioning functions are still not fully 64 bit. So</span></font><font size="2"><span> in vtkImageReader::SeekFile() the line:  <br>
</span></font></p> <p style="font-family:Verdana;"><font size="2"><span><br></span></font></p> <p style="font-family:Verdana;"><font size="2"><span>   this-&gt;File-&gt;seekg(streamStart, ios::beg);</span></font></p> <p style="font-family:Verdana;">
</p> <p style="font-family:Verdana;"><br><font size="2"><span></span></font></p> <p style="font-family:Verdana;"><font size="2"><span>did not work if streamStart is too large. But </span></font><font size="2"><span>the following workaround does work on my system:</span></font></p>
 <p style="font-family:Verdana;"><br><font size="2"><span></span></font></p> <p style="font-family:Verdana;"><font size="2"><span>  this-&gt;File-&gt;seekg(0, ios::beg);<br>  while (streamStart &gt; 0x2000000) {<br>      this-&gt;File-&gt;Seek(0x2000000, ios::cur);<br>
      streamStart -= 0x2000000;<br>  }<br>  if (streamStart &gt; 0) this-&gt;File-&gt;seekg(streamStart, ios::cur);<br></span></font></p> <p style="font-family:Verdana;"><br></p> <p style="font-family:Verdana;"><br></p> <p style="font-family:Verdana;">
I don&#39;t know how to change the vtk source code. otherwise I would have corrected the bug myself. But If somebody is interested in my version of vtkImageReader2, just let me know.</p> <p style="font-family:Verdana;"><br>
</p> <p style="font-family:Verdana;"><font size="2"><span>Leo.</span></font></p> <p style="font-family:Verdana;"><font size="2"><span><br></span></font></p> <p><br><span style="font-family:Verdana;"><font size="2"><br></font></span></p>
<font size="2"><blockquote class="quote" type="cite"><div><div><pre>there _is_ but the actual code in the vtkImageReader2 class uses the  <br>&quot;long&quot; and not the &quot;vtkIdType&quot; which would help solve the problem. An  <br>
example is the following that was posted to the ParaView mailing list:<br><br>In the void vtkImageData::AllocateScalars(); method the following<br>should be used:<br><br>  vtkIdType extent[6] ={ this-&gt;Extent[0], this-&gt;Extent[1], this- <br>
 &gt;Extent[2],<br>                         this-&gt;Extent[3], this-&gt;Extent[4], this- <br> &gt;Extent[5]};<br><br>instead of<br>  const int* extent = this-&gt;Extent;<br><br>In the case of vtkImageReader2 it is probably &quot;long&quot; instead of int.  <br>
Either way on Windows, both are a 32 bit integer no matter how you  <br>compile it.<br><br>___________________________________________________________<br>Mike Jackson                      <a target="_blank" href="www.bluequartz.net"><a href="http://www.bluequartz.net">www.bluequartz.net</a></a><br>
Principal Software Engineer       <a href="mailto:mike.jackson@bluequartz.net"><a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a></a><br>BlueQuartz Software               Dayton, Ohio<br><br><br>
<br>On Aug 11, 2010, at 9:35 AM, John Drescher wrote:<br><br>&gt;&gt; <a target="_blank" href="http://public.kitware.com/pipermail/paraview/2008-March/007422.html"><a href="http://public.kitware.com/pipermail/paraview/2008-March/007422.html">http://public.kitware.com/pipermail/paraview/2008-March/007422.html</a></a><br>
&gt;&gt;<br>&gt;&gt; Is when I came across the issue. I did not keep track of what the  <br>&gt;&gt; eventual<br>&gt;&gt; &quot;fixes&quot; were but somewhere (probably a private email) I think it  <br>&gt;&gt; was said<br>
&gt;&gt; that a fix was difficult because the API for a lot of filters would  <br>&gt;&gt; need to<br>&gt;&gt; be changed.<br>&gt;&gt;   In the most draconian fix the use of &quot;long&quot; should just be  <br>&gt;&gt; banned, but<br>
&gt;&gt; this would cause all sorts of backwards compatibility issues.<br>&gt;&gt;<br>&gt;<br>&gt; Isn&#39;t there an option when building VTK to use 64 bit ids? I have<br>&gt; never used that so I am not sure how much of the code supports this.<br>
&gt;<br>&gt; John<br><br><br><br></pre></div></div></blockquote></font><p></p> </div></font><p></p>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Powered by <a href="http://www.kitware.com"><a href="http://www.kitware.com">www.kitware.com</a></a></span><br>
<span></span><br><span>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html"><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a></a></span><br>
<span></span><br><span>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ"><a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a></a></span><br><span></span><br>
<span>Follow this link to subscribe/unsubscribe:</span><br><span><a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a></span><br></div></blockquote></body></html>