Hi Miklos,
the mitk::ProgressBar is a very simple interface which provides a
centralized view of the applications work progress. Hence you are only
allowed to increment the progress with a relative value, because you
cannot know what other tasks might still be pending. As far as I know,
we do not have a helper class for reporting ITK filter iteration events.
However, here is a simple code snippet which reports ITK events to the
MITK progress bar (provided that the ITK filter supports iteration events):
void SomeClass::DoFiltering()
{
mitk::ProgressBar::GetInstance()->AddStepsToDo(stepCount);
itk::ReceptorMemberCommand<ITKFilterType>::Pointer command =
itk::ReceptorMemberCommand<ITKFilterType>::New();
command->SetCallbackFunction(this, &SomeClass::SetProgress);
itkFilter->AddObserver(itk::IterationEvent(), command);
...
itkFilter->Update();
}
void SomeClass::SetProgress()
{
mitk::ProgressBar::GetInstance()->Progress();
}
The progress bar will be reset if the sum of the progress steps given to
Progress(int steps = 1) >= sum of the steps given to AddStepsToDo(int
steps) (since the last reset).
Best,
Sascha
On 05/26/2011 06:30 PM, Miklos Espak wrote:
> Hi,
>
> I would like to show the progress of some ITK filters on the status
> bar. However, the API of mitk::ProgressBar follows different concepts
> then e.g. QProgressBar or itk::ProcessObject::GetProgress(), e.g. it
> does not allow to set the progress as an absolute value but as an
> advancement since the last reported progress. It is also not possible
> to reset the progress bar.
>
> When are the registered progress bars reset internally? Maybe after
> the following?
> mitk::RenderingManager::GetInstance()->RequestUpdateAll();
>
> Is there an adaptor class eventually to display the progress of a
> filter? Or I have to preserve the last progress status at every
> process event, and subtract from the current one?
>
> Thank you,
> Miklos
>
> ------------------------------------------------------------------------------
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> _______________________________________________
> mitk-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mitk-users
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today.
http://p.sf.net/sfu/quest-dev2dev2
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users