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
......@@ -49,9 +49,11 @@ namespace campvis {
class CAMPVIS_MODULES_API PredicateDemoCarotid2 : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
* Creates a PredicateDemoCarotid2 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 PredicateDemoCarotid2(DataContainer* dc);
explicit PredicateDemoCarotid2(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -60,12 +62,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 "PredicateDemoCarotid2"; };
void onRenderTargetSizeChanged(const AbstractProperty* prop);
......
......@@ -35,8 +35,8 @@
namespace campvis {
PredicateDemoShoulder::PredicateDemoShoulder(DataContainer* dc)
: AutoEvaluationPipeline(dc)
PredicateDemoShoulder::PredicateDemoShoulder(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, _lsp()
, _imageReader()
, _labelReader()
......
......@@ -48,9 +48,11 @@ namespace campvis {
class CAMPVIS_MODULES_API PredicateDemoShoulder : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
* Creates a PredicateDemoShoulder 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 PredicateDemoShoulder(DataContainer* dc);
explicit PredicateDemoShoulder(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -59,12 +61,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 "PredicateDemoShoulder"; };
void onRenderTargetSizeChanged(const AbstractProperty* prop);
......
......@@ -35,8 +35,8 @@
namespace campvis {
PredicateDemoSmallHeart::PredicateDemoSmallHeart(DataContainer* dc)
: AutoEvaluationPipeline(dc)
PredicateDemoSmallHeart::PredicateDemoSmallHeart(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, _lsp()
, _imageReader()
, _labelReader()
......
......@@ -48,9 +48,11 @@ namespace campvis {
class CAMPVIS_MODULES_API PredicateDemoSmallHeart : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
* Creates a PredicateDemoSmallHeart 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 PredicateDemoSmallHeart(DataContainer* dc);
explicit PredicateDemoSmallHeart(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -59,12 +61,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 "PredicateDemoSmallHeart"; };
void onRenderTargetSizeChanged(const AbstractProperty* prop);
......
......@@ -36,7 +36,7 @@ namespace campvis {
// explicitly instantiate templates to register the pipelines
template class PipelineRegistrar<CudaConfidenceMapsDemo>;
template class WorkflowRegistrar<CudaConfidenceMapsWorkflow>
template class WorkflowRegistrar<CudaConfidenceMapsWorkflow>;
template class SmartProcessorRegistrar<CudaConfidenceMapsSolver>;
template class SmartProcessorRegistrar<UsFanRenderer>;
......
......@@ -44,8 +44,8 @@
namespace campvis {
CudaConfidenceMapsDemo::CudaConfidenceMapsDemo(DataContainer* dc)
: AutoEvaluationPipeline(dc)
CudaConfidenceMapsDemo::CudaConfidenceMapsDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, _usIgtlReader()
, _usCropFilter(&_canvasSize)
, _usPreBlur(&_canvasSize)
......@@ -219,8 +219,8 @@ namespace campvis {
// Read fan geomtry from encoded image...
if (p_useSpacingEncodedFanGeometry.getValue()) {
ImageRepresentationGL::ScopedRepresentation img(*_data, _usCropFilter.p_inputImage.getValue());
auto image = reinterpret_cast<const ImageData*>(_data->getData(_usCropFilter.p_inputImage.getValue()).getData());
ImageRepresentationGL::ScopedRepresentation img(*_dataContainer, _usCropFilter.p_inputImage.getValue());
auto image = reinterpret_cast<const ImageData*>(_dataContainer->getData(_usCropFilter.p_inputImage.getValue()).getData());
if (image != nullptr) {
cgt::vec3 encodedData = image->getMappingInformation().getVoxelSize();
p_fanHalfAngle.setValue(encodedData.x / 2.0f);
......@@ -254,7 +254,7 @@ namespace campvis {
filename << _filePrefix << std::setw(4) << std::setfill('0') << _recordedFrames << ".png";
auto url = dir.absoluteFilePath(QString::fromStdString(filename.str())).toStdString();
ScopedTypedData<ImageData> rd(*_data, "us");
ScopedTypedData<ImageData> rd(*_dataContainer, "us");
const ImageRepresentationGL *rep = rd->getRepresentation<ImageRepresentationGL>();
if (rep != 0) {
#ifdef CAMPVIS_HAS_MODULE_DEVIL
......@@ -291,8 +291,8 @@ namespace campvis {
StatisticsEntry entry;
entry.time = (startTime - _objectCreationTime).seconds() * 1000.0f;
ImageRepresentationGL::ScopedRepresentation originalImage(*_data, _usCropFilter.p_outputImage.getValue());
ImageRepresentationGL::ScopedRepresentation downsampledImage(*_data, _usResampler.p_outputImage.getValue());
ImageRepresentationGL::ScopedRepresentation originalImage(*_dataContainer, _usCropFilter.p_outputImage.getValue());
ImageRepresentationGL::ScopedRepresentation downsampledImage(*_dataContainer, _usResampler.p_outputImage.getValue());
if (originalImage && downsampledImage) {
entry.originalWidth = originalImage->getSize().x;
......
......@@ -48,9 +48,11 @@ namespace campvis {
class CAMPVIS_MODULES_API CudaConfidenceMapsDemo : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
* Creates a CudaConfidenceMapsDemo 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 CudaConfidenceMapsDemo(DataContainer *dc);
explicit CudaConfidenceMapsDemo(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -59,7 +61,6 @@ namespace campvis {
/// \see AutoEvaluationPipeline::init()
virtual void init();
/// \see AutoEvaluationPipeline::deinit()
virtual void deinit();
......@@ -69,8 +70,6 @@ namespace campvis {
/// \see AbstractPipeline::onEvent()
virtual void onEvent(cgt::Event* e);
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
static const std::string getId() { return "CudaConfidenceMapsDemo"; };
protected:
......
......@@ -32,7 +32,7 @@ namespace campvis {
, p_pipelineProperties("PipelineProperties", "Main Settings")
, _demoPipeline(nullptr)
{
_demoPipeline = new CudaConfidenceMapsDemo(_dataContainer);
_demoPipeline = new CudaConfidenceMapsDemo(*_dataContainer);
p_pipelineProperties.addPropertyCollection(*_demoPipeline);
......
......@@ -29,8 +29,8 @@ namespace campvis {
namespace fontrendering {
FontRenderingDemo::FontRenderingDemo(DataContainer* dc)
: AutoEvaluationPipeline(dc)
FontRenderingDemo::FontRenderingDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, _tr(&_canvasSize)
{
addProcessor(&_tr);
......
......@@ -37,9 +37,11 @@ namespace fontrendering {
class CAMPVIS_MODULES_API FontRenderingDemo : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
* Creates a FontRenderingDemo 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 FontRenderingDemo(DataContainer* dc);
explicit FontRenderingDemo(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -49,8 +51,6 @@ namespace fontrendering {
/// \see AutoEvaluationPipeline::init()
virtual void init();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
static const std::string getId() { return "fontrendering::FontRenderingDemo"; };
......
......@@ -29,8 +29,8 @@
namespace campvis {
ItkFilterDemo::ItkFilterDemo(DataContainer* dc)
: AutoEvaluationPipeline(dc)
ItkFilterDemo::ItkFilterDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, _lsp()
, _imageReader()
, _itkFilter()
......
......@@ -39,9 +39,11 @@ namespace campvis {
class CAMPVIS_MODULES_API ItkFilterDemo : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
* Creates a ItkFilterDemo 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 ItkFilterDemo(DataContainer* dc);
explicit ItkFilterDemo(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -50,12 +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(); };
static const std::string getId() { return "ItkFilterDemo"; };
protected:
......
......@@ -32,8 +32,8 @@
namespace campvis {
ItkRegistrationDemo::ItkRegistrationDemo(DataContainer* dc)
: AutoEvaluationPipeline(dc)
ItkRegistrationDemo::ItkRegistrationDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, _lsp()
, _imageReader()
, _ve(&_canvasSize)
......
......@@ -39,9 +39,11 @@ namespace campvis {
class CAMPVIS_MODULES_API ItkRegistrationDemo : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
*/
explicit ItkRegistrationDemo(DataContainer* dc);
* Creates a ItkRegistrationDemo 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 ItkRegistrationDemo(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 "ItkRegistrationDemo"; };
protected:
......
......@@ -32,8 +32,8 @@
namespace campvis {
ItkSegmentationDemo::ItkSegmentationDemo(DataContainer* dc)
: AutoEvaluationPipeline(dc)
ItkSegmentationDemo::ItkSegmentationDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, _lsp()
, _imageReader()
, _itkFilter()
......
......@@ -38,9 +38,11 @@ namespace campvis {
class CAMPVIS_MODULES_API ItkSegmentationDemo : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
*/
explicit ItkSegmentationDemo(DataContainer* dc);
* Creates a ItkSegmentationDemo 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 ItkSegmentationDemo(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -49,13 +51,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 "ItkSegmentationDemo"; };
protected:
......
......@@ -35,8 +35,8 @@
namespace campvis {
IvusTcDemo::IvusTcDemo(DataContainer* dc)
: AutoEvaluationPipeline(dc)
IvusTcDemo::IvusTcDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, p_sourceDirectory("SoruceDirectory", "Source Directory", "D:/Medical Data/IVUS/H52 LAD1", StringProperty::DIRECTORY)
, p_readImagesButton("ReadImagesButton", "Read Images")
, p_predicateHistogram("PredicateHistogram", "Voxel Predicate Selection")
......
......@@ -41,9 +41,11 @@ namespace campvis {
class CAMPVIS_MODULES_API IvusTcDemo : public AutoEvaluationPipeline {
public:
/**
* Creates a AutoEvaluationPipeline.
* Creates a IvusTcDemo 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 IvusTcDemo(DataContainer* dc);
explicit IvusTcDemo(DataContainer& dataContainer);
/**
* Virtual Destructor
......@@ -52,13 +54,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 "IvusTcDemo"; };
protected:
......
......@@ -32,8 +32,8 @@
namespace campvis {
IxpvDemo::IxpvDemo(DataContainer* dc)
: AutoEvaluationPipeline(dc)
IxpvDemo::IxpvDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc, getId())
, _tcp(&_canvasSize)
, _xrayReader()
, _ctReader()
......@@ -130,7 +130,7 @@ namespace campvis {
void IxpvDemo::onProcessorValidated(AbstractProcessor* processor) {
if (processor == &_ctReader) {
ImageRepresentationLocal::ScopedRepresentation local(*_data, _ctReader.p_targetImageID.getValue());
ImageRepresentationLocal::ScopedRepresentation local(*_dataContainer, _ctReader.p_targetImageID.getValue());
if (local != 0) {
// update camera
cgt::Bounds volumeExtent = local->getParent()->getWorldBounds();
......@@ -144,7 +144,7 @@ namespace campvis {
}
else if (processor == &_usReader) {
// set TF handles
ImageRepresentationLocal::ScopedRepresentation local(*_data, _usReader.p_targetImageID.getValue());
ImageRepresentationLocal::ScopedRepresentation local(*_dataContainer, _usReader.p_targetImageID.getValue());
if (local != 0) {
Interval<float> ii = local->getNormalizedIntensityRange();
_usSliceRenderer.p_transferFunction.getTF()->setIntensityDomain(cgt::vec2(ii.getLeft(), ii.getRight()));
......
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