<div dir="ltr"><p class="MsoNormal"><font face="Arial"><span style="font-size:10pt" lang="EN-GB">Hello itk 
community,</span></font></p>
<p class="MsoNormal"><font face="Arial"><span style="font-size:10pt" lang="EN-GB">I use deconvolution 
iterative filter to take account of partial volume effect in 3d image. This 
seems to works well but I want to perform an image evaluation at each step of 
the treatment. </span></font></p>
<p class="MsoNormal"><font face="Arial"><span style="font-size:10pt" lang="EN-GB"> I use </span></font><a title="blocked::http://www.itk.org/Doxygen/html/itkIterativeDeconvolutionImageFilter_8h_source.html" href="http://www.itk.org/Doxygen/html/itkIterativeDeconvolutionImageFilter_8h_source.html"><b title="blocked::http://www.itk.org/Doxygen/html/itkIterativeDeconvolutionImageFilter_8h_source.html"><font title="blocked::http://www.itk.org/Doxygen/html/itkIterativeDeconvolutionImageFilter_8h_source.html" color="#4665a2" size="1" face="Courier New"><span style="font-size:9pt;text-decoration:none" lang="EN-GB" title="blocked::http://www.itk.org/Doxygen/html/itkIterativeDeconvolutionImageFilter_8h_source.html">itkIterativeDeconvolutionImageFilter.h</span></font></b></a><font color="black" size="1" face="Courier New"><span style="font-size:9pt"> <span lang="EN-GB">and I don’t know how to stop the iteration at each step, perform 
image analysis and go one.</span></span></font></p>
<p class="MsoNormal"><font color="black" size="1" face="Courier New"><span style="font-size:9pt" lang="EN-GB">This code is inspired from itk software guide but how to modify it 
for my purpose because I didn’t use a registration 
optimizer.</span></font></p>
<p class="MsoNormal"><font color="black" size="1" face="Courier New"><span style="font-size:9pt" lang="EN-GB"> </span></font></p>
<p class="MsoNormal"><font color="black" size="1" face="Courier New"><span style="font-size:9pt" lang="EN-GB"> </span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB">class CommandIterationUpdate : public 
itk::Command</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB">{</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> public:</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> typedef CommandIterationUpdate Self;</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> typedef itk::Command  Superclass;</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> typedef itk::SmartPointer&lt;Self&gt; 
Pointer;</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> </span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> itkNewMacro( Self );</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> </span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> protected: CommandIterationUpdate() {};</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> </span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> typedef 
itk::IterativeDeconvolutionImageFilter</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> //typedef const ???</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> </span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> //typedef 
itk::RegularStepGradientDescentOptimizer</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> //typedef const OptimizerType 
*OptimizerPointer;</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> </span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> void Execute(itk::Object *caller, const itk::EventObject &amp; 
event)</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> {</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB">  Execute( (const itk::Object *)caller, 
event);</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> }</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> </span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> void Execute(const itk::Object * object, const itk::EventObject 
&amp; event)</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> {</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB">  //OptimizerPointer optimizer = dynamic_cast&lt; OptimizerPointer 
&gt;( object );</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB">  //???</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> </span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB">  if( ! itk::IterationEvent().CheckEvent( &amp;event ) 
)</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB">  {</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB">   return;</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB">  }</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> //std::cout&lt;&lt;&quot;Iteration en 
cours:&quot;&lt;&lt;filter-&gt;GetIteration()&lt;&lt;std::endl;</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> SetStopIteration(bool (1));  //for stopping the filter and then 
analyse ?</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB"> </span></font><font face="Courier New"><span style="font-size:11pt">}</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt">};</span></font><font color="black" size="1" face="Courier New"><span style="font-size:9pt" lang="EN-GB"></span></font></p>
<p class="MsoNormal"><font face="Arial"><span style="font-size:10pt" lang="EN-GB"> </span></font></p>
<p class="MsoNormal"><font face="Arial"><span style="font-size:10pt" lang="EN-GB">And then in the main 
function:</span></font></p>
<p class="MsoNormal"><font face="Arial"><span style="font-size:10pt" lang="EN-GB"> </span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB">CommandIterationUpdate::Pointer observer = 
CommandIterationUpdate::New();</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB">filter-&gt;AddObserver( itk::IterationEvent(), observer 
);</span></font></p>
<p class="MsoNormal"><font face="Arial"><span style="font-size:10pt" lang="EN-GB"> </span></font></p>
<p class="MsoNormal"><font face="Arial"><span style="font-size:10pt" lang="EN-GB"> </span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB">filter</span></font><font face="Arial"><span style="font-size:10pt" lang="EN-GB"> 
-&gt;Update();</span></font></p>
<p class=""><font face="Cambria"><span style="font-size:10pt" lang="EN-GB">//perform analysis then 
</span></font></p>
<p class=""><font face="Courier New"><span style="font-size:11pt" lang="EN-GB">SetStopIteration(bool (0));</span></font></p>
<p class="MsoNormal"><font face="Courier New"><span style="font-size:11pt" lang="EN-GB">filter</span></font><font face="Arial"><span style="font-size:10pt" lang="EN-GB"> 
-&gt;Update();</span></font></p>
<p class=""><font face="Cambria"><span style="font-size:10pt" lang="EN-GB">Thanks a 
lot,</span></font></p><p class=""><span style="font-size:10pt;font-family:Cambria">Cyril</span><br></p></div>