Skip to content

Add ITK/VTK plugin watcher utility classes #13

@finetjul

Description

@finetjul

In order for CLI to report progress, the following output is the standard:

<filter-start>
 <filter-name>...</filter-name>
 ...
</filter-start>
<filter-progress>
...

There is in Slicer (Base/CLI) some utility classes that observe ITK and VTK filters to automatically generate such output.
Such classes should be moved in SlicerExecutionModel as conveniency (and be enabled only if ITK_DIR or VTK_DIR are passed).
A generic progress watcher (whose itkPluginFilterWatcher and vtkPluginFilterWatcher should derive from) should also be added.

class SEMProgressWatcher
{
public:
  SEMProgressWatcher(const char* name, const char* comment = 0, ModuleProcessInformation* inf = 0, double fraction = 1.0, double start = 0.0);
  virtual void Start();
  virtual void SetProgress(double progress);
  virtual void End();
  virtual double GetProgress();
protected:
  void ReportStart();
  void ReportEnd();
  void ReportProgress();
};
class itkPluginFilterWatcher: public itkSimpleFilterWatcher, SEMProgressWatcher
{
...
};
class vtkPluginFilterWatcher: public SEMProgressWatcher
{
...
};

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions