<div dir="ltr">Cyril,<div><br></div><div>It may help to look at the class:</div><div><br></div><div>                                             itkDeconvolutionIterationCommand.h<br></div><div><br></div><div><a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/Deconvolution/test/itkDeconvolutionIterationCommand.h">https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/Deconvolution/test/itkDeconvolutionIterationCommand.h</a><br>
</div><div><br></div><div><div>In the Directory:</div><div><br></div><div>                                     ITK/Modules/Filtering/Deconvolution/test<br></div></div><div><br></div><div><br></div><div>and how it is used in the tests (in the same directory):</div>
<div><br></div><div><div><div>itkDeconvolutionIterationCommand.h:19:#ifndef __itkDeconvolutionIterationCommand_h</div><div>itkDeconvolutionIterationCommand.h:20:#define __itkDeconvolutionIterationCommand_h</div><div>itkDeconvolutionIterationCommand.h:28:class DeconvolutionIterationCommand : public itk::Command</div>
<div>itkDeconvolutionIterationCommand.h:31:  typedef DeconvolutionIterationCommand  Self;</div><div>itkDeconvolutionIterationCommand.h:68:  DeconvolutionIterationCommand()</div><div>itkLandweberDeconvolutionImageFilterTest.cxx:23:#include "itkDeconvolutionIterationCommand.h"</div>
<div>itkLandweberDeconvolutionImageFilterTest.cxx:74:  typedef itk::DeconvolutionIterationCommand< DeconvolutionFilterType > IterationCommandType;</div><div>itkProjectedLandweberDeconvolutionImageFilterTest.cxx:22:#include "itkDeconvolutionIterationCommand.h"</div>
<div>itkProjectedLandweberDeconvolutionImageFilterTest.cxx:66:  typedef itk::DeconvolutionIterationCommand< DeconvolutionFilterType > IterationComman</div><div>itkRichardsonLucyDeconvolutionImageFilterTest.cxx:23:#include "itkDeconvolutionIterationCommand.h"</div>
<div>itkRichardsonLucyDeconvolutionImageFilterTest.cxx:67:  typedef itk::DeconvolutionIterationCommand< DeconvolutionFilterType > IterationCommandTyp</div></div></div><div><br></div><div><br></div><div><br></div><div>
    Regards,</div><div><br></div><div><br></div><div>          Luis</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 10, 2014 at 3:03 AM, Cyril Jaudet <span dir="ltr"><<a href="mailto:drcjaudet@gmail.com" target="_blank">drcjaudet@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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><a name="1437b2dc63e2cff6__MailAutoSig"><span style="font-size:10pt;font-family:Cambria">Jaudet Cyril, PSRPM, PhD</span></a></p>

<p><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><span style="font-size:10pt;font-family:Cambria">Institut Claudius
Regaud</span></p><p><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><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><span style="font-size:10pt;font-family:Cambria">E-mail : </span><a href="mailto:jaudet.cyril@claudiusregaud.fr" target="_blank"><span style="font-family:Cambria">jaudet.cyril@claudiusregaud.fr</span></a></p></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.php" target="_blank">http://www.kitware.com/products/protraining.php</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>_______________________________________________<br>
Community mailing list<br>
<a href="mailto:Community@itk.org">Community@itk.org</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/community" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/community</a><br>
<br></blockquote></div><br></div>