16.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 12f36262 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Added a field _pipelineName to AutoEvaluationPipeline. This allows to...

Added a field _pipelineName to AutoEvaluationPipeline. This allows to implement AutoEvaluationPipeline::getName() so that AutoEvaluationPipeline is no longer abstract. Consequently, the LuaPipeline is no longer needed.

This change was also used to change the AbstractPipeline constructor signature to pass-by-reference instead of pass-by-pointer for the pipeline's DataContainer. This presents the semantics more clearly since the DataContainer must not be 0.
parent 50c0b05d
......@@ -50,9 +50,11 @@ namespace campvis {
class CAMPVIS_MODULES_API IxpvDemo : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
* Creates a IxpvDemo pipeline.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/
explicit IxpvDemo(DataContainer* dc);
explicit IxpvDemo(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -62,8 +64,6 @@ namespace campvis {
/// \see AutoEvaluationPipeline::init()
virtual void init();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
static const std::string getId() { return "IxpvDemo"; };
//virtual void keyEvent(cgt::KeyEvent* e);
......
......@@ -34,10 +34,9 @@
namespace campvis {
MicroscopyImageSegmentationDemo::MicroscopyImageSegmentationDemo(DataContainer* dc)
: AutoEvaluationPipeline(dc)
MicroscopyImageSegmentationDemo::MicroscopyImageSegmentationDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, _lsp()
//, _imageReader(new IVec2Property("CanvasSize", "Canvas Size", cgt::ivec2(128, 128), cgt::ivec2(1, 1), cgt::ivec2(4096, 4096)))
, _ve(&_canvasSize)
{
addProcessor(&_lsp);
......
......@@ -39,9 +39,11 @@ namespace campvis {
class CAMPVIS_MODULES_API MicroscopyImageSegmentationDemo : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
* Creates a MicroscopyImageSegmentationDemo pipeline.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/
explicit MicroscopyImageSegmentationDemo(DataContainer* dc);
explicit MicroscopyImageSegmentationDemo(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -50,13 +52,9 @@ namespace campvis {
/// \see AutoEvaluationPipeline::init()
virtual void init();
/// \see AutoEvaluationPipeline::deinit()
virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
/// \see AbstractPipeline::getId()
static const std::string getId() { return "MicroscopyImageSegmentationDemo"; };
protected:
......
......@@ -37,8 +37,8 @@
namespace campvis {
NeuroDemo::NeuroDemo(DataContainer* dc)
: AutoEvaluationPipeline(dc)
NeuroDemo::NeuroDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, _lsp()
, _tcp(&_canvasSize)
, _ctReader()
......
......@@ -41,9 +41,11 @@ namespace campvis {
class CAMPVIS_MODULES_API NeuroDemo : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
* Creates a NeuroDemo pipeline.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/
explicit NeuroDemo(DataContainer* dc);
explicit NeuroDemo(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -54,9 +56,6 @@ namespace campvis {
virtual void init();
virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
/// \see AbstractPipeline::getId()
static const std::string getId() { return "NeuroDemo"; };
/// \see AbstractPipeline::executePipeline()
......
......@@ -37,8 +37,8 @@
namespace campvis {
ViscontestDemo::ViscontestDemo(DataContainer* dc)
: AutoEvaluationPipeline(dc)
ViscontestDemo::ViscontestDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, _lsp()
, _tcp(&_canvasSize)
, _fiberReader()
......
......@@ -43,9 +43,11 @@ namespace campvis {
class CAMPVIS_MODULES_API ViscontestDemo : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
* Creates a ViscontestDemo pipeline.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/
explicit ViscontestDemo(DataContainer* dc);
explicit ViscontestDemo(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -56,9 +58,6 @@ namespace campvis {
virtual void init();
virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
/// \see AbstractPipeline::getId()
static const std::string getId() { return "ViscontestDemo"; };
/// \see AbstractPipeline::executePipeline()
......
......@@ -28,8 +28,8 @@
namespace campvis {
StreamingOIGTLDemo::StreamingOIGTLDemo(DataContainer* dc)
: AutoEvaluationPipeline(dc)
StreamingOIGTLDemo::StreamingOIGTLDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
{
addProcessor(&_igtlClient);
addProcessor(&_matrixProcessor);
......
......@@ -36,9 +36,11 @@ namespace campvis {
class CAMPVIS_MODULES_API StreamingOIGTLDemo : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
* Creates a StreamingOIGTLDemo pipeline.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/
explicit StreamingOIGTLDemo(DataContainer *dc);
explicit StreamingOIGTLDemo(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -47,12 +49,9 @@ namespace campvis {
/// \see AutoEvaluationPipeline::init()
virtual void init();
/// \see AutoEvaluationPipeline::deinit()
virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
static const std::string getId() { return "StreamingOpenIGTLinkDemo"; };
void onRenderTargetSizeChanged(const AbstractProperty *prop);
......
......@@ -35,8 +35,8 @@
namespace campvis {
MorphologyDemo::MorphologyDemo(DataContainer* dc)
: AutoEvaluationPipeline(dc)
MorphologyDemo::MorphologyDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, _lsp()
, _imageReader()
, _morphologyFilter(&_canvasSize)
......
......@@ -37,9 +37,11 @@ namespace campvis {
class CAMPVIS_MODULES_API MorphologyDemo : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
* Creates a MorphologyDemo pipeline.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/
explicit MorphologyDemo(DataContainer* dc);
explicit MorphologyDemo(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -48,12 +50,9 @@ namespace campvis {
/// \see AutoEvaluationPipeline::init()
virtual void init();
/// \see AutoEvaluationPipeline::deinit()
virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
static const std::string getId() { return "MorphologyDemo"; };
protected:
......
......@@ -35,8 +35,8 @@
namespace campvis {
ResamplingDemo::ResamplingDemo(DataContainer* dc)
: AutoEvaluationPipeline(dc)
ResamplingDemo::ResamplingDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, _lsp()
, _imageReader()
, _resampler(&_canvasSize)
......
......@@ -37,9 +37,11 @@ namespace campvis {
class CAMPVIS_MODULES_API ResamplingDemo : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
* Creates a ResamplingDemo pipeline.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/
explicit ResamplingDemo(DataContainer* dc);
explicit ResamplingDemo(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -48,12 +50,9 @@ namespace campvis {
/// \see AutoEvaluationPipeline::init()
virtual void init();
/// \see AutoEvaluationPipeline::deinit()
virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
static const std::string getId() { return "ResamplingDemo"; };
protected:
......
......@@ -59,8 +59,8 @@ namespace registration {
GenericOption<nlopt::algorithm>("neldermead", "Nelder-Mead Simplex", nlopt::LN_NELDERMEAD)
};
NloptRegistration::NloptRegistration(DataContainer* dc)
: AutoEvaluationPipeline(dc)
NloptRegistration::NloptRegistration(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, p_optimizer("Optimizer", "Optimizer", optimizers, 3)
, p_liveUpdate("LiveUpdate", "Live Update of Difference Image", false)
, p_performOptimization("PerformOptimization", "Perform Optimization")
......@@ -202,7 +202,7 @@ namespace registration {
_sm.p_rotation.setValue(r);
// compute difference image and render difference volume
_sm.generateDifferenceImage(_data, referenceImage, movingImage, t, r);
_sm.generateDifferenceImage(_dataContainer, referenceImage, movingImage, t, r);
_ve.process(getDataContainer());
}
......
......@@ -47,9 +47,11 @@ namespace registration {
class CAMPVIS_MODULES_API NloptRegistration : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
* Creates a NloptRegistration pipeline.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/
explicit NloptRegistration(DataContainer* dc);
explicit NloptRegistration(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -61,8 +63,6 @@ namespace registration {
/// \see AutoEvaluationPipeline::deinit()
virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
static const std::string getId() { return "registration::NloptRegistration"; };
GenericOptionProperty<nlopt::algorithm> p_optimizer; ///< Optimizer Algorithm
......
......@@ -31,8 +31,8 @@
namespace campvis {
TensorDemo::TensorDemo(DataContainer* dc)
: AutoEvaluationPipeline(dc)
TensorDemo::TensorDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, _tcp(&_canvasSize)
, _lsp()
, _imageReader()
......
......@@ -43,8 +43,10 @@ namespace campvis {
public:
/**
* Small demo pipeline for tensor data visualization.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/
explicit TensorDemo(DataContainer* dc);
explicit TensorDemo(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -54,9 +56,6 @@ namespace campvis {
/// \see AutoEvaluationPipeline::init()
virtual void init();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
/// \see AbstractPipeline::getId()
static const std::string getId() { return "TensorDemo"; };
protected:
......
......@@ -37,8 +37,8 @@ namespace campvis {
GenericOption<std::string>("particles", "Particle Simulation"),
};
VectorFieldDemo::VectorFieldDemo(DataContainer* dc)
: AutoEvaluationPipeline(dc)
VectorFieldDemo::VectorFieldDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, _tcp(&_canvasSize)
, _lsp()
, _imageReader()
......@@ -132,7 +132,7 @@ namespace campvis {
void VectorFieldDemo::onProcessorValidated(AbstractProcessor* processor) {
if (processor == &_imageReader) {
// update camera
ScopedTypedData<ImageData> img(*_data, _sliceRenderer.p_sourceImageID.getValue());
ScopedTypedData<ImageData> img(*_dataContainer, _sliceRenderer.p_sourceImageID.getValue());
if (img) {
p_sliceNumber.setMaxValue(static_cast<int>(img->getSize().z));
}
......
......@@ -43,8 +43,10 @@ namespace campvis {
public:
/**
* Small demo pipeline for vector field visualization.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/
explicit VectorFieldDemo(DataContainer* dc);
explicit VectorFieldDemo(DataContainer& dc);
/**
* Virtual Destructor
......@@ -53,13 +55,9 @@ namespace campvis {
/// \see AutoEvaluationPipeline::init()
virtual void init();
/// \see AutoEvaluationPipeline::deinit()
virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
/// \see AbstractPipeline::getId()
static const std::string getId() { return "VectorFieldDemo"; };
protected:
......
......@@ -34,8 +34,8 @@
namespace campvis {
AdvDVRVis::AdvDVRVis(DataContainer* dc)
: AutoEvaluationPipeline(dc)
AdvDVRVis::AdvDVRVis(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, _lsp()
, _imageReader()
, _resampler(&_canvasSize)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment