Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ITK/VTK plugin watcher utility classes #13

Open
finetjul opened this issue Jan 18, 2013 · 1 comment
Open

Add ITK/VTK plugin watcher utility classes #13

finetjul opened this issue Jan 18, 2013 · 1 comment

Comments

@finetjul
Copy link
Member

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
{
...
};
@jcfr
Copy link
Member

jcfr commented Jan 19, 2013

See previous discussion on the same topic: http://massmail.spl.harvard.edu/public-archives/slicer-devel/2011/006829.html

jcfr added a commit to jcfr/TubeTK that referenced this issue Jun 3, 2014
This commit fixes the build error mentioning that the
"itkFactoryRegistration.h" header couldn't be found. See [1] and [2]

It basically reverts the original attempt done by commit b74d53f and
references the correct directories using

  ${TubeTK_SLICER_(BINARY|SOURCE)_DIR}/Libs/ITKFactoryRegistration

instead of

  ${TubeTK_SLICER_(BINARY|SOURCE)_DIR}/Libs/itkFactoryRegistration

Note that only build machine having case sensitive file system were
failing. (This excludes Windows and some flavor of MacOSX)

Additionally, it also:

* re-organize the code to minimize duplication by using *_(BINARY|SOURCE)_DIR
variables

* set SlicerExecutionModel cache variables. These variables (listed below)
are used by the macro "SEMMacroBuildCLI" to customize the configuration
and build of CLIs.

* remove the uneeded call to "include_directories(...)" that became
unnecessary after setting the SlicerExecutionModel cache variables.

Let's also point out the inconsistency in usage of variable "TubeTK_USE_VTK"
are not fixed by this commit. For example, SlicerBaseCLI is in-conditionally
checked out but the associated directories are conditionally appended to the
list of additional SlicerExecutionModel directories.

Last but not least, the ideal solution would be update ITKv4 to avoid
the ITKFactoryRegistration hack [3] and also add the plugin watcher
directly to the SlicerExecutionModel [4][5]. This would avoid to depend
on Slicer internal libraries when building TubeTK as a standalone package.

[1] http://open.cdash.org/viewBuildError.php?buildid=3353524

[2] https://travis-ci.org/aylward/TubeTK/builds/26625681

[3] http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21592

[4] http://massmail.spl.harvard.edu/public-archives/slicer-devel/2011/006829.html

[5] Slicer/SlicerExecutionModel#13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants