<div>Hi Luis, </div>
<div>thanks for your answer. I&#39;m implementing a level set filter that involves to iterate with a process f_{n+1}=f_n+dt*A_n, but I want to understand how the itk FiniteDifference works for any problem.  In the curvature example, If I understand the term f_n+dt*A_n will be computed in </div>

<div> </div>
<div><a href="http://www.itk.org/Doxygen/html/classitk_1_1DenseFiniteDifferenceImageFilter.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1DenseFiniteDifferenceImageFilter.html</a></div>
<div> </div>
<div> </div>
<div>by </div>
<div>DenseFiniteDifferenceImageFilter::ApplyUpdate(TimeStepType dt)<br>{<br>  // Set up for multithreaded processing.<br>  DenseFDThreadStruct str;<br>  str.Filter = this;<br>  str.TimeStep = dt;<br>  this-&gt;GetMultiThreader()-&gt;SetNumberOfThreads(this-&gt;GetNumberOfThreads());<br>
  this-&gt;GetMultiThreader()-&gt;SetSingleMethod(this-&gt;ApplyUpdateThreaderCallback,<br>                                            &amp;str);<br>  // Multithread the execution<br>  this-&gt;GetMultiThreader()-&gt;SingleMethodExecute();</div>

<div>  // Explicitely call Modified on GetOutput here<br>  // since ThreadedApplyUpdate changes this buffer<br>  // through iterators which do not increment the<br>  // output timestamp<br>  this-&gt;GetOutput()-&gt;Modified();<br>
}<br></div>
<div>is the </div>
<div> </div>
<div> this-&gt;ApplyUpdate(dt); // FiniteDifferenceImageFilter&lt;TInputImage, TOutputImage&gt;::GenerateData()</div>
<div> </div>
<div>that will generate an approximation at iteration n of f_n</div>
<div><br>Thanks, <br><br></div>
<div class="gmail_quote">On Mon, May 3, 2010 at 1:17 AM, Luis Ibanez <span dir="ltr">&lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hi Elhadj,<br><br>The FiniteDifferenceImageFilter is designed as a base class:<br><br><a href="http://www.itk.org/Doxygen/html/classitk_1_1FiniteDifferenceImageFilter.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1FiniteDifferenceImageFilter.html</a><br>
<br>You should create a new filter that derives from it and in that<br>derived class you can re-implement several of its methods.<br><br>See for example, its derived class:<br><br><a href="http://www.itk.org/Doxygen/html/classitk_1_1DenseFiniteDifferenceImageFilter.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1DenseFiniteDifferenceImageFilter.html</a><br>
<br>that in turn, is derived into:<br><br><a href="http://www.itk.org/Doxygen/html/classitk_1_1CurvatureFlowImageFilter.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1CurvatureFlowImageFilter.html</a><br>
<br>Other examples are:<br><br><a href="http://www.itk.org/Doxygen/html/classitk_1_1GradientAnisotropicDiffusionImageFilter.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1GradientAnisotropicDiffusionImageFilter.html</a><br>
<a href="http://www.itk.org/Doxygen/html/classitk_1_1MinMaxCurvatureFlowImageFilter.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1MinMaxCurvatureFlowImageFilter.html</a><br><a href="http://www.itk.org/Doxygen/html/classitk_1_1VectorGradientAnisotropicDiffusionImageFilter.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1VectorGradientAnisotropicDiffusionImageFilter.html</a><br>
<a href="http://www.itk.org/Doxygen/html/classitk_1_1VectorCurvatureAnisotropicDiffusionImageFilter.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1VectorCurvatureAnisotropicDiffusionImageFilter.html</a><br>
<br><br>Could you describe the type of Finite Differences<br>processing that you are trying to implement ?<br><br>It is likely that there are more specific image filters<br>already in ITK from which you could start your<br>
implementation.<br><br><br>    Please let us know,<br><br><br>         Thanks<br><br><br>              Luis<br><br><br>-----------------------------------------------------------------------------<br>On Sun, May 2, 2010 at 5:39 PM, elhadj meljane &lt;<a href="mailto:elhadj.meljane@gmail.com">elhadj.meljane@gmail.com</a>&gt; wrote:<br>
&gt; Hi all,<br>&gt; I try to use  itkFiniteDifferenceImageFilter to iterate with<br>&gt; f_{n+1} = f_n +dt*A_n<br>&gt; and I don&#39;t know how to introduce the A_n in this filter, I guess is done in<br>&gt; the filter with ?<br>
&gt; FiniteDifferenceImageFilter&lt;..&gt;::GenerateData()<br>&gt; {<br>&gt; ...<br>&gt; this-&gt;ApplyUpdate()<br>&gt; ...<br>&gt; }<br>&gt;<br>&gt; is there an itk simple example of an implemntation of the ApplyUpdate() and<br>
&gt; how to use it to iterate with this filter.<br>&gt;<br>&gt; Thanks,<br>&gt; Elhadj,<br>&gt; _____________________________________<br>&gt; Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>
&gt;<br>&gt; Visit other Kitware open-source projects at<br>&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>&gt;<br>&gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt; <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>&gt;<br>&gt; Please keep messages on-topic and check the ITK FAQ at:<br>&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;<br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>&gt;<br>&gt;<br></blockquote>
</div><br>