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

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 @@
#include "core/tools/quadrenderer.h"
#include "core/pipeline/abstractpipeline.h"
#include "core/pipeline/abstractworkflow.h"
#include "core/pipeline/pipelinefactory.h"
#include "core/pipeline/pipelinepainter.h"
#include "core/datastructures/imagerepresentationconverter.h"
#include "core/pipeline/visualizationprocessor.h"
#include "modules/pipelinefactory.h"
#include "qtjobprocessor.h"
#include <QApplication>
......
......@@ -35,8 +35,9 @@
#include "core/datastructures/datacontainer.h"
#include "core/pipeline/abstractpipeline.h"
#include "core/pipeline/abstractprocessor.h"
#include "core/pipeline/pipelinefactory.h"
#include "core/pipeline/processorfactory.h"
#include "core/tools/stringutils.h"
#include "modules/pipelinefactory.h"
#include <QScrollBar>
#include <QFileDialog>
......
......@@ -23,7 +23,7 @@
// ================================================================================================
#include "pipelinefactory.h"
#include "gen_pipelineregistration.h"
#include "modules/gen_pipelineregistration.h"
#include <sstream>
......
......@@ -26,12 +26,11 @@
#define PIPELINEFACTORY_H__
#include "cgt/logmanager.h"
#include "cgt/singleton.h"
#include <tbb/atomic.h>
#include <tbb/spin_mutex.h>
#include "modules/modulesapi.h"
#include "core/coreapi.h"
#include <map>
#include <string>
......@@ -50,7 +49,7 @@ namespace campvis {
*
* \note PipelineFactory is a thread-safe lazy-instantiated singleton.
*/
class CAMPVIS_MODULES_API PipelineFactory {
class CAMPVIS_CORE_API PipelineFactory {
public:
/**
* Returns a reference to the PipelineFactory singleton.
......
......@@ -23,7 +23,6 @@
// ================================================================================================
#include "processorfactory.h"
//#include "gen_processorregistration.h"
#include <sstream>
......
......@@ -26,12 +26,11 @@
#define PROCESSORFACTORY_H__
#include "cgt/logmanager.h"
#include "cgt/singleton.h"
#include <tbb/atomic.h>
#include <tbb/spin_mutex.h>
#include "modules/modulesapi.h"
#include "core/coreapi.h"
#include <functional>
#include <map>
......@@ -54,7 +53,7 @@ namespace campvis {
*
* \note ProcessorFactory is a thread-safe lazy-instantiated singleton.
*/
class CAMPVIS_MODULES_API ProcessorFactory {
class CAMPVIS_CORE_API ProcessorFactory {
public:
/**
* Returns a reference to the ProcessorFactory singleton.
......
......@@ -8,14 +8,7 @@ WRITE_PIPELINE_REGISTRATION("gen_pipelineregistration.h")
LIST(APPEND CampvisModulesHeaders
modulesapi.h
gen_pipelineregistration.h
pipelinefactory.h
processorfactory.h
)
LIST(APPEND CampvisModulesSources
pipelinefactory.cpp
processorfactory.cpp
)
LINK_DIRECTORIES(${CampvisGlobalLinkDirectories} ${CampvisModulesLinkDirectories})
......
......@@ -7,6 +7,7 @@ IF(${ModuleEnabled})
modules/advancedusvis/pipelines/*.cpp
modules/advancedusvis/processors/*.cpp
modules/advancedusvis/properties/*.cpp
modules/advancedusvis/*.cpp
)
# Header files (including GLSL files so that they'll appear in VS projects)
......
......@@ -2,11 +2,11 @@
//
// 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>
// Chair for Computer Aided Medical Procedures
// Technische Universitaet Muenchen
// Boltzmannstr. 3, 85748 Garching b. Muenchen, Germany
// Technische Universität München
// Boltzmannstr. 3, 85748 Garching b. München, Germany
//
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
//
......@@ -22,60 +22,38 @@
//
// ================================================================================================
#ifndef MANUALTISSUESEGMENTATION_H__
#define MANUALTISSUESEGMENTATION_H__
#include "core/pipeline/pipelinefactory.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 "core/pipeline/autoevaluationpipeline.h"
#include "modules/modulesapi.h"
#include "modules/pipelinefactory.h"
#include "modules/io/processors/mhdimagereader.h"
#include "modules/io/processors/mhdimagewriter.h"
#include "modules/manualsegmentation/processors/manualtissuesegmenter.h"
#include "modules/advancedusvis/processors/advancedusfusion.h"
#include "modules/advancedusvis/processors/pointpredicateevaluator.h"
#include "modules/advancedusvis/processors/pointpredicateraycaster.h"
#include "modules/advancedusvis/processors/predicatevolumeexplorer.h"
#include "modules/advancedusvis/processors/scanlinedistributioncomputation.h"
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 @@
#include "core/pipeline/autoevaluationpipeline.h"
#include "modules/modulesapi.h"
#include "modules/pipelinefactory.h"
#include "modules/io/processors/genericimagereader.h"
#include "modules/advancedusvis/processors/advancedusfusion.h"
......@@ -73,10 +72,6 @@ namespace campvis {
QuadView _quadView;
};
// Instantiate template to register the pipelines.
template class PipelineRegistrar<AdvancedUsVis>;
}
#endif // ADVANCEDUSVIS_H__
......@@ -30,8 +30,6 @@
#include "core/properties/allproperties.h"
#include "modules/modulesapi.h"
#include "modules/pipelinefactory.h"
#include "modules/devil/processors/devilimagereader.h"
#include "modules/advancedusvis/processors/advancedusfusion.h"
#include "modules/preprocessing/processors/glgaussianfilter.h"
......@@ -92,10 +90,6 @@ namespace campvis {
ButtonProperty p_execute;
};
// Instantiate template to register the pipelines.
template class PipelineRegistrar<CmBatchGeneration>;
}
#endif // CMBATCHGENERATION_H__
......@@ -28,8 +28,6 @@
#include "core/pipeline/autoevaluationpipeline.h"
#include "modules/modulesapi.h"
#include "modules/pipelinefactory.h"
#include "modules/base/processors/lightsourceprovider.h"
#include "modules/io/processors/mhdimagereader.h"
#include "modules/advancedusvis/processors/pointpredicateevaluator.h"
......@@ -92,10 +90,6 @@ namespace campvis {
PredicateVolumeExplorer _ve;
};
// Instantiate template to register the pipelines.
template class PipelineRegistrar<PredicateDemoAchilles>;
}
#endif // PredicateDemoAchilles_H__
......@@ -29,8 +29,6 @@
#include "core/pipeline/autoevaluationpipeline.h"
#include "modules/modulesapi.h"
#include "modules/pipelinefactory.h"
#include "modules/base/processors/lightsourceprovider.h"
#include "modules/io/processors/mhdimagereader.h"
#include "modules/advancedusvis/processors/pointpredicateevaluator.h"
......@@ -94,10 +92,6 @@ namespace campvis {
PredicateVolumeExplorer _ve;
};
// Instantiate template to register the pipelines.
template class PipelineRegistrar<PredicateDemoCarotid>;
}
#endif // PREDICATEDEMOCAROTID_H__
......@@ -29,8 +29,6 @@
#include "core/pipeline/autoevaluationpipeline.h"
#include "modules/modulesapi.h"
#include "modules/pipelinefactory.h"
#include "modules/base/processors/lightsourceprovider.h"
#include "modules/io/processors/mhdimagereader.h"
#include "modules/advancedusvis/processors/pointpredicateevaluator.h"
......@@ -94,10 +92,6 @@ namespace campvis {
PredicateVolumeExplorer _ve;
};
// Instantiate template to register the pipelines.
template class PipelineRegistrar<PredicateDemoCarotid2>;
}
#endif // PredicateDemoCarotid22_H__
......@@ -28,8 +28,6 @@
#include "core/pipeline/autoevaluationpipeline.h"
#include "modules/modulesapi.h"
#include "modules/pipelinefactory.h"
#include "modules/base/processors/lightsourceprovider.h"
#include "modules/io/processors/mhdimagereader.h"
#include "modules/advancedusvis/processors/pointpredicateevaluator.h"
......@@ -92,10 +90,6 @@ namespace campvis {
PredicateVolumeExplorer _ve;
};
// Instantiate template to register the pipelines.
template class PipelineRegistrar<PredicateDemoShoulder>;
}
#endif // PREDICATEDEMOSHOULDER_H__
......@@ -28,8 +28,6 @@
#include "core/pipeline/autoevaluationpipeline.h"
#include "modules/modulesapi.h"
#include "modules/pipelinefactory.h"
#include "modules/base/processors/lightsourceprovider.h"
#include "modules/io/processors/mhdimagereader.h"
#include "modules/advancedusvis/processors/pointpredicateevaluator.h"
......@@ -93,9 +91,6 @@ namespace campvis {
PredicateVolumeExplorer _ve;
};
// Instantiate template to register the pipelines.
template class PipelineRegistrar<PredicateDemoSmallHeart>;
}
#endif // PREDICATEDEMOSMALLHEART_H__
......@@ -66,8 +66,10 @@ namespace campvis {
/// \see AbstractProcessor::deinit
virtual void deinit();
/// To be used in ProcessorFactory static methods
static const std::string getId() { return "AdvancedUsFusion"; };
/// \see AbstractProcessor::getName()
virtual const std::string getName() const { return "AdvancedUsFusion"; };
virtual const std::string getName() const { return getId(); };
/// \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."; };
/// \see AbstractProcessor::getAuthor()
......
......@@ -61,8 +61,10 @@ namespace campvis {
/// \see AbstractProcessor::deinit
virtual void deinit();
/// To be used in ProcessorFactory static methods
static const std::string getId() { return "PointPredicateEvaluator"; };
/// \see AbstractProcessor::getName()
virtual const std::string getName() const { return "PointPredicateEvaluator"; };
virtual const std::string getName() const { return getId(); };
/// \see AbstractProcessor::getDescription()
virtual const std::string getDescription() const { return "Evaluates the Point Predicate Histogram and stores the results in a bitmask image."; };
/// \see AbstractProcessor::getAuthor()
......
......@@ -54,8 +54,10 @@ namespace campvis {
**/
virtual ~PointPredicateRaycaster();
/// To be used in ProcessorFactory static methods
static const std::string getId() { return "PointPredicateRaycaster"; };
/// \see AbstractProcessor::getName()
virtual const std::string getName() const { return "PointPredicateRaycaster"; };
virtual const std::string getName() const { return getId(); };
/// \see AbstractProcessor::getDescription()
virtual const std::string getDescription() const { return "Performs a predicate-based volume ray casting"; };
/// \see AbstractProcessor::getAuthor()
......
......@@ -58,8 +58,10 @@ namespace campvis {
/// \see AbstractProcessor::deinit
virtual void deinit();
/// To be used in ProcessorFactory static methods
static const std::string getId() { return "PredicateVolumeExplorer"; };
/// \see AbstractProcessor::getName()
virtual const std::string getName() const { return "PredicateVolumeExplorer"; };
virtual const std::string getName() const { return getId(); };
/// \see AbstractProcessor::getDescription()
virtual const std::string getDescription() const { return "Combines a volume raycaster and 3 slice views for explorative volume visualization."; };
/// \see AbstractProcessor::getAuthor()
......
......@@ -66,8 +66,10 @@ namespace campvis {
/// \see AbstractProcessor::deinit
virtual void deinit();
/// To be used in ProcessorFactory static methods
static const std::string getId() { return "ScanlineDistributionComputation"; };
/// \see AbstractProcessor::getName()
virtual const std::string getName() const { return "ScanlineDistributionComputation"; };
virtual const std::string getName() const { return getId(); };
/// \see AbstractProcessor::getDescription()
virtual const std::string getDescription() const { return "Computes the intensity distribution profile for each voxel along the scanline."; };
/// \see AbstractProcessor::getAuthor()
......
......@@ -32,7 +32,7 @@
#include "core/properties/floatingpointproperty.h"
#include "modules/modulesapi.h"
#include "modules/processorfactory.h"
#include "core/pipeline/processorfactory.h"
namespace campvis {
/**
......
......@@ -22,6 +22,7 @@ IF(${ModuleEnabled})
FILE(GLOB ThisModSources RELATIVE ${ModulesDir}
modules/campcom/pipelines/*.cpp
modules/campcom/processors/*.cpp
modules/campcom/*.cpp
)
# Header files (including GLSL files so that they'll appear in VS projects)
......
......@@ -2,11 +2,11 @@
//
// 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>
// Chair for Computer Aided Medical Procedures
// Technische Universitaet Muenchen
// Boltzmannstr. 3, 85748 Garching b. Muenchen, Germany
// Technische Universität München
// Boltzmannstr. 3, 85748 Garching b. München, Germany
//
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
//
......@@ -22,21 +22,17 @@
//
// ================================================================================================
in vec3 ex_TexCoord;
out vec4 out_Color;
#include "core/pipeline/pipelinefactory.h"
#include "core/pipeline/processorfactory.h"
#include "tools/texture3d.frag"
#include "tools/transferfunction.frag"
#include "modules/campcom/processors/campcommhdreceiver.h"
#include "modules/campcom/pipelines/streamingmhddemo.h"
uniform sampler3D _texture;
uniform TextureParameters3D _textureParams;
namespace campvis {
uniform sampler1D _transferFunction;
uniform TFParameters1D _transferFunctionParams;
// explicitly instantiate templates to register the pipelines
template class PipelineRegistrar<StreamingMhdDemo>;
uniform float _zTexCoord;
template class SmartProcessorRegistrar<CampcomMhdReceiver>;
void main() {
float intensity = texture(_texture, vec3(ex_TexCoord.xy, _zTexCoord)).r;
out_Color = lookupTF(_transferFunction, _transferFunctionParams, intensity);
}
}
\ No newline at end of file
......@@ -64,8 +64,10 @@ namespace campvis {
/// \see AbstractProcessor::deinit()
virtual void deinit();
/// To be used in ProcessorFactory static methods
static const std::string getId() { return "CampcomMhdReceiver"; };
/// \see AbstractProcessor::getName()
virtual const std::string getName() const { return "CampcomMhdReceiver"; };
virtual const std::string getName() const { return getId(); };
/// \see AbstractProcessor::getDescription()
virtual const std::string getDescription() const { return "Experimental demo implementation how to receive MHD files via CAMPCom."; };
/// \see AbstractProcessor::getAuthor()
......
# CMake file for columbia module
IF(${ModuleEnabled})
# Source files:
FILE(GLOB ThisModSources RELATIVE ${ModulesDir}
modules/columbia/datastructures/*.cpp
modules/columbia/pipelines/*.cpp
modules/columbia/processors/*.cpp
)
# Header files (including GLSL files so that they'll appear in VS projects)
FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
modules/columbia/datastructures/*.h
modules/columbia/glsl/*.frag
modules/columbia/glsl/*.geom
modules/columbia/glsl/*.vert
modules/columbia/pipelines/*.h
modules/columbia/processors/*.h
)
LIST(APPEND ThisModShaderDirectories "modules/columbia/glsl")
ENDIF(${ModuleEnabled})
SET(ThisModStatus EXPERIMENTAL)
SET(ThisModExternalDependencies FALSE)
// ================================================================================================
//
// This file is part of the CAMPVis Software Framework.
//
// If not explicitly stated otherwise: Copyright (C) 2012-2014, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures
// Technische Universitaet Muenchen
// Boltzmannstr. 3, 85748 Garching b. Muenchen, Germany
//
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
//
// ================================================================================================
#include "fiberdata.h"
#include "cgt/buffer.h"
#include "cgt/logmanager.h"
#include "cgt/vertexarrayobject.h"
namespace campvis {
FiberData::FiberData()
: AbstractData()
, _vertexBuffer(0)
, _tangentBuffer(0)
, _buffersInitialized(false)
, _vboFiberStartIndices(0)
, _vboFiberCounts(0)
{
}
FiberData::FiberData(const FiberData& rhs)
: AbstractData(rhs)
, _vertices(rhs._vertices)
, _fibers(rhs._fibers)
, _vertexBuffer(0)
, _tangentBuffer(0)
, _buffersInitialized(false)
, _vboFiberStartIndices(0)
, _vboFiberCounts(0)
{}