[Insight-users] Operations on large 3D 8 bits datas

Dan Mueller d.mueller at qut.edu.au
Mon Jul 30 07:05:19 EDT 2007

Hi Yannick,
> I haven't seen the float InternalRealType line 71. In fact, I'm new 
> user, and the code stills a bit confuse for me.
Welcome aboard! I had the same trouble at first: ITK implements so many 
different concepts that it can be overwhelming, but in my experience it 
was definitely the worth the initial effort to become familiar with the 
toolkit. The ITK Software Guide is a great place to start: 
> Do you think it is possible to switch the internal real type to a less 
> consumming type ?
I fairly sure the internal type must be real to avoid loss of data when 
applying the Gaussian kernel.
> What is the interest of the 64-bits ?
In simple terms, a 64-bit system has an address bus which is 64 bits 
wide rather than 32 bits. This means that a process (ie. program) can 
reference a larger block of memory. On a 32-bit system the total memory 
a program can use at once (without too much fiddling around) is 2^32 = 
4GB (on some systems -- Windows at least -- the operating system uses 
some of this, approximately 2GB). On a 64-bit system the total memory 
which can be addressed is 2^64 = BIG!

Kevin wrote back to your original email suggesting the use of image 
streaming as another mechanism for dealing with large images:
This is certainly another valid approach for your particular problem: 
the GradientMagnitudeRecursiveGaussianImageFilter does not require the 
whole image to perform its operation, but could be applied to smaller 
sections and reassembled at the end.

Anyway, hope this helps.

Cheers, Dan

> Dan Mueller a écrit :
>> Hi Yannick,
>> Indeed, the itkGradientMagnitudeRecursiveGaussianImageFilter uses 
>> floating point intermediate images: the great thing about open source 
>> is that you can see for yourself!
>> http://www.itk.org/cgi-bin/viewcvs.cgi/Code/BasicFilters/itkGradientMagnitudeRecursiveGaussianImageFilter.h?root=Insight&view=markup 
>> around line 71.
>> I too am working with large 3D datasets and regularly received 
>> similar memory allocation exceptions -- the solution for me was to 
>> move to a 64-bit machine. Are you on a 32-bit machine? How much 
>> physical memory does your machine have?
>> Cheers, Dan
>> Yannick Pannier wrote:
>>> Hi everobody,
>>> I have some difficulties to adapt  
>>> GradientMagnitudeRecursiveGaussianImageFilter to be used on 
>>> 1024*1024*512 8-bits data.
>>> I have modified the  "InputPixelType" and "OutputPixelType" to be 
>>> "unsigned char", also :
>>> "typedef itk::Image< InputPixelType,  3 >   InputImageType;
>>>  typedef itk::Image< OutputPixelType, 3 >   OutputImageType; "
>>> and :
>>> "typedef unsigned char WritePixelType;
>>>  typedef itk::Image< WritePixelType, 3 > WriteImageType;"
>>> and when executed on 1024*1024*512 8 bits data, it returns :
>>> "terminate called after throwing an instance of 'itk::ExceptionObject'
>>>  what():  .../src/Insight/Code/Common/itkImportImageContainer.txx:188:
>>> Failed to allocate memory for image."
>>> I think there stills some hidden float operations due to the 
>>> gaussian filtering because when I launch the 
>>> GradientMagnitudeImageFilter (with the same modifications in the 
>>> code) with the same data, it ends with success.
>>> Can you tell me what I've missed ?
>>> Thanks
>>> Yannick 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070730/6fa96128/attachment-0001.htm

More information about the Insight-users mailing list