<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<Self> 
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 & 
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 
& 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< OptimizerPointer 
>( 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( &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<<"Iteration en 
cours:"<<filter->GetIteration()<<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->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"> 
->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"> 
->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>