[Insight-users] Resampling 64-bit crash

Peter Cech pcech at vision.ee.ethz.ch
Thu Feb 15 06:24:37 EST 2007


On Thu, Feb 15, 2007 at 10:12:25 +0000, Florian Pierron wrote:
> Hi Robert,
> 
> Thank you for your tests.
> 
> I think I found the problem. I did a smaller test where I only try to 
> allocate an image of 5 GB:
> 
> **********
>  const     unsigned int   Dimension = 2;
>  typedef   unsigned char  InputPixelType;
>  typedef   unsigned char  OutputPixelType;
>  typedef itk::Image< InputPixelType,  Dimension >   InputImageType;
>  typedef itk::Image< OutputPixelType, Dimension >   OutputImageType;
> 
>  InputImageType::Pointer myImage = InputImageType::New ();
> 
>  InputImageType::IndexType index = {{0, 0}};
>  InputImageType::SizeType  size;
> 
>  size[0] = 5 * 1000 * 1000;
>  size[1] = 1 * 1000;
> 
>  InputImageType::RegionType region;
>  region.SetIndex (index);
>  region.SetSize (size);
>  myImage->SetRegions (region);
>  myImage->Allocate ();
> **********
> 
> And here is my comments:
> 1) On my computer, sizeof (long) = 4 bytes. (Is there a way to tell the 
> compiler to make it 8 bytes?)

What is the result of sizeof(size_t) and sizeof(ptrdiff_t)?
(Both types are from <cstddef> header.)

Regards,
Peter


More information about the Insight-users mailing list