<div>Hi Luis,</div>
<div>&nbsp;</div>
<div>Sorry for responding to your message soooo late. I just got a chance to test your suggestions (adding metric-&gt;Initialize() before starting registration) on how to check the memory problem I encountered a few months back. Here is my finding.
</div>
<div>&nbsp;</div>
<div>If I used the normalized correlation metric: I got the following:</div>
<div>&nbsp;</div>
<p>ExceptionObject caught !</p>
<p>itk::ExceptionObject (0124F700)<br>Location: &quot;unknown&quot;<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>&nbsp;</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: &quot;unknown&quot;<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>&nbsp;</div>
<div>In this test, I am registering an MRI (48Mb as fixed image)&nbsp;with a CT (176Mb as moving image) from&nbsp;the same&nbsp;head and neck patient using rigid &nbsp;transformation.</div>
<div>&nbsp;</div>
<div>Ming<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 8/28/06, <b class="gmail_sendername">Luis Ibanez</b> &lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>&gt; 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; metric-&gt;Initialize()<br>&nbsp;</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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;registrationMethod-&gt;StartRegistration()<br><br>and put a try/catch() block aroung the metric-&gt;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>&nbsp;&nbsp; Thanks<br><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp; Luis<br><br><br>-------------------<br>Ming Chao wrote:<br>&gt; Hi Luis,<br>&gt;<br>&gt; Sorry for my late response. Please see the following for your questions.
<br>&gt;<br>&gt;<br>&gt; What tool did you used for monitoring the memory usage ?<br>&gt;<br>&gt; The tool I used is just the Windows Task Manager.<br>&gt;<br>&gt; What was the memory usage for the entire machine ?<br>&gt; (you only reported the usage for the registration application).
<br>&gt;<br>&gt; I don't remember the exact number, but I do know that the registration<br>&gt; application had the largest consumption of memory.&nbsp;&nbsp;I am sure the total<br>&gt; memory usage did not exceed the allowed memory.
<br>&gt;<br>&gt; Do you have other applications running at the same time that<br>&gt; your are running the registration application ?<br>&gt;<br>&gt; No.<br>&gt;<br>&gt; In Windows 32 bits, a process can only access 2Gb of contiguous
<br>&gt; RAM.<br>&gt;<br>&gt; What Image Metric are you using ?<br>&gt; (e.g. is it one of the metrics that computes the image gradient?)<br>&gt;<br>&gt; Normalized Cross Correlation.<br>&gt;<br>&gt; What other ITK and/or VTK filter do you have in that pipeline.
<br>&gt;<br>&gt; I did not have any other filters.<br>&gt;<br>&gt; At what point in the execution of your program do you get this<br>&gt; message ?<br>&gt;<br>&gt; Before the first iteration during the registration which is actually a
<br>&gt; rigid one.<br>&gt;<br>&gt; Have the registration started ?<br>&gt;<br>&gt; Yes.<br>&gt;<br>&gt; Do you got some optimization iterations ?<br>&gt;<br>&gt; No.<br>&gt;<br>&gt; It is very likely that you are actually using most of those
<br>&gt; 2Gb of data, and may have to release memory as your appllication<br>&gt; progresses with its pipeline.<br>&gt;<br>&gt; I am not sure what you meant here. Why do you say that I used most of<br>&gt; the 2GB data? How can I release memory?
<br>&gt;<br>&gt; I want to repeat that my registration is actually very simple one, ie,<br>&gt; rigid registration. I don't have any intermediate filters. Hope my<br>&gt; answers to your questions help to debug the problem.
<br>&gt;<br>&gt; Thanks,<br>&gt; Ming<br>&gt;<br>&gt;<br>&gt;<br>&gt; --------------------<br>&gt; Ming Chao wrote:<br>&gt;&nbsp;&nbsp;&gt; Hi,<br>&gt;&nbsp;&nbsp;&gt;<br>&gt;&nbsp;&nbsp;&gt; I know this question has been asked many times, but it's still not clear
<br>&gt;&nbsp;&nbsp;&gt; to me how to solve it. I try to register two images which are ~70mb each<br>&gt;&nbsp;&nbsp;&gt; (512X512X136). I got the the following error:<br>&gt;&nbsp;&nbsp;&gt;<br>&gt;&nbsp;&nbsp;&gt; ===================================<br>&gt;&nbsp;&nbsp;&gt; ExceptionObject caught !
<br>&gt;&nbsp;&nbsp;&gt;<br>&gt;&nbsp;&nbsp;&gt; itk::ExceptionObject (0129FB70)<br>&gt;&nbsp;&nbsp;&gt; Location: &quot;unknown&quot;<br>&gt;&nbsp;&nbsp;&gt; File: C:<br>&gt; \ITK\InsightToolkit-2.8.1\Code\Common\itkImportImageContainer.txx<br>&gt;&nbsp;&nbsp;&gt; Line: 188
<br>&gt;&nbsp;&nbsp;&gt; Description: Failed to allocate memory for image.<br>&gt;&nbsp;&nbsp;&gt;<br>&gt;&nbsp;&nbsp;&gt; ===================================<br>&gt;&nbsp;&nbsp;&gt;<br>&gt;&nbsp;&nbsp;&gt; I am using ITK 2.8.1, VTK 5.01, VC++ 6.0. The operating system is
<br>&gt;&nbsp;&nbsp;&gt; Windows XP professional edition (32 bits) with Xeon CPU 3.6GHz and 3.0<br>&gt;&nbsp;&nbsp;&gt; GB memory. I monitored the memory usage and found that only 280 MB used<br>&gt;&nbsp;&nbsp;&gt; for the registration process which is nothing unreasonable. What is
<br>&gt;&nbsp;&nbsp;&gt; wrong here? How to solve the problem. I know if I filtered the image by<br>&gt;&nbsp;&nbsp;&gt; 2X2, then it would be fine, but I would still like to keep the image as<br>&gt;&nbsp;&nbsp;&gt; it is.<br>&gt;&nbsp;&nbsp;&gt;<br>&gt;&nbsp;&nbsp;&gt; Thanks for any hints,
<br>&gt;&nbsp;&nbsp;&gt; Ming<br>&gt;&nbsp;&nbsp;&gt;<br>&gt;&nbsp;&nbsp;&gt;<br>&gt;&nbsp;&nbsp;&gt;<br>&gt;&nbsp;&nbsp;&gt; ------------------------------------------------------------------------<br>&gt;&nbsp;&nbsp;&gt;<br>&gt;&nbsp;&nbsp;&gt; _______________________________________________
<br>&gt;&nbsp;&nbsp;&gt; Insight-users mailing list<br>&gt;&nbsp;&nbsp;&gt; <a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a> &lt;mailto:<a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a>&gt;<br>&gt;&nbsp;&nbsp;&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users">
http://www.itk.org/mailman/listinfo/insight-users</a><br>&gt; &lt;<a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;
<br>&gt; ------------------------------------------------------------------------<br>&gt;<br>&gt; _______________________________________________<br>&gt; Insight-users mailing list<br>&gt; <a href="mailto:Insight-users@itk.org">
Insight-users@itk.org</a><br>&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br><br><br></blockquote><br>