Maverick/Reporting progress

From KitwarePublic
< Maverick
Revision as of 02:09, 15 September 2009 by Aylward (talk | contribs) (New page: For internal modules, we use vtkEvents to report progress. For external modules (written as ITK applications using generateCLP), we use the Slicer event reporting mechanism. We've creat...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

For internal modules, we use vtkEvents to report progress.

For external modules (written as ITK applications using generateCLP), we use the Slicer event reporting mechanism. We've created convenience functions to simplify this process.

  1. Slicer already provided method for monitoring ITK filters. We've redistributed that code (and made minor modifications) in Code/Common/itkPluginFilterWatcher.h
  2. We created our own class for progress reporting during modules during periods of computation not allocated to ITK Filters. That code is in Code/Common/mavPluginProgressReporter.h

Both methods work when the external module is loaded as a DLL or as an exec.

itkPluginFilterWatcher

  • Modified version of the function of the same name that is distributed with Slicer.

mavPluginProgressReporter

  • New class that simplifies progress reporting outside of itk filters.
  • Simple example is in Maverick/Modules/Resample.cxx
  • Code snippit is given below:
#include "mavPluginProgressReporter.h"

int main( int argc, char ** argv )
  {
  ...Magic happens here...
  // By using GenerateCLP, a variable "CLPProcessInformation" is created.  This variable
  //   is key to progress reporting from an external module to a Maverick application

  mav::PluginProgressReporter reporter( "Resample", CLPProcessInformation );
  reporter.Start();

  ... do some stuff ...

  reporter.Report( 0.1 );

  ... do more stuff ...

  reporter.Report( 0.9 );

  ...

  reporter.End();
  }