Commit 0737f058 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Refactored DataNameProperty: Got rid of issueWrite() and connect(). Automatic...

Refactored DataNameProperty: Got rid of issueWrite() and connect(). Automatic invalidation of connected (shared) DataNameProperties is now delegated to AutoEvaluationPipeline.
ATTENTION: needs TBB 4.2 (not yet in repository, will be changed later)
parent 5c739225
...@@ -216,6 +216,13 @@ namespace campvis { ...@@ -216,6 +216,13 @@ namespace campvis {
*/ */
virtual void onPropertyChanged(const AbstractProperty* prop); virtual void onPropertyChanged(const AbstractProperty* prop);
/**
* Gets called when the data collection of this pipeline has changed and thus has notified its observers.
* If \a name equals the name of the renderTarget, the s_renderTargetChanged signal will be emitted.
* \param name Name of the added data.
* \param dh DataHandle to the newly added data.
*/
virtual void onDataContainerDataAdded(const std::string& name, const DataHandle& dh);
/// Pointer to the DataContainer containing local working set of data for this Pipeline, must not be 0. /// Pointer to the DataContainer containing local working set of data for this Pipeline, must not be 0.
DataContainer* _data; DataContainer* _data;
...@@ -231,16 +238,6 @@ namespace campvis { ...@@ -231,16 +238,6 @@ namespace campvis {
static const std::string loggerCat_; static const std::string loggerCat_;
private:
/**
* Gets called when the data collection of this pipeline has changed and thus has notified its observers.
* If \a name equals the name of the renderTarget, the s_renderTargetChanged signal will be emitted.
* \param name Name of the added data.
* \param dh DataHandle to the newly added data.
*/
void onDataContainerDataAdded(const std::string& name, const DataHandle& dh);
}; };
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "tgt/glcanvas.h" #include "tgt/glcanvas.h"
#include "tgt/glcontext.h" #include "tgt/glcontext.h"
#include "core/pipeline/visualizationprocessor.h" #include "core/pipeline/visualizationprocessor.h"
#include "core/properties/datanameproperty.h"
#include "core/tools/job.h" #include "core/tools/job.h"
#include "core/tools/opengljobprocessor.h" #include "core/tools/opengljobprocessor.h"
#include "core/tools/simplejobprocessor.h" #include "core/tools/simplejobprocessor.h"
...@@ -90,7 +91,62 @@ namespace campvis { ...@@ -90,7 +91,62 @@ namespace campvis {
void AutoEvaluationPipeline::addProcessor(AbstractProcessor* processor) { void AutoEvaluationPipeline::addProcessor(AbstractProcessor* processor) {
_isVisProcessorMap.insert(std::make_pair(processor, (dynamic_cast<VisualizationProcessor*>(processor) != 0))); _isVisProcessorMap.insert(std::make_pair(processor, (dynamic_cast<VisualizationProcessor*>(processor) != 0)));
PropertyCollection pc = processor->getProperties();
for (size_t i = 0; i < pc.size(); ++i) {
if (DataNameProperty* dnp = dynamic_cast<DataNameProperty*>(pc[i])) {
if (dnp->getAccessInfo() == DataNameProperty::READ) {
tbb::spin_rw_mutex::scoped_lock lock(_pmMutex, false);
std::pair<PortMapType::iterator, bool> result = _portMap.insert(std::make_pair(dnp->getValue(), dnp));
tgtAssert(result.second, "Could not insert Property into port map!");
if (result.second) {
_iteratorMap[dnp] = result.first;
dnp->s_changed.connect(this, &AutoEvaluationPipeline::onDataNamePropertyChanged);
}
}
}
}
AbstractPipeline::addProcessor(processor); AbstractPipeline::addProcessor(processor);
} }
void AutoEvaluationPipeline::onDataNamePropertyChanged(const AbstractProperty* prop) {
DataNameProperty* dnp = const_cast<DataNameProperty*>(static_cast<const DataNameProperty*>(prop));
// find string-iterator pair
IteratorMapType::iterator it = _iteratorMap.find(dnp);
if (it != _iteratorMap.end()) {
if (dnp->getValue() != it->second->first) {
{
tbb::spin_rw_mutex::scoped_lock lock(_pmMutex, true);
// value of the property has changed
_portMap.unsafe_erase(it->second);
}
tbb::spin_rw_mutex::scoped_lock lock(_pmMutex, false);
std::pair<PortMapType::iterator, bool> result = _portMap.insert(std::make_pair(dnp->getValue(), dnp));
tgtAssert(result.second, "Could not insert Property into port map!");
if (result.second) {
it->second = result.first;
}
}
}
else {
tgtAssert(false, "Could not find Property in iterator map!");
}
}
void AutoEvaluationPipeline::onDataContainerDataAdded(const std::string& name, const DataHandle& dh) {
{
tbb::spin_rw_mutex::scoped_lock lock(_pmMutex, false);
PortMapType::const_iterator it = _portMap.find(name);
while(it != _portMap.end() && it->first == name) {
it->second->s_changed(it->second);
++it;
}
}
AbstractPipeline::onDataContainerDataAdded(name, dh);
}
} }
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
#define AUTOEVALUATIONPIPELINE_H__ #define AUTOEVALUATIONPIPELINE_H__
#include "sigslot/sigslot.h" #include "sigslot/sigslot.h"
#include "tbb/concurrent_hash_map.h" #include <tbb/concurrent_hash_map.h>
#include <tbb/concurrent_unordered_map.h>
#include <tbb/spin_rw_mutex.h>
#include "core/pipeline/abstractpipeline.h" #include "core/pipeline/abstractpipeline.h"
...@@ -74,10 +76,25 @@ namespace campvis { ...@@ -74,10 +76,25 @@ namespace campvis {
*/ */
virtual void onProcessorInvalidated(AbstractProcessor* processor); virtual void onProcessorInvalidated(AbstractProcessor* processor);
static const std::string loggerCat_;
private:
void onDataNamePropertyChanged(const AbstractProperty* prop);
virtual void onDataContainerDataAdded(const std::string& name, const DataHandle& dh);
/// Hashmap storing for each processor whether it's a VisualizationProcessor or not.
tbb::concurrent_hash_map<AbstractProcessor*, bool> _isVisProcessorMap; tbb::concurrent_hash_map<AbstractProcessor*, bool> _isVisProcessorMap;
static const std::string loggerCat_; typedef tbb::concurrent_unordered_multimap<std::string, DataNameProperty*> PortMapType;
typedef tbb::concurrent_unordered_map<DataNameProperty*, PortMapType::iterator> IteratorMapType;
/// Multimap to simulate ports between processors
PortMapType _portMap;
IteratorMapType _iteratorMap;
tbb::spin_rw_mutex _pmMutex;
}; };
} }
......
...@@ -43,38 +43,6 @@ namespace campvis { ...@@ -43,38 +43,6 @@ namespace campvis {
DataNameProperty::~DataNameProperty() { DataNameProperty::~DataNameProperty() {
} }
void DataNameProperty::connect(DataNameProperty* reader) {
tgtAssert(reader != 0, "Reader must not be 0");
tgtAssert(_accessInfo == WRITE, "Can only connect writing properties to reading properties.");
tgtAssert(reader->_accessInfo == READ, "Can only connect writing properties to reading properties.");
if (_connectedReaders.insert(reader).second)
addSharedProperty(reader);
}
void DataNameProperty::disconnect(DataNameProperty* reader) {
tgtAssert(reader != 0, "Reader must not be 0");
if (_connectedReaders.erase(reader) > 0)
removeSharedProperty(reader);
}
void DataNameProperty::issueWrite() {
tgtAssert(_accessInfo == WRITE, "Write access not specified.");
for (std::set<DataNameProperty*>::iterator it = _connectedReaders.begin(); it != _connectedReaders.end(); ++it) {
(*it)->notifyReaders();
}
}
void DataNameProperty::notifyReaders() {
for (std::set<AbstractProperty*>::iterator it = _sharedProperties.begin(); it != _sharedProperties.end(); ++it) {
// static_cast ist safe here since correct type is ensured during add of shared property
static_cast<DataNameProperty*>(*it)->notifyReaders();
}
s_changed(this);
}
DataNameProperty::DataAccessInfo DataNameProperty::getAccessInfo() const { DataNameProperty::DataAccessInfo DataNameProperty::getAccessInfo() const {
return _accessInfo; return _accessInfo;
} }
......
...@@ -65,6 +65,7 @@ namespace campvis { ...@@ -65,6 +65,7 @@ namespace campvis {
/** /**
<<<<<<< HEAD
* Connects this property with the given DataNameProperty \a reader. * Connects this property with the given DataNameProperty \a reader.
* \param reader DataNameProperty to connect to, must be have read access. * \param reader DataNameProperty to connect to, must be have read access.
*/ */
...@@ -78,18 +79,16 @@ namespace campvis { ...@@ -78,18 +79,16 @@ namespace campvis {
/** /**
* Returns the access info of this property defining whether processor will read or write. * Returns the access info of this property defining whether processor will read or write.
=======
* Returns the access info of this property defining whether component will read or write.
>>>>>>> c4c5899... Refactored DataNameProperty: Got rid of issueWrite() and connect(). Automatic invalidation of connected (shared) DataNameProperties is now delegated to AutoEvaluationPipeline.
* \return _accessInfo * \return _accessInfo
*/ */
DataAccessInfo getAccessInfo() const; DataAccessInfo getAccessInfo() const;
void issueWrite();
protected: protected:
void notifyReaders();
DataAccessInfo _accessInfo; DataAccessInfo _accessInfo;
std::set<DataNameProperty*> _connectedReaders;
static const std::string loggerCat_; static const std::string loggerCat_;
}; };
......
...@@ -100,40 +100,40 @@ namespace campvis { ...@@ -100,40 +100,40 @@ namespace campvis {
//_usReader.p_url.setValue("D:\\Medical Data\\US Confidence Vis\\UltrasoundBoneData\\SynthesEvaluationUnterschenkel"); //_usReader.p_url.setValue("D:\\Medical Data\\US Confidence Vis\\UltrasoundBoneData\\SynthesEvaluationUnterschenkel");
//_usReader.p_url.setValue("D:\\Medical Data\\US Confidence Vis\\transcranial\\us.png"); //_usReader.p_url.setValue("D:\\Medical Data\\US Confidence Vis\\transcranial\\us.png");
_usReader.p_targetImageID.setValue("us.image"); _usReader.p_targetImageID.setValue("us.image");
_usReader.p_targetImageID.connect(&_confidenceGenerator.p_sourceImageID); _usReader.p_targetImageID.addSharedProperty(&_confidenceGenerator.p_sourceImageID);
_usReader.p_targetImageID.connect(&_usFusion1.p_usImageId); _usReader.p_targetImageID.addSharedProperty(&_usFusion1.p_usImageId);
_usReader.p_targetImageID.connect(&_usFusion2.p_usImageId); _usReader.p_targetImageID.addSharedProperty(&_usFusion2.p_usImageId);
_usReader.p_targetImageID.connect(&_usFusion3.p_usImageId); _usReader.p_targetImageID.addSharedProperty(&_usFusion3.p_usImageId);
_usReader.p_targetImageID.connect(&_usFusion4.p_usImageId); _usReader.p_targetImageID.addSharedProperty(&_usFusion4.p_usImageId);
_usReader.p_targetImageID.connect(&_gvg.p_sourceImageID); _usReader.p_targetImageID.addSharedProperty(&_gvg.p_sourceImageID);
_usReader.p_targetImageID.connect(&_lhh.p_intensitiesId); _usReader.p_targetImageID.addSharedProperty(&_lhh.p_intensitiesId);
_usReader.p_targetImageID.connect(&_usBlurFilter.p_sourceImageID); _usReader.p_targetImageID.addSharedProperty(&_usBlurFilter.p_sourceImageID);
_usReader.p_targetImageID.connect(&_usDenoiseilter.p_sourceImageID); _usReader.p_targetImageID.addSharedProperty(&_usDenoiseilter.p_sourceImageID);
_confidenceReader.p_url.setValue("D:\\Medical Data\\US Confidence Vis\\CurefabCS\\Stent_Patient_ B-Mode_2013-02-11T14.56.46z\\01_cm.mhd"); _confidenceReader.p_url.setValue("D:\\Medical Data\\US Confidence Vis\\CurefabCS\\Stent_Patient_ B-Mode_2013-02-11T14.56.46z\\01_cm.mhd");
//_confidenceReader.p_url.setValue("D:\\Medical Data\\US Confidence Vis\\01\\Confidence_01.mhd"); //_confidenceReader.p_url.setValue("D:\\Medical Data\\US Confidence Vis\\01\\Confidence_01.mhd");
//_confidenceReader.p_url.setValue("D:\\Medical Data\\US Confidence Vis\\UltrasoundBoneData\\SynthesEvaluationUnterschenkel"); //_confidenceReader.p_url.setValue("D:\\Medical Data\\US Confidence Vis\\UltrasoundBoneData\\SynthesEvaluationUnterschenkel");
//_confidenceReader.p_url.setValue("D:\\Medical Data\\US Confidence Vis\\transcranial\\cm.png"); //_confidenceReader.p_url.setValue("D:\\Medical Data\\US Confidence Vis\\transcranial\\cm.png");
_confidenceReader.p_targetImageID.setValue("confidence.image.read"); _confidenceReader.p_targetImageID.setValue("confidence.image.read");
_confidenceReader.p_targetImageID.connect(&_usFusion1.p_confidenceImageID); _confidenceReader.p_targetImageID.addSharedProperty(&_usFusion1.p_confidenceImageID);
_confidenceReader.p_targetImageID.connect(&_usFusion2.p_confidenceImageID); _confidenceReader.p_targetImageID.addSharedProperty(&_usFusion2.p_confidenceImageID);
_confidenceReader.p_targetImageID.connect(&_usFusion3.p_confidenceImageID); _confidenceReader.p_targetImageID.addSharedProperty(&_usFusion3.p_confidenceImageID);
_confidenceReader.p_targetImageID.connect(&_usFusion4.p_confidenceImageID); _confidenceReader.p_targetImageID.addSharedProperty(&_usFusion4.p_confidenceImageID);
_confidenceGenerator.p_targetImageID.setValue("confidence.image.generated"); _confidenceGenerator.p_targetImageID.setValue("confidence.image.generated");
//_confidenceGenerator.p_targetImageID.connect(&_usFusion1.p_confidenceImageID); //_confidenceGenerator.p_targetImageID.addSharedProperty(&_usFusion1.p_confidenceImageID);
//_confidenceGenerator.p_targetImageID.connect(&_usFusion2.p_confidenceImageID); //_confidenceGenerator.p_targetImageID.addSharedProperty(&_usFusion2.p_confidenceImageID);
//_confidenceGenerator.p_targetImageID.connect(&_usFusion3.p_confidenceImageID); //_confidenceGenerator.p_targetImageID.addSharedProperty(&_usFusion3.p_confidenceImageID);
//_confidenceGenerator.p_targetImageID.connect(&_usFusion4.p_confidenceImageID); //_confidenceGenerator.p_targetImageID.addSharedProperty(&_usFusion4.p_confidenceImageID);
_gvg.p_targetImageID.connect(&_lhh.p_gradientsId); _gvg.p_targetImageID.addSharedProperty(&_lhh.p_gradientsId);
_gvg.p_targetImageID.connect(&_usFusion1.p_gradientImageID); _gvg.p_targetImageID.addSharedProperty(&_usFusion1.p_gradientImageID);
_gvg.p_targetImageID.connect(&_usFusion2.p_gradientImageID); _gvg.p_targetImageID.addSharedProperty(&_usFusion2.p_gradientImageID);
_gvg.p_targetImageID.connect(&_usFusion3.p_gradientImageID); _gvg.p_targetImageID.addSharedProperty(&_usFusion3.p_gradientImageID);
_gvg.p_targetImageID.connect(&_usFusion4.p_gradientImageID); _gvg.p_targetImageID.addSharedProperty(&_usFusion4.p_gradientImageID);
_usFusion1.p_targetImageID.setValue("us.fused1"); _usFusion1.p_targetImageID.setValue("us.fused1");
_usFusion1.p_targetImageID.connect(&_quadView.p_inputImage1); _usFusion1.p_targetImageID.addSharedProperty(&_quadView.p_inputImage1);
_usFusion1.p_view.selectById("us"); _usFusion1.p_view.selectById("us");
_usFusion1.p_sliceNumber.setValue(0); _usFusion1.p_sliceNumber.setValue(0);
_usFusion1.p_sliceNumber.addSharedProperty(&_usFusion2.p_sliceNumber); _usFusion1.p_sliceNumber.addSharedProperty(&_usFusion2.p_sliceNumber);
...@@ -141,42 +141,42 @@ namespace campvis { ...@@ -141,42 +141,42 @@ namespace campvis {
_usFusion1.p_sliceNumber.addSharedProperty(&_usFusion4.p_sliceNumber); _usFusion1.p_sliceNumber.addSharedProperty(&_usFusion4.p_sliceNumber);
_usFusion2.p_targetImageID.setValue("us.fused2"); _usFusion2.p_targetImageID.setValue("us.fused2");
_usFusion2.p_targetImageID.connect(&_quadView.p_inputImage2); _usFusion2.p_targetImageID.addSharedProperty(&_quadView.p_inputImage2);
_usFusion2.p_view.selectById("mappingSaturationHSV"); _usFusion2.p_view.selectById("mappingSaturationHSV");
_usFusion3.p_targetImageID.setValue("us.fused3"); _usFusion3.p_targetImageID.setValue("us.fused3");
_usFusion3.p_targetImageID.connect(&_quadView.p_inputImage3); _usFusion3.p_targetImageID.addSharedProperty(&_quadView.p_inputImage3);
_usFusion3.p_view.selectById("mappingLAB"); _usFusion3.p_view.selectById("mappingLAB");
_usFusion3.p_hue.setValue(0.22f); _usFusion3.p_hue.setValue(0.22f);
_usFusion4.p_targetImageID.setValue("us.fused4"); _usFusion4.p_targetImageID.setValue("us.fused4");
_usFusion4.p_targetImageID.connect(&_quadView.p_inputImage4); _usFusion4.p_targetImageID.addSharedProperty(&_quadView.p_inputImage4);
_usFusion4.p_view.selectById("mappingSharpness"); _usFusion4.p_view.selectById("mappingSharpness");
_usBlurFilter.p_targetImageID.setValue("us.blurred"); _usBlurFilter.p_targetImageID.setValue("us.blurred");
_usBlurFilter.p_targetImageID.connect(&_usFusion1.p_blurredImageId); _usBlurFilter.p_targetImageID.addSharedProperty(&_usFusion1.p_blurredImageId);
_usBlurFilter.p_targetImageID.connect(&_usFusion2.p_blurredImageId); _usBlurFilter.p_targetImageID.addSharedProperty(&_usFusion2.p_blurredImageId);
_usBlurFilter.p_targetImageID.connect(&_usFusion3.p_blurredImageId); _usBlurFilter.p_targetImageID.addSharedProperty(&_usFusion3.p_blurredImageId);
_usBlurFilter.p_targetImageID.connect(&_usFusion4.p_blurredImageId); _usBlurFilter.p_targetImageID.addSharedProperty(&_usFusion4.p_blurredImageId);
_usBlurFilter.p_filterMode.selectById("gauss"); _usBlurFilter.p_filterMode.selectById("gauss");
_usBlurFilter.p_sigma.setValue(4.f); _usBlurFilter.p_sigma.setValue(4.f);
_quadView.p_outputImage.setValue("quadview.output"); _quadView.p_outputImage.setValue("quadview.output");
_usDenoiseilter.p_targetImageID.setValue("us.denoised"); _usDenoiseilter.p_targetImageID.setValue("us.denoised");
_usDenoiseilter.p_targetImageID.connect(&_usProxy.p_sourceImageID); _usDenoiseilter.p_targetImageID.addSharedProperty(&_usProxy.p_sourceImageID);
_usDenoiseilter.p_targetImageID.connect(&_usEEP.p_sourceImageID); _usDenoiseilter.p_targetImageID.addSharedProperty(&_usEEP.p_sourceImageID);
_usDenoiseilter.p_targetImageID.connect(&_usDVR.p_sourceImageID); _usDenoiseilter.p_targetImageID.addSharedProperty(&_usDVR.p_sourceImageID);
_usDenoiseilter.p_filterMode.selectById("gradientDiffusion"); _usDenoiseilter.p_filterMode.selectById("gradientDiffusion");
_usDenoiseilter.p_numberOfSteps.setValue(3); _usDenoiseilter.p_numberOfSteps.setValue(3);
_usProxy.p_geometryID.setValue("us.proxy"); _usProxy.p_geometryID.setValue("us.proxy");
_usProxy.p_geometryID.connect(&_usEEP.p_geometryID); _usProxy.p_geometryID.addSharedProperty(&_usEEP.p_geometryID);
_usEEP.p_entryImageID.setValue("us.entry"); _usEEP.p_entryImageID.setValue("us.entry");
_usEEP.p_entryImageID.connect(&_usDVR.p_entryImageID); _usEEP.p_entryImageID.addSharedProperty(&_usDVR.p_entryImageID);
_usEEP.p_exitImageID.setValue("us.exit"); _usEEP.p_exitImageID.setValue("us.exit");
_usEEP.p_exitImageID.connect(&_usDVR.p_exitImageID); _usEEP.p_exitImageID.addSharedProperty(&_usDVR.p_exitImageID);
// TODO: replace this hardcoded domain by automatically determined from image min/max values // TODO: replace this hardcoded domain by automatically determined from image min/max values
Geometry1DTransferFunction* tf = new Geometry1DTransferFunction(128, tgt::vec2(0.f, 1.f)); Geometry1DTransferFunction* tf = new Geometry1DTransferFunction(128, tgt::vec2(0.f, 1.f));
......
...@@ -91,12 +91,12 @@ namespace campvis { ...@@ -91,12 +91,12 @@ namespace campvis {
_usReader.p_url.setValue("D:\\Medical Data\\US Confidence Vis\\Pasing 13-02-26\\04-02-22-212506_Perez11_20040222_212506_20040222_220332\\11_niere_re_durch_leber2\\original\\export0000.bmp"); _usReader.p_url.setValue("D:\\Medical Data\\US Confidence Vis\\Pasing 13-02-26\\04-02-22-212506_Perez11_20040222_212506_20040222_220332\\11_niere_re_durch_leber2\\original\\export0000.bmp");
_usReader.p_targetImageID.setValue("us.image"); _usReader.p_targetImageID.setValue("us.image");
_usReader.p_importType.selectById("localIntensity"); _usReader.p_importType.selectById("localIntensity");
_usReader.p_targetImageID.connect(&_confidenceGenerator.p_sourceImageID); _usReader.p_targetImageID.addSharedProperty(&_confidenceGenerator.p_sourceImageID);
_usReader.p_targetImageID.connect(&_usFusion.p_usImageId); _usReader.p_targetImageID.addSharedProperty(&_usFusion.p_usImageId);
_usReader.p_targetImageID.connect(&_usBlurFilter.p_sourceImageID); _usReader.p_targetImageID.addSharedProperty(&_usBlurFilter.p_sourceImageID);
_confidenceGenerator.p_targetImageID.setValue("confidence.image.generated"); _confidenceGenerator.p_targetImageID.setValue("confidence.image.generated");
_confidenceGenerator.p_targetImageID.connect(&_usFusion.p_confidenceImageID); _confidenceGenerator.p_targetImageID.addSharedProperty(&_usFusion.p_confidenceImageID);
_confidenceGenerator.p_curvilinear.setValue(true); _confidenceGenerator.p_curvilinear.setValue(true);
_confidenceGenerator.p_origin.setValue(tgt::vec2(340.f, 540.f)); _confidenceGenerator.p_origin.setValue(tgt::vec2(340.f, 540.f));
_confidenceGenerator.p_angles.setValue(tgt::vec2(4.064f, 5.363f)); _confidenceGenerator.p_angles.setValue(tgt::vec2(4.064f, 5.363f));
...@@ -110,7 +110,7 @@ namespace campvis { ...@@ -110,7 +110,7 @@ namespace campvis {
_usFusion.p_sliceNumber.setValue(0); _usFusion.p_sliceNumber.setValue(0);
_usBlurFilter.p_targetImageID.setValue("us.blurred"); _usBlurFilter.p_targetImageID.setValue("us.blurred");
_usBlurFilter.p_targetImageID.connect(&_usFusion.p_blurredImageId); _usBlurFilter.p_targetImageID.addSharedProperty(&_usFusion.p_blurredImageId);
_usBlurFilter.p_filterMode.selectById("gauss"); _usBlurFilter.p_filterMode.selectById("gauss");
_usBlurFilter.p_sigma.setValue(4.f); _usBlurFilter.p_sigma.setValue(4.f);
......
...@@ -148,7 +148,6 @@ namespace campvis { ...@@ -148,7 +148,6 @@ namespace campvis {
tgt::TextureUnit::setZeroUnit(); tgt::TextureUnit::setZeroUnit();
data.addData(p_targetImageID.getValue(), new RenderData(_fbo)); data.addData(p_targetImageID.getValue(), new RenderData(_fbo));
p_targetImageID.issueWrite();
} }
else { else {
LERROR("Input image must have dimensionality of 3."); LERROR("Input image must have dimensionality of 3.");
......
...@@ -109,41 +109,41 @@ namespace campvis { ...@@ -109,41 +109,41 @@ namespace campvis {
_imageReader.p_numChannels.setValue(1); _imageReader.p_numChannels.setValue(1);
_imageReader.p_baseType.selectById("uint8"); _imageReader.p_baseType.selectById("uint8");
_imageReader.p_targetImageID.setValue("image"); _imageReader.p_targetImageID.setValue("image");
_imageReader.p_targetImageID.connect(&_imageSplitter.p_inputID); _imageReader.p_targetImageID.addSharedProperty(&_imageSplitter.p_inputID);
_imageSplitter.p_outputID.setValue("image.single"); _imageSplitter.p_outputID.setValue("image.single");
_imageSplitter.p_outputID.connect(&_vr.p_inputVolume); _imageSplitter.p_outputID.addSharedProperty(&_vr.p_inputVolume);
_flowReader.p_url.setValue("D:/Medical Data/Columbia/outputs/FullVolumeLV_3D_25Hz_[IM_0004]_NIF_crop_flow_field_00_00.ltf"); _flowReader.p_url.setValue("D:/Medical Data/Columbia/outputs/FullVolumeLV_3D_25Hz_[IM_0004]_NIF_crop_flow_field_00_00.ltf");
_flowReader.p_size.setValue(tgt::ivec3(224, 176, 208)); _flowReader.p_size.setValue(tgt::ivec3(224, 176, 208));
_flowReader.p_numChannels.setValue(3); _flowReader.p_numChannels.setValue(3);
_flowReader.p_baseType.selectById("float"); _flowReader.p_baseType.selectById("float");
_flowReader.p_targetImageID.setValue("flow"); _flowReader.p_targetImageID.setValue("flow");
_flowReader.p_targetImageID.connect(&_flowSplitter.p_inputID); _flowReader.p_targetImageID.addSharedProperty(&_flowSplitter.p_inputID);
_flowSplitter.p_outputID.setValue("flow.single"); _flowSplitter.p_outputID.setValue("flow.single");
_flowSplitter.p_outputID.connect(&_src.p_sourceImageID); _flowSplitter.p_outputID.addSharedProperty(&_src.p_sourceImageID);
_flowSplitter.p_outputID.connect(&_sr.p_sourceImageID); _flowSplitter.p_outputID.addSharedProperty(&_sr.p_sourceImageID);
_flowSplitter.p_outputID.connect(&_sft.p_strainId); _flowSplitter.p_outputID.addSharedProperty(&_sft.p_strainId);
_vtkReader.p_targetImageID.setValue("mesh"); _vtkReader.p_targetImageID.setValue("mesh");
_vtkReader.p_url.setValue("D:/Medical Data/Columbia/inputs/Myocardium Meshes/FullVolumeLV_3D_25Hz_ED_Mesh_Endo.vtk"); _vtkReader.p_url.setValue("D:/Medical Data/Columbia/inputs/Myocardium Meshes/FullVolumeLV_3D_25Hz_ED_Mesh_Endo.vtk");
_vtkReader.p_targetImageID.connect(&_gr.p_geometryID); _vtkReader.p_targetImageID.addSharedProperty(&_gr.p_geometryID);
Geometry1DTransferFunction* dvrTF = new Geometry1DTransferFunction(128, tgt::vec2(0.f, 1.f)); Geometry1DTransferFunction* dvrTF = new Geometry1DTransferFunction(128, tgt::vec2(0.f, 1.f));
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(.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))); dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.4f, .5f), tgt::col4(0, 255, 0, 128), tgt::col4(0, 255, 0, 128)));
static_cast<TransferFunctionProperty*>(_vr.getProperty("TransferFunction"))->replaceTF(dvrTF); static_cast<TransferFunctionProperty*>(_vr.getProperty("TransferFunction"))->replaceTF(dvrTF);
_vr.p_outputImage.connect(&_compositor.p_secondImageId); _vr.p_outputImage.addSharedProperty(&_compositor.p_secondImageId);
_gr.p_renderTargetID.setValue("gr"); _gr.p_renderTargetID.setValue("gr");
_sft.p_outputID.setValue("fibers"); _sft.p_outputID.setValue("fibers");
_sft.p_outputID.connect(&_sfr.p_strainId); _sft.p_outputID.addSharedProperty(&_sfr.p_strainId);
_sfr.p_renderTargetID.setValue("sfr"); _sfr.p_renderTargetID.setValue("sfr");
_sfr.p_renderTargetID.connect(static_cast<DataNameProperty*>(_vr.getProperty("GeometryImageId"))); _sfr.p_renderTargetID.addSharedProperty(static_cast<DataNameProperty*>(_vr.getProperty("GeometryImageId")));
_sfr.p_renderTargetID.connect(&_compositor.p_firstImageId); _sfr.p_renderTargetID.addSharedProperty(&_compositor.p_firstImageId);
} }
void Columbia1::deinit() { void Columbia1::deinit() {
......
...@@ -117,7 +117,6 @@ namespace campvis { ...@@ -117,7 +117,6 @@ namespace campvis {
LGL_ERROR; LGL_ERROR;
data.addData(p_renderTargetID.getValue(), new RenderData(_fbo)); data.addData(p_renderTargetID.getValue(), new RenderData(_fbo));
p_renderTargetID.issueWrite();
} }
else { else {
LERROR("No suitable input geometry found."); LERROR("No suitable input geometry found.");
......
...@@ -58,7 +58,6 @@ namespace campvis { ...@@ -58,7 +58,6 @@ namespace campvis {
} }
if (p_imageIndex.getValue() < static_cast<int>(series->getNumImages())) { if (p_imageIndex.getValue() < static_cast<int>(series->getNumImages())) {
data.addDataHandle(p_outputID.getValue(), series->getImage(p_imageIndex.getValue())); data.addDataHandle(p_outputID.getValue(), series->getImage(p_imageIndex.getValue()));
p_outputID.issueWrite();
} }
} }
......
...@@ -132,7 +132,6 @@ namespace campvis { ...@@ -132,7 +132,6 @@ namespace campvis {
LGL_ERROR;