Refactored pipeline and processor registration:

PipelineRegistry and ProcessorRegistry are now part of campvis-core. Furthermore, moved all calls to PipelineRegistrar<>/SmartProcessorRegistrar<> to a separate cpp file for each module. This way all registrations are at one central location and including headers in external projects does not lead to double registration.

This commit also removes the obsolete columbia and manualsegmentation modules.
parent abcf155a
...@@ -45,11 +45,11 @@ ...@@ -45,11 +45,11 @@
#include "core/tools/quadrenderer.h" #include "core/tools/quadrenderer.h"
#include "core/pipeline/abstractpipeline.h" #include "core/pipeline/abstractpipeline.h"
#include "core/pipeline/abstractworkflow.h" #include "core/pipeline/abstractworkflow.h"
#include "core/pipeline/pipelinefactory.h"
#include "core/pipeline/pipelinepainter.h" #include "core/pipeline/pipelinepainter.h"
#include "core/datastructures/imagerepresentationconverter.h" #include "core/datastructures/imagerepresentationconverter.h"
#include "core/pipeline/visualizationprocessor.h" #include "core/pipeline/visualizationprocessor.h"
#include "modules/pipelinefactory.h"
#include "qtjobprocessor.h" #include "qtjobprocessor.h"
#include <QApplication> #include <QApplication>
......
...@@ -35,8 +35,9 @@ ...@@ -35,8 +35,9 @@
#include "core/datastructures/datacontainer.h" #include "core/datastructures/datacontainer.h"
#include "core/pipeline/abstractpipeline.h" #include "core/pipeline/abstractpipeline.h"
#include "core/pipeline/abstractprocessor.h" #include "core/pipeline/abstractprocessor.h"
#include "core/pipeline/pipelinefactory.h"
#include "core/pipeline/processorfactory.h"
#include "core/tools/stringutils.h" #include "core/tools/stringutils.h"
#include "modules/pipelinefactory.h"
#include <QScrollBar> #include <QScrollBar>
#include <QFileDialog> #include <QFileDialog>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
// ================================================================================================ // ================================================================================================
#include "pipelinefactory.h" #include "pipelinefactory.h"
#include "gen_pipelineregistration.h" #include "modules/gen_pipelineregistration.h"
#include <sstream> #include <sstream>
......
...@@ -26,12 +26,11 @@ ...@@ -26,12 +26,11 @@
#define PIPELINEFACTORY_H__ #define PIPELINEFACTORY_H__
#include "cgt/logmanager.h" #include "cgt/logmanager.h"
#include "cgt/singleton.h"
#include <tbb/atomic.h> #include <tbb/atomic.h>
#include <tbb/spin_mutex.h> #include <tbb/spin_mutex.h>
#include "modules/modulesapi.h" #include "core/coreapi.h"
#include <map> #include <map>
#include <string> #include <string>
...@@ -50,7 +49,7 @@ namespace campvis { ...@@ -50,7 +49,7 @@ namespace campvis {
* *
* \note PipelineFactory is a thread-safe lazy-instantiated singleton. * \note PipelineFactory is a thread-safe lazy-instantiated singleton.
*/ */
class CAMPVIS_MODULES_API PipelineFactory { class CAMPVIS_CORE_API PipelineFactory {
public: public:
/** /**
* Returns a reference to the PipelineFactory singleton. * Returns a reference to the PipelineFactory singleton.
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
// ================================================================================================ // ================================================================================================
#include "processorfactory.h" #include "processorfactory.h"
//#include "gen_processorregistration.h"
#include <sstream> #include <sstream>
......
...@@ -26,12 +26,11 @@ ...@@ -26,12 +26,11 @@
#define PROCESSORFACTORY_H__ #define PROCESSORFACTORY_H__
#include "cgt/logmanager.h" #include "cgt/logmanager.h"
#include "cgt/singleton.h"
#include <tbb/atomic.h> #include <tbb/atomic.h>
#include <tbb/spin_mutex.h> #include <tbb/spin_mutex.h>
#include "modules/modulesapi.h" #include "core/coreapi.h"
#include <functional> #include <functional>
#include <map> #include <map>
...@@ -54,7 +53,7 @@ namespace campvis { ...@@ -54,7 +53,7 @@ namespace campvis {
* *
* \note ProcessorFactory is a thread-safe lazy-instantiated singleton. * \note ProcessorFactory is a thread-safe lazy-instantiated singleton.
*/ */
class CAMPVIS_MODULES_API ProcessorFactory { class CAMPVIS_CORE_API ProcessorFactory {
public: public:
/** /**
* Returns a reference to the ProcessorFactory singleton. * Returns a reference to the ProcessorFactory singleton.
......
...@@ -8,14 +8,7 @@ WRITE_PIPELINE_REGISTRATION("gen_pipelineregistration.h") ...@@ -8,14 +8,7 @@ WRITE_PIPELINE_REGISTRATION("gen_pipelineregistration.h")
LIST(APPEND CampvisModulesHeaders LIST(APPEND CampvisModulesHeaders
modulesapi.h modulesapi.h
gen_pipelineregistration.h gen_pipelineregistration.h
pipelinefactory.h
processorfactory.h
) )
LIST(APPEND CampvisModulesSources
pipelinefactory.cpp
processorfactory.cpp
)
LINK_DIRECTORIES(${CampvisGlobalLinkDirectories} ${CampvisModulesLinkDirectories}) LINK_DIRECTORIES(${CampvisGlobalLinkDirectories} ${CampvisModulesLinkDirectories})
......
...@@ -7,6 +7,7 @@ IF(${ModuleEnabled}) ...@@ -7,6 +7,7 @@ IF(${ModuleEnabled})
modules/advancedusvis/pipelines/*.cpp modules/advancedusvis/pipelines/*.cpp
modules/advancedusvis/processors/*.cpp modules/advancedusvis/processors/*.cpp
modules/advancedusvis/properties/*.cpp modules/advancedusvis/properties/*.cpp
modules/advancedusvis/*.cpp
) )
# Header files (including GLSL files so that they'll appear in VS projects) # Header files (including GLSL files so that they'll appear in VS projects)
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
// //
// This file is part of the CAMPVis Software Framework. // This file is part of the CAMPVis Software Framework.
// //
// If not explicitly stated otherwise: Copyright (C) 2012-2014, all rights reserved, // If not explicitly stated otherwise: Copyright (C) 2012-2013, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de> // Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures // Chair for Computer Aided Medical Procedures
// Technische Universitaet Muenchen // Technische Universität München
// Boltzmannstr. 3, 85748 Garching b. Muenchen, Germany // Boltzmannstr. 3, 85748 Garching b. München, Germany
// //
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt". // For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
// //
...@@ -22,60 +22,38 @@ ...@@ -22,60 +22,38 @@
// //
// ================================================================================================ // ================================================================================================
#ifndef MANUALTISSUESEGMENTATION_H__ #include "core/pipeline/pipelinefactory.h"
#define MANUALTISSUESEGMENTATION_H__ #include "core/pipeline/processorfactory.h"
#include "modules/advancedusvis/pipelines/advancedusvis.h"
#include "modules/advancedusvis/pipelines/cmbatchgeneration.h"
#include "modules/advancedusvis/pipelines/predicatedemoachilles.h"
#include "modules/advancedusvis/pipelines/predicatedemocarotid.h"
#include "modules/advancedusvis/pipelines/predicatedemocarotid2.h"
#include "modules/advancedusvis/pipelines/predicatedemoshoulder.h"
#include "modules/advancedusvis/pipelines/predicatedemosmallheart.h"
#include "core/eventhandlers/mwheeltonumericpropertyeventlistener.h" #include "modules/advancedusvis/processors/advancedusfusion.h"
#include "core/pipeline/autoevaluationpipeline.h" #include "modules/advancedusvis/processors/pointpredicateevaluator.h"
#include "modules/advancedusvis/processors/pointpredicateraycaster.h"
#include "modules/modulesapi.h" #include "modules/advancedusvis/processors/predicatevolumeexplorer.h"
#include "modules/pipelinefactory.h" #include "modules/advancedusvis/processors/scanlinedistributioncomputation.h"
#include "modules/io/processors/mhdimagereader.h"
#include "modules/io/processors/mhdimagewriter.h"
#include "modules/manualsegmentation/processors/manualtissuesegmenter.h"
namespace campvis { namespace campvis {
/**
* VERY EXPERIMENTAL pipeline for manual segmentation of tissue layers.
*/
class CAMPVIS_MODULES_API ManualTissueSegmentation : public AutoEvaluationPipeline {
public:
/**
* Creates a VisualizationPipeline.
*/
ManualTissueSegmentation(DataContainer* dc);
/**
* Virtual Destructor
**/
virtual ~ManualTissueSegmentation();
/// \see VisualizationPipeline::init()
virtual void init();
/// \see VisualizationPipeline::deinit()
virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
static const std::string getId() { return "ManualTissueSegmentation"; };
protected:
void onRenderTargetSizeChanged(const AbstractProperty* prop);
MhdImageReader _reader;
ManualTissueSegmenter _mts;
MhdImageWriter _writer;
MWheelToNumericPropertyEventListener _wheelHandler;
};
// Instantiate template to register the pipelines.
template class PipelineRegistrar<ManualTissueSegmentation>;
}
#endif // MANUALTISSUESEGMENTATION_H__ // explicitly instantiate templates to register the pipelines
template class PipelineRegistrar<AdvancedUsVis>;
template class PipelineRegistrar<CmBatchGeneration>;
template class PipelineRegistrar<PredicateDemoAchilles>;
template class PipelineRegistrar<PredicateDemoCarotid>;
template class PipelineRegistrar<PredicateDemoCarotid2>;
template class PipelineRegistrar<PredicateDemoShoulder>;
template class PipelineRegistrar<PredicateDemoSmallHeart>;
template class SmartProcessorRegistrar<AdvancedUsFusion>;
template class SmartProcessorRegistrar<PointPredicateEvaluator>;
template class SmartProcessorRegistrar<PointPredicateRaycaster>;
template class SmartProcessorRegistrar<PredicateVolumeExplorer>;
template class SmartProcessorRegistrar<ScanlineDistributionComputation>;
}
\ No newline at end of file
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "core/pipeline/autoevaluationpipeline.h" #include "core/pipeline/autoevaluationpipeline.h"
#include "modules/modulesapi.h" #include "modules/modulesapi.h"
#include "modules/pipelinefactory.h"
#include "modules/io/processors/genericimagereader.h" #include "modules/io/processors/genericimagereader.h"
#include "modules/advancedusvis/processors/advancedusfusion.h" #include "modules/advancedusvis/processors/advancedusfusion.h"
...@@ -73,10 +72,6 @@ namespace campvis { ...@@ -73,10 +72,6 @@ namespace campvis {
QuadView _quadView; QuadView _quadView;
}; };
// Instantiate template to register the pipelines.
template class PipelineRegistrar<AdvancedUsVis>;
} }
#endif // ADVANCEDUSVIS_H__ #endif // ADVANCEDUSVIS_H__
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
#include "core/properties/allproperties.h" #include "core/properties/allproperties.h"
#include "modules/modulesapi.h" #include "modules/modulesapi.h"
#include "modules/pipelinefactory.h"
#include "modules/devil/processors/devilimagereader.h" #include "modules/devil/processors/devilimagereader.h"
#include "modules/advancedusvis/processors/advancedusfusion.h" #include "modules/advancedusvis/processors/advancedusfusion.h"
#include "modules/preprocessing/processors/glgaussianfilter.h" #include "modules/preprocessing/processors/glgaussianfilter.h"
...@@ -92,10 +90,6 @@ namespace campvis { ...@@ -92,10 +90,6 @@ namespace campvis {
ButtonProperty p_execute; ButtonProperty p_execute;
}; };
// Instantiate template to register the pipelines.
template class PipelineRegistrar<CmBatchGeneration>;
} }
#endif // CMBATCHGENERATION_H__ #endif // CMBATCHGENERATION_H__
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
#include "core/pipeline/autoevaluationpipeline.h" #include "core/pipeline/autoevaluationpipeline.h"
#include "modules/modulesapi.h" #include "modules/modulesapi.h"
#include "modules/pipelinefactory.h"
#include "modules/base/processors/lightsourceprovider.h" #include "modules/base/processors/lightsourceprovider.h"
#include "modules/io/processors/mhdimagereader.h" #include "modules/io/processors/mhdimagereader.h"
#include "modules/advancedusvis/processors/pointpredicateevaluator.h" #include "modules/advancedusvis/processors/pointpredicateevaluator.h"
...@@ -92,10 +90,6 @@ namespace campvis { ...@@ -92,10 +90,6 @@ namespace campvis {
PredicateVolumeExplorer _ve; PredicateVolumeExplorer _ve;
}; };
// Instantiate template to register the pipelines.
template class PipelineRegistrar<PredicateDemoAchilles>;
} }
#endif // PredicateDemoAchilles_H__ #endif // PredicateDemoAchilles_H__
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
#include "core/pipeline/autoevaluationpipeline.h" #include "core/pipeline/autoevaluationpipeline.h"
#include "modules/modulesapi.h" #include "modules/modulesapi.h"
#include "modules/pipelinefactory.h"
#include "modules/base/processors/lightsourceprovider.h" #include "modules/base/processors/lightsourceprovider.h"
#include "modules/io/processors/mhdimagereader.h" #include "modules/io/processors/mhdimagereader.h"
#include "modules/advancedusvis/processors/pointpredicateevaluator.h" #include "modules/advancedusvis/processors/pointpredicateevaluator.h"
...@@ -94,10 +92,6 @@ namespace campvis { ...@@ -94,10 +92,6 @@ namespace campvis {
PredicateVolumeExplorer _ve; PredicateVolumeExplorer _ve;
}; };
// Instantiate template to register the pipelines.
template class PipelineRegistrar<PredicateDemoCarotid>;
} }
#endif // PREDICATEDEMOCAROTID_H__ #endif // PREDICATEDEMOCAROTID_H__
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
#include "core/pipeline/autoevaluationpipeline.h" #include "core/pipeline/autoevaluationpipeline.h"
#include "modules/modulesapi.h" #include "modules/modulesapi.h"
#include "modules/pipelinefactory.h"
#include "modules/base/processors/lightsourceprovider.h" #include "modules/base/processors/lightsourceprovider.h"
#include "modules/io/processors/mhdimagereader.h" #include "modules/io/processors/mhdimagereader.h"
#include "modules/advancedusvis/processors/pointpredicateevaluator.h" #include "modules/advancedusvis/processors/pointpredicateevaluator.h"
...@@ -94,10 +92,6 @@ namespace campvis { ...@@ -94,10 +92,6 @@ namespace campvis {
PredicateVolumeExplorer _ve; PredicateVolumeExplorer _ve;
}; };
// Instantiate template to register the pipelines.
template class PipelineRegistrar<PredicateDemoCarotid2>;
} }
#endif // PredicateDemoCarotid22_H__ #endif // PredicateDemoCarotid22_H__
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
#include "core/pipeline/autoevaluationpipeline.h" #include "core/pipeline/autoevaluationpipeline.h"
#include "modules/modulesapi.h" #include "modules/modulesapi.h"
#include "modules/pipelinefactory.h"
#include "modules/base/processors/lightsourceprovider.h" #include "modules/base/processors/lightsourceprovider.h"
#include "modules/io/processors/mhdimagereader.h" #include "modules/io/processors/mhdimagereader.h"
#include "modules/advancedusvis/processors/pointpredicateevaluator.h" #include "modules/advancedusvis/processors/pointpredicateevaluator.h"
...@@ -92,10 +90,6 @@ namespace campvis { ...@@ -92,10 +90,6 @@ namespace campvis {
PredicateVolumeExplorer _ve; PredicateVolumeExplorer _ve;
}; };
// Instantiate template to register the pipelines.
template class PipelineRegistrar<PredicateDemoShoulder>;
} }
#endif // PREDICATEDEMOSHOULDER_H__ #endif // PREDICATEDEMOSHOULDER_H__
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
#include "core/pipeline/autoevaluationpipeline.h" #include "core/pipeline/autoevaluationpipeline.h"
#include "modules/modulesapi.h" #include "modules/modulesapi.h"
#include "modules/pipelinefactory.h"
#include "modules/base/processors/lightsourceprovider.h" #include "modules/base/processors/lightsourceprovider.h"
#include "modules/io/processors/mhdimagereader.h" #include "modules/io/processors/mhdimagereader.h"
#include "modules/advancedusvis/processors/pointpredicateevaluator.h" #include "modules/advancedusvis/processors/pointpredicateevaluator.h"
...@@ -93,9 +91,6 @@ namespace campvis { ...@@ -93,9 +91,6 @@ namespace campvis {
PredicateVolumeExplorer _ve; PredicateVolumeExplorer _ve;
}; };
// Instantiate template to register the pipelines.
template class PipelineRegistrar<PredicateDemoSmallHeart>;
} }
#endif // PREDICATEDEMOSMALLHEART_H__ #endif // PREDICATEDEMOSMALLHEART_H__
...@@ -66,8 +66,10 @@ namespace campvis { ...@@ -66,8 +66,10 @@ namespace campvis {
/// \see AbstractProcessor::deinit /// \see AbstractProcessor::deinit
virtual void deinit(); virtual void deinit();
/// To be used in ProcessorFactory static methods
static const std::string getId() { return "AdvancedUsFusion"; };
/// \see AbstractProcessor::getName() /// \see AbstractProcessor::getName()
virtual const std::string getName() const { return "AdvancedUsFusion"; }; virtual const std::string getName() const { return getId(); };
/// \see AbstractProcessor::getDescription() /// \see AbstractProcessor::getDescription()
virtual const std::string getDescription() const { return "Extracts a single slice from the input image and renders it using a transfer function."; }; virtual const std::string getDescription() const { return "Extracts a single slice from the input image and renders it using a transfer function."; };
/// \see AbstractProcessor::getAuthor() /// \see AbstractProcessor::getAuthor()
......
...@@ -61,8 +61,10 @@ namespace campvis { ...@@ -61,8 +61,10 @@ namespace campvis {
/// \see AbstractProcessor::deinit /// \see AbstractProcessor::deinit
virtual void deinit(); virtual void deinit();
/// To be used in ProcessorFactory static methods
static const std::string getId() { return "PointPredicateEvaluator"; };
/// \see AbstractProcessor::getName() /// \see AbstractProcessor::getName()
virtual const std::string getName() const { return "PointPredicateEvaluator"; }; virtual const std::string getName() const { return getId(); };
/// \see AbstractProcessor::getDescription() /// \see AbstractProcessor::getDescription()
virtual const std::string getDescription() const { return "Evaluates the Point Predicate Histogram and stores the results in a bitmask image."; }; virtual const std::string getDescription() const { return "Evaluates the Point Predicate Histogram and stores the results in a bitmask image."; };
/// \see AbstractProcessor::getAuthor() /// \see AbstractProcessor::getAuthor()
......
...@@ -54,8 +54,10 @@ namespace campvis { ...@@ -54,8 +54,10 @@ namespace campvis {
**/ **/
virtual ~PointPredicateRaycaster(); virtual ~PointPredicateRaycaster();
/// To be used in ProcessorFactory static methods
static const std::string getId() { return "PointPredicateRaycaster"; };
/// \see AbstractProcessor::getName() /// \see AbstractProcessor::getName()
virtual const std::string getName() const { return "PointPredicateRaycaster"; }; virtual const std::string getName() const { return getId(); };
/// \see AbstractProcessor::getDescription() /// \see AbstractProcessor::getDescription()
virtual const std::string getDescription() const { return "Performs a predicate-based volume ray casting"; }; virtual const std::string getDescription() const { return "Performs a predicate-based volume ray casting"; };
/// \see AbstractProcessor::getAuthor() /// \see AbstractProcessor::getAuthor()
......
...@@ -58,8 +58,10 @@ namespace campvis { ...@@ -58,8 +58,10 @@ namespace campvis {
/// \see AbstractProcessor::deinit /// \see AbstractProcessor::deinit
virtual void deinit(); virtual void deinit();
/// To be used in ProcessorFactory static methods
static const std::string getId() { return "PredicateVolumeExplorer"; };
/// \see AbstractProcessor::getName() /// \see AbstractProcessor::getName()
virtual const std::string getName() const { return "PredicateVolumeExplorer"; }; virtual const std::string getName() const { return getId(); };
/// \see AbstractProcessor::getDescription() /// \see AbstractProcessor::getDescription()
virtual const std::string getDescription() const { return "Combines a volume raycaster and 3 slice views for explorative volume visualization."; }; virtual const std::string getDescription() const { return "Combines a volume raycaster and 3 slice views for explorative volume visualization."; };
/// \see AbstractProcessor::getAuthor() /// \see AbstractProcessor::getAuthor()
......
...@@ -66,8 +66,10 @@ namespace campvis { ...@@ -66,8 +66,10 @@ namespace campvis {
/// \see AbstractProcessor::deinit /// \see AbstractProcessor::deinit
virtual void deinit(); virtual void deinit();
/// To be used in ProcessorFactory static methods
static const std::string getId() { return "ScanlineDistributionComputation"; };
/// \see AbstractProcessor::getName()