Julien:<br><br>I can understand your issue with being bogged down by memory. However, I don&#39;t completely agree with your proposed solution. Here are my disagreements.<br><br><div><span class="gmail_quote">On 11/8/07, <b class="gmail_sendername">
Julien Michel</b> &lt;<a href="mailto:julien.michel@c-s.cnes.fr">julien.michel@c-s.cnes.fr</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
For instance, in itk::Image, the GetMemoryPrint() implementation would be:</blockquote><div><br>1. Its hard to do this for all dataobjects. They will require information available only at run-time. <br>Consider itk::Image&lt; itk::VariableLengthVector&lt; double &gt; &gt;. This will in reality require you to traverse each pixel and find out its size.&nbsp; 
<br>You will notice that there are several dataobjects that fit this description.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
- in itk::ProcessObject<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size+=this-&gt;GetOutput(idx)-&gt;GetMemoryPrint();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size+=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this-&gt;GetInput(idx)-&gt;GetSource()-&gt;GetPipelineMemoryPrint();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</blockquote><div><br>2. This is based on the assumption that the outputs have already been generated. That would defeat your purpose, since your intention is to use this as a query prior to updating. 
<br>Let&#39;s assume that we are smarter and stick this somewhere during the pipeline information update stage (which occurs before the data-update stage), sometime after itk::ProcessObject::GenerateOutputInformation() / GenerateInputRequestedRegion(). 
<br><br>In that case, we do not know about the run-time pixel sizes as illustrated in point 1. It would work for for images where the pixel-size information is known at build time.<br><br>3. All this is considering is memory related to filter inputs and outputs. Let&#39;s take filters that have mini-pipelines etc. The HessianRecursiveGaussian is one such beast that uses a series of filters inside, as many as the image dimension. 
<br><br>4. Then there is the argument. Are we talking about the peak memory usage or the memory of the pipeline itself.<br><br>I think is a fairly tricky problem to address. <br><br>Regards<br>-- <br>Karthik Krishnan<br>R&amp;D Engineer,
<br>Kitware Inc.<br>Ph: 518 371 3971 x119<br>Fax: 518 371 3971
<br></div></div>