Commit 293d43dd authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Moved invalidation level from AbstractProperty to AbstractProcessor:

To now, each property hat an _invalidationLevel field that was evaluated by processors when the property had changed in order to determine what has to be done. However, since properties could also be owned by other classes, this design was semantically misleading.
Therefore, it was removed with this commit and replaced by the invalidation map of each processor. Now, this per-processor mapping of property -> invalidation level is managed by the processor itself. Furthermore, the invalidation level is no longer setup during property creation but during AbstractProcessor::addProperty(), which also makes much more sense.

ATTENTION: Due to these intrusive API changes, the code of all processors and other classes handling properties needs to be changed. As a reminder, the implementation of addProperty() also now takes a reference instead of a pointer, so that old code does no longer compile.

refs #542
parent 94a730da
......@@ -46,10 +46,10 @@ namespace campvis {
{
this->_ext.push_back(".mhd");
this->p_targetImageID.setValue("MhdImageReader.output");
addProperty(&p_url);
addProperty(&p_targetImageID);
addProperty(&p_imageOffset);
addProperty(&p_voxelSize);
addProperty(p_url);
addProperty(p_targetImageID);
addProperty(p_imageOffset);
addProperty(p_voxelSize);
}
MhdImageReader::~MhdImageReader() {
......
......@@ -42,13 +42,13 @@ namespace campvis {
MhdImageWriter::MhdImageWriter()
: AbstractProcessor()
, p_inputImage("InputImage", "Input Image", "image", DataNameProperty::READ, VALID)
, p_fileName("FileName", "File Name", "", VALID)
, p_inputImage("InputImage", "Input Image", "image", DataNameProperty::READ)
, p_fileName("FileName", "File Name", "")
, p_saveFile("SaveFile", "Save to File")
{
addProperty(&p_inputImage);
addProperty(&p_fileName);
addProperty(&p_saveFile);
addProperty(p_inputImage, VALID);
addProperty(p_fileName, VALID);
addProperty(p_saveFile);
}
MhdImageWriter::~MhdImageWriter() {
......
......@@ -61,15 +61,15 @@ namespace campvis {
this->_ext.push_back(".raw");
this->p_targetImageID.setValue("RawImageReader.output");
addProperty(&p_url);
addProperty(&p_size);
addProperty(&p_numChannels);
addProperty(&p_baseType);
addProperty(&p_offset);
addProperty(&p_endianness);
addProperty(&p_targetImageID);
addProperty(&p_imageOffset);
addProperty(&p_voxelSize);
addProperty(p_url);
addProperty(p_size);
addProperty(p_numChannels);
addProperty(p_baseType);
addProperty(p_offset);
addProperty(p_endianness);
addProperty(p_targetImageID);
addProperty(p_imageOffset);
addProperty(p_voxelSize);
}
RawImageReader::~RawImageReader() {
......
......@@ -51,10 +51,10 @@ namespace campvis {
this->_ext.push_back(".vtk");
this->p_targetImageID.setValue("VtkImageReader.output");
addProperty(&p_url);
addProperty(&p_targetImageID);
addProperty(&p_imageOffset);
addProperty(&p_voxelSize);
addProperty(p_url);
addProperty(p_targetImageID);
addProperty(p_imageOffset);
addProperty(p_voxelSize);
}
VtkImageReader::~VtkImageReader() {
......
......@@ -260,7 +260,7 @@ namespace campvis {
: AbstractProcessor()
, p_sourceImageID("InputVolume", "Input Volume ID", "volume", DataNameProperty::READ)
, p_targetImageID("OutputGradients", "Output Gradient Volume ID", "gradients", DataNameProperty::WRITE)
, p_filterMode("FilterMode", "Filter Mode", filterModes, 7, AbstractProcessor::INVALID_RESULT | AbstractProcessor::INVALID_PROPERTIES)
, p_filterMode("FilterMode", "Filter Mode", filterModes, 7)
, p_kernelSize("KernelSize", "Kernel Size", 3, 3, 15)
, p_sigma("Sigma", "Sigma", 1.f, .1f, 10.f, 0.1f)
, p_numberOfSteps("NumberOfSteps", "Number of Steps", 5, 1, 15)
......@@ -269,16 +269,16 @@ namespace campvis {
, p_thresMin("ThresholdMin", "Threshold Minimum", 0.1f, 0.0f, 1.0f, 0.05f)
, p_thresMax("ThresholdMax", "Threshold Maximum", 0.9f, 0.0f, 1.0f, 0.05f)
{
addProperty(&p_sourceImageID);
addProperty(&p_targetImageID);
addProperty(&p_filterMode);
addProperty(&p_kernelSize);
addProperty(&p_sigma);
addProperty(&p_numberOfSteps);
addProperty(&p_timeStep);
addProperty(&p_conductance);
addProperty(&p_thresMin);
addProperty(&p_thresMax);
addProperty(p_sourceImageID);
addProperty(p_targetImageID);
addProperty(p_filterMode, INVALID_RESULT | INVALID_PROPERTIES);
addProperty(p_kernelSize);
addProperty(p_sigma);
addProperty(p_numberOfSteps);
addProperty(p_timeStep);
addProperty(p_conductance);
addProperty(p_thresMin);
addProperty(p_thresMax);
}
ItkImageFilter::~ItkImageFilter() {
......
......@@ -140,10 +140,10 @@ namespace campvis {
, p_threshold("Threshold", "Threshold", .005f, .001f, 1.f, .01f)
, p_level("Level", "Level", .5f, .1f, 10.f, 1.f)
{
addProperty(&p_sourceImageID);
addProperty(&p_targetImageID);
addProperty(&p_threshold);
addProperty(&p_level);
addProperty(p_sourceImageID);
addProperty(p_targetImageID);
addProperty(p_threshold);
addProperty(p_level);
}
ItkWatershedFilter::~ItkWatershedFilter() {
......
......@@ -68,7 +68,7 @@ namespace campvis {
addProcessor(&_compositor2);
addProcessor(&_ixpvCompositor);
addProperty(&_camera);
addProperty(_camera);
_trackballHandler = new TrackballNavigationEventListener(&_camera, &_canvasSize);
_trackballHandler->addLqModeProcessor(&_ctDVR);
......
......@@ -47,11 +47,11 @@ namespace campvis {
, p_targetImageId("TargetImageId", "Output Image", "", DataNameProperty::WRITE)
, _shader(0)
{
addProperty(&p_xRayImageId);
addProperty(&p_3dSliceImageId);
addProperty(&p_drrFullImageId);
addProperty(&p_drrClippedImageId);
addProperty(&p_targetImageId);
addProperty(p_xRayImageId);
addProperty(p_3dSliceImageId);
addProperty(p_drrFullImageId);
addProperty(p_drrClippedImageId);
addProperty(p_targetImageId);
addDecorator(new ProcessorDecoratorBackground());
decoratePropertyCollection(this);
......
......@@ -63,7 +63,7 @@ namespace campvis {
ManualTissueSegmenter::ManualTissueSegmenter(IVec2Property* viewportSizeProp)
: VisualizationProcessor(viewportSizeProp)
, p_sourceImageID("sourceFioID", "Input Tracked US File IO", "", DataNameProperty::READ, AbstractProcessor::INVALID_RESULT | AbstractProcessor::INVALID_PROPERTIES)
, p_sourceImageID("sourceFioID", "Input Tracked US File IO", "", DataNameProperty::READ)
, p_targetImageID("targetImageID", "Output Image", "", DataNameProperty::WRITE)
, p_frameNumber("sliceNumber", "Slice Number", 0, 0, 0)
, p_transferFunction("transferFunction", "Transfer Function", new SimpleTransferFunction(256))
......@@ -71,16 +71,16 @@ namespace campvis {
, p_splineOrder("SplineOrder", "Spline Order", 3, 1, 9)
, p_NumControlPoints("NumControlPoints", "Number of Control Points", 4, 1, 10)
, p_NumLevels("NumLevels", "Number of Levels", 10, 1, 15)
, p_computeSamples("ComputeSamples", "Compute Samples", AbstractProcessor::VALID)
, p_computeSamples("ComputeSamples", "Compute Samples")
, p_showSamples("ShowSamples", "Show Samples", false)
, p_sampleFile("SampleFile", "Sample File", "", AbstractProcessor::VALID)
, p_saveSamples("SaveSamples", "Save Samples", AbstractProcessor::VALID)
, p_controlpointFile("ControlpointFile", "Control Point File", "C:\\temp\\us_small.cps", AbstractProcessor::VALID)
, p_saveCPs("SaveCPs", "Save Control Points", AbstractProcessor::VALID)
, p_loadCPs("LoadCPs", "Load Control Points", AbstractProcessor::VALID)
, p_sampleFile("SampleFile", "Sample File", "")
, p_saveSamples("SaveSamples", "Save Samples")
, p_controlpointFile("ControlpointFile", "Control Point File", "C:\\temp\\us_small.cps")
, p_saveCPs("SaveCPs", "Save Control Points")
, p_loadCPs("LoadCPs", "Load Control Points")
, p_activeLayer("ActiveLayer", "Active Layer", 0, 0, 0)
, p_addLayer("AddLayer", "Add Layer", AbstractProcessor::VALID)
, p_exportToLabelImage("ExportToLabelImage", "Export to Label Image", INVALID_RESULT | FIRST_FREE_TO_USE_INVALIDATION_LEVEL)
, p_addLayer("AddLayer", "Add Layer")
, p_exportToLabelImage("ExportToLabelImage", "Export to Label Image")
, _shader(0)
, _currentImage(0)
, _mousePressed(false)
......@@ -88,29 +88,29 @@ namespace campvis {
, _currentControlPoint(0)
, _currentBounds(0)
{
addProperty(&p_sourceImageID);
addProperty(&p_targetImageID);
addProperty(&p_frameNumber);
addProperty(&p_transferFunction);
addProperty(p_sourceImageID, INVALID_RESULT | INVALID_PROPERTIES);
addProperty(p_targetImageID);
addProperty(p_frameNumber);
addProperty(p_transferFunction);
addProperty(&p_fullWidth);
addProperty(&p_splineOrder);
addProperty(&p_NumControlPoints);
addProperty(&p_NumLevels);
addProperty(p_fullWidth);
addProperty(p_splineOrder);
addProperty(p_NumControlPoints);
addProperty(p_NumLevels);
addProperty(&p_computeSamples);
addProperty(&p_showSamples);
addProperty(&p_sampleFile);
addProperty(&p_saveSamples);
addProperty(p_computeSamples, VALID);
addProperty(p_showSamples);
addProperty(p_sampleFile, VALID);
addProperty(p_saveSamples, VALID);
addProperty(&p_controlpointFile);
addProperty(&p_saveCPs);
addProperty(&p_loadCPs);
addProperty(p_controlpointFile, VALID);
addProperty(p_saveCPs, VALID);
addProperty(p_loadCPs, VALID);
addProperty(&p_activeLayer);
addProperty(&p_addLayer);
addProperty(p_activeLayer);
addProperty(p_addLayer, VALID);
addProperty(&p_exportToLabelImage);
addProperty(p_exportToLabelImage, INVALID_RESULT | FIRST_FREE_TO_USE_INVALIDATION_LEVEL);
p_computeSamples.s_clicked.connect(this, &ManualTissueSegmenter::computeSamples);
p_saveSamples.s_clicked.connect(this, &ManualTissueSegmenter::saveSamples);
......
......@@ -74,7 +74,7 @@ namespace campvis {
Geometry1DTransferFunction* dvrTF = new Geometry1DTransferFunction(128, tgt::vec2(0.f, .05f));
dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.1f, .125f), tgt::col4(255, 0, 0, 32), tgt::col4(255, 0, 0, 32)));
dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.4f, .5f), tgt::col4(0, 255, 0, 128), tgt::col4(0, 255, 0, 128)));
static_cast<TransferFunctionProperty*>(_ve.getProperty("TransferFunction"))->replaceTF(dvrTF);
static_cast<TransferFunctionProperty*>(_ve.getNestedProperty("VolumeRendererProperties::RaycasterProps::TransferFunction"))->replaceTF(dvrTF);
}
......
......@@ -67,7 +67,7 @@ namespace campvis {
Geometry1DTransferFunction* dvrTF = new Geometry1DTransferFunction(128, tgt::vec2(0.f, .05f));
dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.1f, .125f), tgt::col4(255, 0, 0, 32), tgt::col4(255, 0, 0, 32)));
dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.4f, .5f), tgt::col4(0, 255, 0, 128), tgt::col4(0, 255, 0, 128)));
static_cast<TransferFunctionProperty*>(_ve.getProperty("TransferFunction"))->replaceTF(dvrTF);
static_cast<TransferFunctionProperty*>(_ve.getNestedProperty("VolumeRendererProperties::RaycasterProps::TransferFunction"))->replaceTF(dvrTF);
}
void MorphologyDemo::deinit() {
......
......@@ -67,7 +67,7 @@ namespace campvis {
Geometry1DTransferFunction* dvrTF = new Geometry1DTransferFunction(128, tgt::vec2(0.f, .05f));
dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.1f, .125f), tgt::col4(255, 0, 0, 32), tgt::col4(255, 0, 0, 32)));
dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.4f, .5f), tgt::col4(0, 255, 0, 128), tgt::col4(0, 255, 0, 128)));
static_cast<TransferFunctionProperty*>(_ve.getProperty("TransferFunction"))->replaceTF(dvrTF);
static_cast<TransferFunctionProperty*>(_ve.getNestedProperty("VolumeRendererProperties::RaycasterProps::TransferFunction"))->replaceTF(dvrTF);
}
void ResamplingDemo::deinit() {
......
......@@ -54,9 +54,9 @@ namespace campvis {
, _kernelBuffer(0)
, _kernelBufferTexture(0)
{
addProperty(&p_inputImage);
addProperty(&p_outputImage);
addProperty(&p_sigma);
addProperty(p_inputImage);
addProperty(p_outputImage);
addProperty(p_sigma);
}
GlGaussianFilter::~GlGaussianFilter() {
......
......@@ -45,14 +45,14 @@ namespace campvis {
GlGradientVolumeGenerator::GlGradientVolumeGenerator(IVec2Property* viewportSizeProp)
: VisualizationProcessor(viewportSizeProp)
, p_inputImage("InputImage", "Input Image", "", DataNameProperty::READ, AbstractProcessor::INVALID_RESULT)
, p_inputImage("InputImage", "Input Image", "", DataNameProperty::READ)
, p_outputImage("OutputImage", "Output Image", "GlGradientVolumeGenerator.out", DataNameProperty::WRITE)
, _shader(0)
{
addDecorator(new ProcessorDecoratorGradient());
addProperty(&p_inputImage);
addProperty(&p_outputImage);
addProperty(p_inputImage);
addProperty(p_outputImage);
decoratePropertyCollection(this);
}
......
......@@ -46,9 +46,9 @@ namespace campvis {
, p_resampleScale("ResampleScale", "Resampling Scale", .5f, .01f, 10.f)
, _shader(0)
{
addProperty(&p_inputImage);
addProperty(&p_outputImage);
addProperty(&p_resampleScale);
addProperty(p_inputImage);
addProperty(p_outputImage);
addProperty(p_resampleScale);
}
GlImageResampler::~GlImageResampler() {
......
......@@ -50,10 +50,10 @@ namespace campvis {
, p_transferFunction("TransferFunction", "Transfer Function", new Geometry1DTransferFunction(256))
, _shader(0)
{
addProperty(&p_inputImage);
addProperty(&p_outputImage);
addProperty(&p_numberOfBins);
addProperty(&p_transferFunction);
addProperty(p_inputImage);
addProperty(p_outputImage);
addProperty(p_numberOfBins);
addProperty(p_transferFunction);
Geometry1DTransferFunction* gtf = static_cast<Geometry1DTransferFunction*>(p_transferFunction.getTF());
gtf->addGeometry(TFGeometry1D::createQuad(tgt::vec2(0.f, 1.f), tgt::col4(0, 0, 0, 0), tgt::col4(255, 255, 255, 255)));
......
......@@ -50,17 +50,17 @@ namespace campvis {
GlMorphologyFilter::GlMorphologyFilter(IVec2Property* viewportSizeProp)
: VisualizationProcessor(viewportSizeProp)
, p_inputImage("InputImage", "Input Image", "", DataNameProperty::READ, AbstractProcessor::INVALID_RESULT)
, p_inputImage("InputImage", "Input Image", "", DataNameProperty::READ)
, p_outputImage("OutputImage", "Output Image", "GlMorphologyFilter.out", DataNameProperty::WRITE)
, p_filterOperation("FilterOperation", "Operations to Apply ([edoc]+)", "ed")
, p_structuringElement("StructuringElement", "Structuring Element", structuringElementOptions, 2, INVALID_SHADER | INVALID_RESULT)
, p_structuringElement("StructuringElement", "Structuring Element", structuringElementOptions, 2)
, _erosionFilter(nullptr)
, _dilationFilter(nullptr)
{
addProperty(&p_inputImage);
addProperty(&p_outputImage);
addProperty(&p_filterOperation);
addProperty(&p_structuringElement);
addProperty(p_inputImage);
addProperty(p_outputImage);
addProperty(p_filterOperation);
addProperty(p_structuringElement, INVALID_SHADER | INVALID_RESULT);
}
GlMorphologyFilter::~GlMorphologyFilter() {
......
......@@ -44,14 +44,14 @@ namespace campvis {
GlSignalToNoiseRatioFilter::GlSignalToNoiseRatioFilter(IVec2Property* viewportSizeProp)
: VisualizationProcessor(viewportSizeProp)
, p_inputImage("InputImage", "Input Image", "", DataNameProperty::READ, AbstractProcessor::INVALID_RESULT)
, p_inputImage("InputImage", "Input Image", "", DataNameProperty::READ)
, p_outputImage("OutputImage", "Output Image", "GlSignalToNoiseRatioFilter.out", DataNameProperty::WRITE)
, p_halfPrecisionOutput("HalfPrecisionOutput", "Use Half Precision (16 Bit) Output", true)
, _shader(0)
{
addProperty(&p_inputImage);
addProperty(&p_outputImage);
addProperty(&p_halfPrecisionOutput);
addProperty(p_inputImage);
addProperty(p_outputImage);
addProperty(p_halfPrecisionOutput);
}
GlSignalToNoiseRatioFilter::~GlSignalToNoiseRatioFilter() {
......
......@@ -44,7 +44,7 @@ namespace campvis {
GlVesselnessFilter::GlVesselnessFilter(IVec2Property* viewportSizeProp)
: VisualizationProcessor(viewportSizeProp)
, p_inputImage("InputImage", "Input (Gaussian Filtered) Image", "", DataNameProperty::READ, AbstractProcessor::INVALID_RESULT)
, p_inputImage("InputImage", "Input (Gaussian Filtered) Image", "", DataNameProperty::READ)
, p_outputImage("OutputImage", "Output Eigenvector Image", "GlVesselnessFilter.out", DataNameProperty::WRITE)
, p_lod("Lod", "Min/Max LOD for Multi-Level Texture Lookup", tgt::vec2(1.f, 3.f), tgt::vec2(0.f), tgt::vec2(10.f), tgt::vec2(.5f), tgt::ivec2(1))
, p_alpha("Alpha", "Alpha Value for Vesselness", .5f, .01f, 1.f, .1f, 2)
......@@ -54,16 +54,16 @@ namespace campvis {
, p_halfPrecisionOutput("HalfPrecisionOutput", "Use Half Precision (16 Bit) Output", true)
, _shader(0)
{
addProperty(&p_inputImage);
addProperty(&p_outputImage);
addProperty(p_inputImage);
addProperty(p_outputImage);
addProperty(&p_lod);
addProperty(&p_alpha);
addProperty(&p_beta);
addProperty(&p_gamma);
addProperty(&p_theta);
addProperty(p_lod);
addProperty(p_alpha);
addProperty(p_beta);
addProperty(p_gamma);
addProperty(p_theta);
addProperty(&p_halfPrecisionOutput);
addProperty(p_halfPrecisionOutput);
}
GlVesselnessFilter::~GlVesselnessFilter() {
......
......@@ -41,8 +41,8 @@ namespace campvis {
, p_sourceImageID("InputVolume", "Input Volume ID", "volume", DataNameProperty::READ)
, p_targetImageID("OutputGradients", "Output Gradient Volume ID", "gradients", DataNameProperty::WRITE)
{
addProperty(&p_sourceImageID);
addProperty(&p_targetImageID);
addProperty(p_sourceImageID);
addProperty(p_targetImageID);
}
GradientVolumeGenerator::~GradientVolumeGenerator() {
......
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