[Insight-developers] Test for large image buffer convert

Luis Ibanez luis.ibanez at kitware.com
Tue Aug 11 18:34:03 EDT 2009


2009/8/11 Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr>

>
> Le 12 août 09 à 00:15, Luis Ibanez a écrit :
>
>
>> Yeap, that makes sense then.
>>
>> I would follow Sean's suggestion and set
>>
>>     ITK_COMPUTER_MEMORY_SIZE  to  4
>>
>> in the 32 bits machines.
>>
>> ... and probably 3 (3Gb) is more realistic..
>>
>>
>> This has to be done manually, by running CMake
>> (or setting it in the ctest script). There is no attempt
>> to discover the amount of RAM at configuration time.
>>
>>
> Yes, I agree. However, I think that the non failing test
> itkLargeImageWriteReadTest3 may show a bug in itk::Image or maybe only in
> the test.
> If the image can't fit in memory, an exception should be send - that's not
> the case here.
>
>
> Gaëtan
>



I see,

Yes, we may be underestimating the amount of memory
that the test actually needs to run without errors.

The test actually needs twice the image size, because
it creates an image, saves it to a file, and then reads the
file back, and compares pixel-by-pixel the values of the
original image with the image that was read from the file.

Currently we have:


IF( ${ITK_COMPUTER_MEMORY_SIZE} GREATER 12 )

  # Image of 9.12 Gigabytes (pixels size is 16bits)
  ADD_TEST(itkLargeImageWriteReadTest3 ${IO_TESTS}
itkLargeImageWriteReadTest
           ${ITK_TEST_OUTPUT_DIR}/LargeImage03.mhd  70000L )

ENDIF( ${ITK_COMPUTER_MEMORY_SIZE} GREATER 12 )


and the argument 70000L is used as the number
of pixels along one dimension, so we end up with
an image of 49x10^8 pixels, with 2 bytes / pixel
(since the pixel type is short).

So, we are dealing with ~10^10 bytes,

more precisely:

   70000 * 70000 * 2.0 / ( 1024 * 1024 * 1024)

  = 9.1269

and we need double this, since we hold the image twice.

So the requirement for running this test should be to have
at least 19Gb of RAM....(instead of the 12 that we have
in the CMake guards around this test).


... another thing that we should double check is whether
readers and writers do not hold duplicate buffers of their
own....


     Luis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090811/b312885a/attachment.htm>


More information about the Insight-developers mailing list