[ITK] ITK-4.6 problem

Gib Bogle g.bogle at auckland.ac.nz
Tue Sep 16 18:39:47 EDT 2014


Update on the bug in the version of ITK-4.6 installed by Slicer:

What can we make of this:

    ImageType::Pointer im = ImageType::New();
    ImageType::SizeType imsize;
    imsize[0] = width;
    imsize[1] = height;
    imsize[2] = depth;
    ImageType::IndexType imstart;
    imstart[0] = 0;
    imstart[1] = 0;
    imstart[2] = 0;
    ImageType::RegionType imregion;
    imregion.SetSize(imsize);
    imregion.SetIndex(imstart);
    im->SetRegions(imregion);
    im->Allocate();
    p = (unsigned char *)(im->GetBufferPointer());

    width = im->GetLargestPossibleRegion().GetSize()[0];
    height = im->GetLargestPossibleRegion().GetSize()[1];
    depth = im->GetLargestPossibleRegion().GetSize()[2];
    printf("Requested image dimensions: width, height, depth: %d %d %d\n",width,height,depth);

    printf("imregion size(0): %d\n",imregion.GetSize(0));
    printf("imregion size(1): %d\n",imregion.GetSize(1));
    printf("imregion size(2): %d\n",imregion.GetSize(2));

    int i = 195000000;
    for (int i=197160890; i<200000000;i++) {
        printf("offset: %d\n",i);
        p[i] = 0;
    }

yields (reproducibly):

D:\testing\ITK\bigtiff>Release\makebig.exe big1650c-4.6.tif 1650 0
...
Requested image dimensions: width, height, depth: 1650 1650 1650
imregion size(0): 1650
imregion size(1): 1650
imregion size(2): 1650
offset: 197160890
offset: 197160891
offset: 197160892
offset: 197160893
offset: 197160894
offset: 197160895
offset: 197160896
<crash>

(If instead of writing to the image buffer I do this: im->FillBuffer(0) the program crashes when it attempts writer->Update().)

Varying the size of the image (NxNxN) I find that N = 1625 is OK, N = 1626 crashes at z=2, buffer offset = 5287752 (clearly the offset index is insignificant).  1626^3 is slightly bigger than 2^32.

I checked that the ITK build definitely had ITKV3_COMPATIBILITY off and therefore ITK_USE_64BITS_IDS on.

I'm wondering if the image buffer allocation  im->Allocate() is successful in the cases that crash.  How can I check that?

I'd appreciate some pointers.

Thanks
Gib

________________________________________
From: Matt McCormick [matt.mccormick at kitware.com]
Sent: Wednesday, 17 September 2014 1:48 a.m.
To: Gib Bogle
Cc: community at itk.org
Subject: Re: [ITK] ITK-4.6 problem

Hi Gib,

>
> There is something a bit funny about the installed ITK-4.6, in that the
> compiler complained about some missing include files, vnl_*.h and others,
> which are in my ITK-4.0 installation but not in 4.6.  I just copied them
> across - I hope this is not a problem.
>

This is probably a problem.  Did the ITK 4.6 build complete
successfully and the install complete successfully?

Thanks,
Matt



More information about the Community mailing list