<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title></title><meta http-equiv="Content-type" content="text/html; charset=UTF-8" /><style type="text/css">p { margin:0px; padding:0px; }</style></head><body style='background-color:rgb(255, 255, 255);background-image:none;background-repeat:repeat;background-position:0% 0%;font-family:Verdana,Geneva,Arial,Helvetica,sans-serif;font-size:12px;margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;padding-top:5px;padding-bottom:5px;padding-left:5px;padding-right:5px;'><p><span style="font-family:Verdana;"><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'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 /><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">www.bluequartz.net</a><br />Principal Software Engineer       <a href="mailto:mike.jackson@bluequartz.net" >mike.jackson@bluequartz.net</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">http://public.kitware.com/pipermail/paraview/2008-March/007422.html</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'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></span></p> </div></font></span></p></body></html>