[Insight-users] How to get a progess from an iterator?

Luis Ibanez luis.ibanez at kitware.com
Sun Dec 6 16:48:25 EST 2009


Hi Lynx,

Nope,
In practice, the progress reporting functionalities have
been implemented by using the ProgressReporter
class, and by inter-twining it in the while-loop of the
iterator.


Se for example the code in the BinaryFunctor filter

  #include "itkProgressReporter.h"

  ProgressReporter progress(this, threadId,
outputRegionForThread.GetNumberOfPixels());

  inputIt1.GoToBegin();
  inputIt2.GoToBegin();
  outputIt.GoToBegin();

  while( !inputIt1.IsAtEnd() )
    {
    outputIt.Set( m_Functor( inputIt1.Get(), inputIt2.Get() ) );
    ++inputIt2;
    ++inputIt1;
    ++outputIt;
    progress.CompletedPixel(); // potential exception thrown here
    }


This results in ProgressEvents() being invoked from the filter.


---

   Luis


-----------------------------------------------------------------------
On Fri, Dec 4, 2009 at 6:12 AM,  <lynx.abraxas at freenet.de> wrote:
> Hello!
>
>
> Is there any way to get a progress information of an iterator (of a FaceList)?
> Basicly just where is it at the moment relative to the whole image?
>
> Thanks for any help or hints
> Lynx
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list