<div>Hi Luis,</div>
<div> </div>
<div>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.
</div>
<div> </div>
<div>If I used the normalized correlation metric: I got the following:</div>
<div> </div>
<p>ExceptionObject caught !</p>
<p>itk::ExceptionObject (0124F700)<br>Location: "unknown"<br>File: C:\ITK\InsightToolkit-2.8.1\Code\Algorithms\itkImageToImageMetric.txx<br>Line: 73<br>Description: itk::ERROR: NormalizedCorrelationImageToImageMetric(02482930): Tran
<br>sform is not present<br></p>
<div> </div>
<div>However, if I use Mattes mutual information metric, I got the following:</div>
<p>ExceptionObject caught !</p>
<p>itk::ExceptionObject (0129ED18)<br>Location: "unknown"<br>File: C:\ITK\InsightToolkit-2.8.1\Code\Algorithms\itkImageToImageMetric.txx<br>Line: 83<br>Description: itk::ERROR: MattesMutualInformationImageToImageMetric(024D2810): Mo
<br>vingImage is not present<br></p>
<div> </div>
<div>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.</div>
<div> </div>
<div>Ming<br><br> </div>
<div><span class="gmail_quote">On 8/28/06, <b class="gmail_sendername">Luis Ibanez</b> <<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>> wrote:</span></div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Hi Ming,<br><br>Thanks for providing the answers to our questions.<br><br>From the additional information that you posted, it
<br>seems that the main suspect may be the computation<br>of the gradient image that is performed during the<br>initialization of the ImageMetric.<br><br><br>Please add a call:</blockquote>
<div> </div>
<div> metric->Initialize()<br> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">just before you call<br><br> registrationMethod->StartRegistration()<br><br>and put a try/catch() block aroung the metric->Initialize()
<br>call, along with a very unique message in the catch block.<br><br>Then rerun your registration.<br><br>In this way we should be able to identify if the problem<br>happens during the initialization of Metric.<br><br><br>
Please let us know what you find.<br><br><br><br> Thanks<br><br><br><br> Luis<br><br><br>-------------------<br>Ming Chao wrote:<br>> Hi Luis,<br>><br>> Sorry for my late response. Please see the following for your questions.
<br>><br>><br>> What tool did you used for monitoring the memory usage ?<br>><br>> The tool I used is just the Windows Task Manager.<br>><br>> What was the memory usage for the entire machine ?<br>> (you only reported the usage for the registration application).
<br>><br>> I don't remember the exact number, but I do know that the registration<br>> application had the largest consumption of memory. I am sure the total<br>> memory usage did not exceed the allowed memory.
<br>><br>> Do you have other applications running at the same time that<br>> your are running the registration application ?<br>><br>> No.<br>><br>> In Windows 32 bits, a process can only access 2Gb of contiguous
<br>> RAM.<br>><br>> What Image Metric are you using ?<br>> (e.g. is it one of the metrics that computes the image gradient?)<br>><br>> Normalized Cross Correlation.<br>><br>> What other ITK and/or VTK filter do you have in that pipeline.
<br>><br>> I did not have any other filters.<br>><br>> At what point in the execution of your program do you get this<br>> message ?<br>><br>> Before the first iteration during the registration which is actually a
<br>> rigid one.<br>><br>> Have the registration started ?<br>><br>> Yes.<br>><br>> Do you got some optimization iterations ?<br>><br>> No.<br>><br>> It is very likely that you are actually using most of those
<br>> 2Gb of data, and may have to release memory as your appllication<br>> progresses with its pipeline.<br>><br>> I am not sure what you meant here. Why do you say that I used most of<br>> the 2GB data? How can I release memory?
<br>><br>> I want to repeat that my registration is actually very simple one, ie,<br>> rigid registration. I don't have any intermediate filters. Hope my<br>> answers to your questions help to debug the problem.
<br>><br>> Thanks,<br>> Ming<br>><br>><br>><br>> --------------------<br>> Ming Chao wrote:<br>> > Hi,<br>> ><br>> > I know this question has been asked many times, but it's still not clear
<br>> > to me how to solve it. I try to register two images which are ~70mb each<br>> > (512X512X136). I got the the following error:<br>> ><br>> > ===================================<br>> > ExceptionObject caught !
<br>> ><br>> > itk::ExceptionObject (0129FB70)<br>> > Location: "unknown"<br>> > File: C:<br>> \ITK\InsightToolkit-2.8.1\Code\Common\itkImportImageContainer.txx<br>> > Line: 188
<br>> > Description: Failed to allocate memory for image.<br>> ><br>> > ===================================<br>> ><br>> > I am using ITK 2.8.1, VTK 5.01, VC++ 6.0. The operating system is
<br>> > Windows XP professional edition (32 bits) with Xeon CPU 3.6GHz and 3.0<br>> > GB memory. I monitored the memory usage and found that only 280 MB used<br>> > for the registration process which is nothing unreasonable. What is
<br>> > wrong here? How to solve the problem. I know if I filtered the image by<br>> > 2X2, then it would be fine, but I would still like to keep the image as<br>> > it is.<br>> ><br>> > Thanks for any hints,
<br>> > Ming<br>> ><br>> ><br>> ><br>> > ------------------------------------------------------------------------<br>> ><br>> > _______________________________________________
<br>> > Insight-users mailing list<br>> > <a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a> <mailto:<a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a>><br>> > <a href="http://www.itk.org/mailman/listinfo/insight-users">
http://www.itk.org/mailman/listinfo/insight-users</a><br>> <<a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a>><br>><br>><br>><br>><br>>
<br>> ------------------------------------------------------------------------<br>><br>> _______________________________________________<br>> Insight-users mailing list<br>> <a href="mailto:Insight-users@itk.org">
Insight-users@itk.org</a><br>> <a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br><br><br></blockquote><br>