<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, "Leo van Ruijven" <<a href="mailto:LvRuijven@gmx.com">LvRuijven@gmx.com</a>> 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->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></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>"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"><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>>> <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>
>><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><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>