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 "scientific data model": 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'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'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 "long" in ITK.<br>
<br>
<br>
<br>
However, your assumptiong that "long" 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 <iostream><br>
int main()<br>
{<br>
=A0 =A0unsigned long tt;<br>
=A0 =A0std::cout << "size =3D " << sizeof(tt) <&l=
t; std::endl;<br>
=A0 =A0tt =A0=3D =A0-1;<br>
=A0 =A0std::cout << "tt =3D " << tt << 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 "64 bits" 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>
> Hi,<br>
><br>
><br>
><br>
> Machine details: Windows XP, visual studio 2008, =A064 bit platform,<b=
r>
64Gb Ram<br>
><br>
> Image size: 1442 x 1566 x 1657 ( approx 7Gb )<br>
><br>
> Other libraries: Along with ITK, VTK and VTK Edge is also used. VTK<br=
>
Edge<br>
> is used for changing vtk image to itk image and vice versa.<br>
><br>
><br>
><br>
> Problem:<br>
><br>
> In ITK the OffsetValueType is long. Range of long datatype:<br>
> -2,147,483,648 to 2,147,483,647<br>
><br>
> But the image m_OffsetTable values of type OffsetValueType are : 1;<br=
>
> 1442; 2258172; =A03,741,791,004<br>
><br>
> In the above, it is clearly seen that the image offset value exceeds<b=
r>
the<br>
> OffsetValueType range.<br>
><br>
><br>
><br>
> Correction attempts:<br>
><br>
> 1. =A0 =A0 =A0 I changed the OffsetValueType to unsigned long to incre=
ase<br>
the<br>
> range. Unsigned long range : 0 to 4,294,967,295. But<br>
><br>
> this gives problems on conversion back to vtk. The vtkdataarray<br>
created<br>
> has a variable maxID which is of VtkIDType.<br>
><br>
> VtkIDType is of long long. The maxID contains the value =3D<br>
-553,176,292.<br>
><br>
><br>
><br>
> Correlation between =A03,741,791,004 and -553,176,292.<br>
><br>
> 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>
><br>
> 3,741,791,003 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0DF07331B<br>
><br>
> -553,176,292 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0FFFFFFFF DF07331B<br>
><br>
><br>
><br>
> So, the program crashes due to bad pointer when it used vtkdata array<=
br>
> details to draw histogram.<br>
><br>
> I think the probelm here is assigning of unsigned long to long long. I=
<br>
<br>
> don't want to change the<br>
><br>
> Vtk data type to unsigned long, so in next attempt i change the itk<br=
>
> OffsetValueType to long long.<br>
><br>
><br>
><br>
> 2. =A0 =A0 =A0 I changed the itk OffsetValueType to long long, but thi=
s<br>
leads<br>
> to change of lot of several other<br>
><br>
> variable type in different file. Specially some of the basic image<br>
> container variables like TElementIdentifier, TElement have to be<br>
changed.<br>
><br>
> For now I only can give these 2 variable, but i am afraid more<br>
variable<br>
> data types have to be changed in the future.<br>
><br>
><br>
><br>
> I would be glad to have some help to solve this problem.<br>
><br>
><br>
><br>
> Regards,<br>
><br>
> Kana<br>
><br>
><br>
><br>
------------------------------------------------------------------------<br=
>
><br>
> _____________________________________<br>
> Powered by <a href=3D"http://www.kitware.com" target=3D"_blank">www.ki=
tware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href=3D"http://www.kitware.com/opensource/opensource.html" target=
=3D"_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> 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>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <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-developers
mailing list