No subject


Tue Jun 23 12:19:35 EDT 2009


and 64 bit compiler unsigned long is 4 byte and unsigned long long is 8<br>
byte.<br>
<br>
I checked in the wiki for 64 bit machines (link below)<br>
<br>
<a href=3D"http://en.wikipedia.org/wiki/64-bit" target=3D"_blank">http://en=
.wikipedia.org/wiki/64-bit</a><br>
<br>
In the link above, under topic &quot;scientific data model&quot;: It is giv=
en that<br>
Microsoft win64 uses the LLP data model. From the above links, I<br>
understand the following:<br>
<br>
1. =A0 =A0 =A0A 64bit machine with Microsoft Windows x64 Operating system h=
as<br>
4 byte for long and 8 byte for long long.<br>
2. =A0 =A0 =A0Microsoft visual studio 2009 has long as 4 byte and long long=
 as<br>
8 bytes for both win32 and x64 compiler option.<br>
<br>
What&#39;s next?<br>
<br>
Thank you,<br>
Regards,<br>
<font color=3D"#888888">Kana<br>
</font><div><div></div><div class=3D"h5"><br>
-----Original Message-----<br>
From: Luis Ibanez [mailto:<a href=3D"mailto:luis.ibanez at kitware.com">luis.i=
banez at kitware.com</a>]<br>
Sent: 08 July 2009 16:10<br>
To: Arunachalam Kana<br>
Cc: <a href=3D"mailto:insight-users at itk.org">insight-users at itk.org</a><br>
Subject: Re: [Insight-users] Image offset is giving bad pointer for<br>
large datasets (7Gb)<br>
<br>
<br>
<br>
Hi Arunachalam,<br>
<br>
<br>
 =A0 =A0 =A0 =A0 =A0Thanks for your detailed post.<br>
<br>
<br>
 =A0 =A0 =A0 =A0 =A0Let&#39;s discuss first ITK by itself,<br>
<br>
<br>
(before we go into the integration with VTK and VTKEdge)<br>
<br>
<br>
<br>
As you pointed out, the type<br>
<br>
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 OffsetValueType<br>
<br>
is currently defined as &quot;long&quot; in ITK.<br>
<br>
<br>
<br>
However, your assumptiong that &quot;long&quot; types in 64 bits<br>
platforms, are storing values up to 2^32 is incorrect.<br>
<br>
<br>
An unsigned long type in a 64bits platforms will have<br>
8 bytes, and therefore can store values up to 2^64.<br>
which is:<br>
<br>
 =A0 =A0 =A0 =A0 =A0 =A0 18446744073709551615 L<br>
<br>
<br>
You can verify this with the following code:<br>
<br>
<br>
#include &lt;iostream&gt;<br>
int main()<br>
{<br>
 =A0 =A0unsigned long tt;<br>
 =A0 =A0std::cout &lt;&lt; &quot;size =3D &quot; &lt;&lt; sizeof(tt) &lt;&l=
t; std::endl;<br>
 =A0 =A0tt =A0=3D =A0-1;<br>
 =A0 =A0std::cout &lt;&lt; &quot;tt =3D &quot; &lt;&lt; tt &lt;&lt; std::en=
dl;<br>
}<br>
<br>
<br>
The output of this program, in a 64bits machine will be:<br>
<br>
<br>
 =A0 =A0 =A0 =A0 =A0size =3D 8<br>
 =A0 =A0 =A0 =A0 =A0tt =3D 18446744073709551615<br>
<br>
<br>
The same code, when compiled in a 32-bits machine<br>
will produce as output:<br>
<br>
<br>
 =A0 =A0 =A0 =A0 =A0size =3D 4<br>
 =A0 =A0 =A0 =A0 =A0tt =3D 4294967295<br>
<br>
<br>
Therefore, if your OffsetValueType is getting saturated,<br>
it is likely that you are *not* compiling for 64 bits.<br>
<br>
<br>
Are you sure that when you configured ITK with CMake,<br>
you selected the &quot;64 bits&quot; version of your Visual Studio<br>
compiler.<br>
<br>
<br>
A simple way to double-check is to compile the code<br>
above and run it.<br>
<br>
<br>
<br>
 =A0 =A0Please do so, and let us konw what you find.<br>
<br>
<br>
 =A0 =A0 =A0 Thanks<br>
<br>
<br>
<br>
 =A0 =A0 =A0 =A0 =A0Luis<br>
<br>
<br>
<br>
----------------------------------<br>
Arunachalam Kana wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Machine details: Windows XP, visual studio 2008, =A064 bit platform,<b=
r>
64Gb Ram<br>
&gt;<br>
&gt; Image size: 1442 x 1566 x 1657 ( approx 7Gb )<br>
&gt;<br>
&gt; Other libraries: Along with ITK, VTK and VTK Edge is also used. VTK<br=
>
Edge<br>
&gt; is used for changing vtk image to itk image and vice versa.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Problem:<br>
&gt;<br>
&gt; In ITK the OffsetValueType is long. Range of long datatype:<br>
&gt; -2,147,483,648 to 2,147,483,647<br>
&gt;<br>
&gt; But the image m_OffsetTable values of type OffsetValueType are : 1;<br=
>
&gt; 1442; 2258172; =A03,741,791,004<br>
&gt;<br>
&gt; In the above, it is clearly seen that the image offset value exceeds<b=
r>
the<br>
&gt; OffsetValueType range.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Correction attempts:<br>
&gt;<br>
&gt; 1. =A0 =A0 =A0 I changed the OffsetValueType to unsigned long to incre=
ase<br>
the<br>
&gt; range. Unsigned long range : 0 to 4,294,967,295. But<br>
&gt;<br>
&gt; this gives problems on conversion back to vtk. The vtkdataarray<br>
created<br>
&gt; has a variable maxID which is of VtkIDType.<br>
&gt;<br>
&gt; VtkIDType is of long long. The maxID contains the value =3D<br>
-553,176,292.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Correlation between =A03,741,791,004 and -553,176,292.<br>
&gt;<br>
&gt; Decimal =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Hexa<br>
&gt;<br>
&gt; 3,741,791,003 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0DF07331B<br>
&gt;<br>
&gt; -553,176,292 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0FFFFFFFF DF07331B<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; So, the program crashes due to bad pointer when it used vtkdata array<=
br>
&gt; details to draw histogram.<br>
&gt;<br>
&gt; I think the probelm here is assigning of unsigned long to long long. I=
<br>
<br>
&gt; don&#39;t want to change the<br>
&gt;<br>
&gt; Vtk data type to unsigned long, so in next attempt i change the itk<br=
>
&gt; OffsetValueType to long long.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; 2. =A0 =A0 =A0 I changed the itk OffsetValueType to long long, but thi=
s<br>
leads<br>
&gt; to change of lot of several other<br>
&gt;<br>
&gt; variable type in different file. Specially some of the basic image<br>
&gt; container variables like TElementIdentifier, TElement have to be<br>
changed.<br>
&gt;<br>
&gt; For now I only can give these 2 variable, but i am afraid more<br>
variable<br>
&gt; data types have to be changed in the future.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; I would be glad to have some help to solve this problem.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Regards,<br>
&gt;<br>
&gt; Kana<br>
&gt;<br>
&gt;<br>
&gt;<br>
------------------------------------------------------------------------<br=
>
&gt;<br>
&gt; _____________________________________<br>
&gt; Powered by <a href=3D"http://www.kitware.com" target=3D"_blank">www.ki=
tware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href=3D"http://www.kitware.com/opensource/opensource.html" target=
=3D"_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
<a href=3D"http://www.itk.org/Wiki/ITK_FAQ" target=3D"_blank">http://www.it=
k.org/Wiki/ITK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href=3D"http://www.itk.org/mailman/listinfo/insight-users" target=
=3D"_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br>

--00163642713686035a046e5c7c1e--


More information about the Insight-users mailing list