<div dir="ltr"><div>Cyril,</div><div><br></div><div>It may help to look at the class:</div><div><br></div><div>                                             itkDeconvolutionIterationCommand.h</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></div>
<div><br></div><div>In the Directory:</div><div><br></div><div>                                     ITK/Modules/Filtering/Deconvolution/test</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>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><br></div><div><br></div><div><br></div><div>    Regards,</div>
<div><br></div><div><br></div><div>          Luis</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 9, 2014 at 1:02 PM, 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"><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" 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 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><font face="Cambria"><span style="font-size:10pt" lang="EN-GB">//perform analysis then 
</span></font></p>
<p><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><font face="Cambria"><span style="font-size:10pt" lang="EN-GB">Thanks a 
lot,</span></font></p><p><span style="font-size:10pt;font-family:Cambria">Cyril</span><br></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>