<div dir="ltr"><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Arial"><span lang="EN-GB" style="font-size:10pt">Hello itk community,</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Arial"><span lang="EN-GB" style="font-size:10pt">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" style="font-family:arial,sans-serif;font-size:13px"><font face="Arial"><span lang="EN-GB" style="font-size:10pt">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" target="_blank"><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 lang="EN-GB" title="blocked::http://www.itk.org/Doxygen/html/itkIterativeDeconvolutionImageFilter_8h_source.html" style="font-size:9pt;text-decoration:none">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" style="font-family:arial,sans-serif;font-size:13px"><font color="black" size="1" face="Courier New"><span lang="EN-GB" style="font-size:9pt">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" style="font-family:arial,sans-serif;font-size:13px"><font color="black" size="1" face="Courier New"><span lang="EN-GB" style="font-size:9pt"></span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font color="black" size="1" face="Courier New"><span lang="EN-GB" style="font-size:9pt"></span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">class CommandIterationUpdate : public itk::Command</span></font></p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">{</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt">public:</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">typedef CommandIterationUpdate Self;</span></font></p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">typedef itk::Command Superclass;</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt">typedef itk::SmartPointer<Self> Pointer;</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt"></span></font></p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">itkNewMacro( Self );</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt"></span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">protected: CommandIterationUpdate() {};</span></font></p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt"></span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt">typedef itk::IterativeDeconvolutionImageFilter</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">//typedef const ???</span></font></p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt"></span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt">//typedef itk::RegularStepGradientDescentOptimizer</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">//typedef const OptimizerType *OptimizerPointer;</span></font></p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt"></span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt">void Execute(itk::Object *caller, const itk::EventObject & event)</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt">{</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">Execute( (const itk::Object *)caller, event);</span></font></p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">}</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt"></span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">void Execute(const itk::Object * object, const itk::EventObject & event)</span></font></p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">{</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt">//OptimizerPointer optimizer = dynamic_cast< OptimizerPointer >( object );</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt">//???</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt"></span></font></p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">if( ! itk::IterationEvent().CheckEvent( &event ) )</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt">{</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">return;</span></font></p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">}</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt">//std::cout<<"Iteration en cours:"<<filter->GetIteration()<<std::endl;</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt">SetStopIteration(bool (1)); //for stopping the filter and then analyse ?</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt"> </span></font><font face="Courier New"><span style="font-size:11pt">}</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span style="font-size:11pt">};</span></font><font color="black" size="1" face="Courier New"><span lang="EN-GB" style="font-size:9pt"></span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Arial"><span lang="EN-GB" style="font-size:10pt"></span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Arial"><span lang="EN-GB" style="font-size:10pt">And then in the main function:</span></font></p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Arial"><span lang="EN-GB" style="font-size:10pt"></span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt">CommandIterationUpdate::Pointer observer = CommandIterationUpdate::New();</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt">filter->AddObserver( itk::IterationEvent(), observer );</span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Arial"><span lang="EN-GB" style="font-size:10pt"></span></font></p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Arial"><span lang="EN-GB" style="font-size:10pt"></span></font></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px">
<font face="Courier New"><span lang="EN-GB" style="font-size:11pt">filter</span></font><font face="Arial"><span lang="EN-GB" style="font-size:10pt"> ->Update();</span></font></p><p style="font-family:arial,sans-serif;font-size:13px">
<font face="Cambria"><span lang="EN-GB" style="font-size:10pt">//perform analysis then</span></font></p><p style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">SetStopIteration(bool (0));</span></font></p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><font face="Courier New"><span lang="EN-GB" style="font-size:11pt">filter</span></font><font face="Arial"><span lang="EN-GB" style="font-size:10pt"> ->Update();</span></font></p>
<p style="font-family:arial,sans-serif;font-size:13px"><font face="Cambria"><span lang="EN-GB" style="font-size:10pt">Thanks a lot,</span></font></p><p class=""><a name="_MailAutoSig"><span style="font-size:10pt;font-family:Cambria">Jaudet Cyril, PSRPM, PhD</span></a></p>
<p class=""><span style="font-size:10pt;font-family:Cambria">Département
d'Ingénierie et de Physique Médicale</span><span style="font-family:Cambria"></span></p><p class=""><span style="font-size:10pt;font-family:Cambria">Institut Claudius
Regaud</span></p><p class=""><span style="font-size:10pt;font-family:Cambria">20-24, rue du
Pont Saint-Pierre - 31052 Toulouse Cedex</span><span style="font-family:Cambria"></span></p><p class=""><span style="font-size:10pt;font-family:Cambria">Tél. interne:4801
/Tél. externe : 05 67 69 63 46 </span></p><p style="font-family:arial,sans-serif;font-size:13px">
</p><p class=""><span style="font-size:10pt;font-family:Cambria">E-mail : </span><a href="mailto:jaudet.cyril@claudiusregaud.fr"><span style="font-family:Cambria">jaudet.cyril@claudiusregaud.fr</span></a></p></div>