<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->File->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->File->seekg(0, ios::beg);<br /> while (streamStart > 0x2000000) {<br /> this->File->Seek(0x2000000, ios::cur);<br /> streamStart -= 0x2000000;<br /> }<br /> if (streamStart > 0) this->File->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 />"long" and not the "vtkIdType" 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->Extent[0], this->Extent[1], this- <br /> >Extent[2],<br /> this->Extent[3], this->Extent[4], this- <br /> >Extent[5]};<br /><br />instead of<br /> const int* extent = this->Extent;<br /><br />In the case of vtkImageReader2 it is probably "long" 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 />>> <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 />>><br />>> Is when I came across the issue. I did not keep track of what the <br />>> eventual<br />>> "fixes" were but somewhere (probably a private email) I think it <br />>> was said<br />>> that a fix was difficult because the API for a lot of filters would <br />>> need to<br />>> be changed.<br />>> In the most draconian fix the use of "long" should just be <br />>> banned, but<br />>> this would cause all sorts of backwards compatibility issues.<br />>><br />><br />> Isn't there an option when building VTK to use 64 bit ids? I have<br />> never used that so I am not sure how much of the code supports this.<br />><br />> John<br /><br /><br /><br /></pre></div></div></blockquote></font></span></p> </div></font></span></p></body></html>