[Insight-users] Failed to allocate memory for image

Luis Ibanez luis.ibanez at kitware.com
Mon Aug 28 11:53:16 EDT 2006


Hi Ming,

Thanks for providing the answers to our questions.

 From the additional information that you posted, it
seems that the main suspect may be the computation
of the gradient image that is performed during the
initialization of the ImageMetric.


Please add a call:

      metric->Initialize()

just before you call

       registrationMethod->StartRegistration()

and put a try/catch() block aroung the metric->Initialize()
call, along with a very unique message in the catch block.

Then rerun your registration.

In this way we should be able to identify if the problem
happens during the initialization of Metric.


Please let us know what you find.



    Thanks



      Luis


-------------------
Ming Chao wrote:
> Hi Luis,
>  
> Sorry for my late response. Please see the following for your questions.
> 
> 
> What tool did you used for monitoring the memory usage ?
>  
> The tool I used is just the Windows Task Manager.
> 
> What was the memory usage for the entire machine ?
> (you only reported the usage for the registration application).
>  
> I don't remember the exact number, but I do know that the registration 
> application had the largest consumption of memory.  I am sure the total 
> memory usage did not exceed the allowed memory.
> 
> Do you have other applications running at the same time that
> your are running the registration application ?
> 
> No.
> 
> In Windows 32 bits, a process can only access 2Gb of contiguous
> RAM.
> 
> What Image Metric are you using ?
> (e.g. is it one of the metrics that computes the image gradient?)
>  
> Normalized Cross Correlation.
> 
> What other ITK and/or VTK filter do you have in that pipeline.
> 
> I did not have any other filters.
> 
> At what point in the execution of your program do you get this
> message ?
> 
> Before the first iteration during the registration which is actually a 
> rigid one.
> 
> Have the registration started ?
>  
> Yes.
> 
> Do you got some optimization iterations ?
> 
> No.
> 
> It is very likely that you are actually using most of those
> 2Gb of data, and may have to release memory as your appllication
> progresses with its pipeline.
> 
> I am not sure what you meant here. Why do you say that I used most of 
> the 2GB data? How can I release memory?
>  
> I want to repeat that my registration is actually very simple one, ie, 
> rigid registration. I don't have any intermediate filters. Hope my 
> answers to your questions help to debug the problem.
>  
> Thanks,
> Ming
> 
> 
> 
> --------------------
> Ming Chao wrote:
>  > Hi,
>  >
>  > I know this question has been asked many times, but it's still not clear
>  > to me how to solve it. I try to register two images which are ~70mb each
>  > (512X512X136). I got the the following error:
>  >
>  > ===================================
>  > ExceptionObject caught !
>  >
>  > itk::ExceptionObject (0129FB70)
>  > Location: "unknown"
>  > File: C: 
> \ITK\InsightToolkit-2.8.1\Code\Common\itkImportImageContainer.txx
>  > Line: 188
>  > Description: Failed to allocate memory for image.
>  >
>  > ===================================
>  >
>  > I am using ITK 2.8.1, VTK 5.01, VC++ 6.0. The operating system is
>  > Windows XP professional edition (32 bits) with Xeon CPU 3.6GHz and 3.0
>  > GB memory. I monitored the memory usage and found that only 280 MB used
>  > for the registration process which is nothing unreasonable. What is
>  > wrong here? How to solve the problem. I know if I filtered the image by
>  > 2X2, then it would be fine, but I would still like to keep the image as
>  > it is.
>  >
>  > Thanks for any hints,
>  > Ming
>  >
>  >
>  >
>  > ------------------------------------------------------------------------
>  >
>  > _______________________________________________
>  > Insight-users mailing list
>  > Insight-users at itk.org <mailto:Insight-users at itk.org>
>  > http://www.itk.org/mailman/listinfo/insight-users 
> <http://www.itk.org/mailman/listinfo/insight-users>
> 
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users




More information about the Insight-users mailing list