<div>A </div>We call ReleaseDataFlagOn() on all the filters except the last one and the ones that have more than a downstream filter to release intermediate images once they are not useful anymore. But if you are activating streaming on the writer sink. maybe this will not improve your memory consumption too much.<div>

<br></div><div>Also I may ask if you use streaming when there is no writer at the end? and if yes, how you enable streaming in this case?<br><div><br></div><div>Thanks</div><div><br></div><div>Sergio<br><br><div class="gmail_quote">
On Wed, Nov 10, 2010 at 8:54 AM, Jerome Maudlin <span dir="ltr">&lt;<a href="mailto:jerome.maudlin@gmail.com" target="_blank">jerome.maudlin@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear all,<div><br></div><div>I am implementing a processing chain which has strong constraints in terms of computational time and memory footprint. We are also forced to use one single thread for whole pipeline.</div>

<div>
<br></div><div>I have identified several ways for optimizing my code, but I was wondering if there are other things I could do. Here is what I have found until now:</div><div><br></div><div>1. For multi-channel images, the use of scalar images with FixedArray pixels gives a 1.5 speedup factor with respect to the use of VectorImage with scalar pixel types (I know the number of bands at compilation time).</div>


<div><br></div><div>2. Even though I need to work with real types for the computations (physical magnitudes between 0 and 1), I found that writing intermediate results to files using real types is much slower than multiplying the values by a large constant and writing the result to disk using integer types.</div>


<div><br></div><div><div>I was also wondering if there is a smart way to choose the number of streaming divisions for the writer in order to ensure that the memory footprint of my program does not goes beyond a given size (other than try and error).</div>


<div><br></div><div>Thank you very much for your help.</div><div><br></div><font color="#888888"><div>JM</div></font></div><div><br></div><div>PS: If there are general guidelines for this kind of optimization, maybe there should be a chapter in the software guide or a wiki page for this topic?</div>


<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Sergio Vera<br><br> Alma IT Systems<br> C/ Vilana, 4B, 4º 1ª<br> 08022 Barcelona<br> T. (+34) 932 380 592<br> <a href="http://www.alma3d.com" target="_blank">www.alma3d.com</a><br>

</div></div>