[Insight-users] Failed to allocate memory for image

Ming Chao mingchao2005 at gmail.com
Thu Dec 14 13:28:53 EST 2006


Hi Luis,

Sorry for responding to your message soooo late. I just got a chance to test
your suggestions (adding metric->Initialize() before starting registration)
on how to check the memory problem I encountered a few months back. Here is
my finding.

If I used the normalized correlation metric: I got the following:


ExceptionObject caught !

itk::ExceptionObject (0124F700)
Location: "unknown"
File: C:\ITK\InsightToolkit-2.8.1\Code\Algorithms\itkImageToImageMetric.txx
Line: 73
Description: itk::ERROR: NormalizedCorrelationImageToImageMetric(02482930):
Tran
sform is not present

However, if I use Mattes mutual information metric, I got the following:

ExceptionObject caught !

itk::ExceptionObject (0129ED18)
Location: "unknown"
File: C:\ITK\InsightToolkit-2.8.1\Code\Algorithms\itkImageToImageMetric.txx
Line: 83
Description: itk::ERROR:
MattesMutualInformationImageToImageMetric(024D2810): Mo
vingImage is not present

In this test, I am registering an MRI (48Mb as fixed image) with a CT (176Mb
as moving image) from the same head and neck patient using rigid
 transformation.

Ming


On 8/28/06, Luis Ibanez <luis.ibanez at kitware.com> wrote:

>
> 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
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20061214/0eca1c40/attachment.htm


More information about the Insight-users mailing list