[Insight-users] Failed to allocate memory on Registration

Luis Ibanez luis.ibanez at kitware.com
Wed Mar 4 12:07:01 EST 2009


Hi Fischer,

You can certainly use the ResampleImageFilter in order
to downsample the images as Andreas recommended.


You will find an examples on how to do this at:

     Insight/Example/Filtering/SubsampleVolume.cxx

That being said,

It would be interesting to better identify where the memory is
being used, in order to choose an effective way of dealing with
the problem.

There are multiple ways of reducing the memory requirements
of a registration process, and before you choose one, you need
to know where the memory is currently going.

You may want to give it a try a the MemoryProbe classes:

itkMemoryProbe.cxx
itkMemoryProbe.h
itkMemoryProbesCollectorBase.h
itkMemoryUsageObserver.cxx
itkMemoryUsageObserver.h

to track where the memory is being allocated.

You will find examples on how to use the MemoryProbes at:

    Insight/Testing/Code/Review/itkTimeAndMemoryProbeTest.cxx



   Regards,


      Luis


-------------------
Fischer, Sven wrote:
> Dear all,
> 
>  
> 
> I want to do a Registration between MRT and CT image. I use Mattes 
> Mutual Information and a Multi resolution registration. My images have 
> 9011200 and 181665792. Pixel Type is signed short. Doing the 
> registration I get the Failed to allocate memory error.
> 
>  
> 
> itk::ExceptionObject (0180F850)
> 
> Location: "float *__thiscall itk::ImportImageContainer<unsigned 
> long,float>::All
> 
> ocateElements(unsigned long) const"
> 
> File: 
> c:\src\openmaf\libraries\itk\sources\insighttoolkit-3.2.0\code\common\itkI
> 
> mportImageContainer.txx
> 
> Line: 188
> 
> Description: Failed to allocate memory for image.
> 
>  
> 
> So I would like to know if there is a filter I can use to scale down the 
> memory usage of the bigger image. I think I could use the 
> ShrinkImageFilter for that, but I want to keep the origin of my image. I 
> appreciate for any suggestion that could help.
> 
>  
> 
> Cheers,
> 
> Sven
> 
> 
> ------------------------------------------------------------------------
> 
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list