Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit ff29ff68 authored by schultezub's avatar schultezub
Browse files

* added AbstractPipeline::addProcessor() and...

* added AbstractPipeline::addProcessor() and VisualizationPipeline::addEventHandler() convenience methods
* some refactoring of property names

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@344 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent d626149d
......@@ -128,4 +128,7 @@ namespace campvis {
_enabled = enabled;
}
void AbstractPipeline::addProcessor(AbstractProcessor* processor) {
_processors.push_back(processor);
}
}
......@@ -94,6 +94,12 @@ namespace campvis {
*/
DataContainer& getDataContainer();
/**
* Adds the processors \a processor to this pipeline's processor list.
* \param processor The processor to add.
*/
void addProcessor(AbstractProcessor* processor);
/**
* Returns the list of processors of this pipeline.
* \return _processors
......@@ -147,6 +153,8 @@ namespace campvis {
* \param processor Processor to execute.
*/
void executeProcessor(AbstractProcessor* processor);
DataContainer _data; ///< DataContainer containing local working set of data for this Pipeline
std::vector<AbstractProcessor*> _processors; ///< List of all processors of this pipeline
......
......@@ -95,7 +95,7 @@ namespace campvis {
tgtAssert(processor != 0, "Processor must not be 0!");
// add processor to processor list and connect signals
_processors.push_back(processor);
VisualizationPipeline::addProcessor(processor);
processor->s_invalidated.connect<DigraphVisualizationPipeline>(this, &DigraphVisualizationPipeline::onProcessorInvalidated);
// create DependencyNode
......
......@@ -45,26 +45,26 @@ namespace campvis {
RaycastingProcessor::RaycastingProcessor(GenericProperty<tgt::ivec2>& renderTargetSize, const std::string& fragmentShaderFileName, bool bindEntryExitDepthTextures)
: VisualizationProcessor(renderTargetSize)
, _sourceImageID("sourceImageID", "Input Image", "", DataNameProperty::READ)
, _entryImageID("entryImageID", "Input Entry Points Image", "", DataNameProperty::READ)
, _exitImageID("exitImageID", "Input Exit Points Image", "", DataNameProperty::READ)
, _camera("camera", "Camera")
, _transferFunction("transferFunction", "Transfer Function", new SimpleTransferFunction(256))
, _samplingStepSize("samplingStepSize", "Sampling Step Size", .05f, 0.001f, 1.f)
, _jitterEntryPoints("jitterEntryPoints", "Jitter Entry Points", true)
, _jitterStepSizeMultiplier("jitterStepSizeMultiplier", "Jitter Step Size Multiplier", .5f, .1f, 1.f)
, p_sourceImageID("sourceImageID", "Input Image", "", DataNameProperty::READ)
, p_entryImageID("entryImageID", "Input Entry Points Image", "", DataNameProperty::READ)
, p_exitImageID("exitImageID", "Input Exit Points Image", "", DataNameProperty::READ)
, p_camera("camera", "Camera")
, p_transferFunction("transferFunction", "Transfer Function", new SimpleTransferFunction(256))
, p_samplingStepSize("samplingStepSize", "Sampling Step Size", .05f, 0.001f, 1.f)
, p_jitterEntryPoints("jitterEntryPoints", "Jitter Entry Points", true)
, p_jitterStepSizeMultiplier("jitterStepSizeMultiplier", "Jitter Step Size Multiplier", .5f, .1f, 1.f)
, _fragmentShaderFilename(fragmentShaderFileName)
, _shader(0)
, _bindEntryExitDepthTextures(bindEntryExitDepthTextures)
{
addProperty(&_sourceImageID);
addProperty(&_entryImageID);
addProperty(&_exitImageID);
addProperty(&_camera);
addProperty(&_transferFunction);
addProperty(&_samplingStepSize);
addProperty(&_jitterEntryPoints);
addProperty(&_jitterStepSizeMultiplier);
addProperty(&p_sourceImageID);
addProperty(&p_entryImageID);
addProperty(&p_exitImageID);
addProperty(&p_camera);
addProperty(&p_transferFunction);
addProperty(&p_samplingStepSize);
addProperty(&p_jitterEntryPoints);
addProperty(&p_jitterStepSizeMultiplier);
}
RaycastingProcessor::~RaycastingProcessor() {
......@@ -85,9 +85,9 @@ namespace campvis {
}
void RaycastingProcessor::process(DataContainer& data) {
DataContainer::ScopedTypedData<ImageDataGL> img(data, _sourceImageID.getValue());
DataContainer::ScopedTypedData<ImageDataRenderTarget> entryPoints(data, _entryImageID.getValue());
DataContainer::ScopedTypedData<ImageDataRenderTarget> exitPoints(data, _exitImageID.getValue());
DataContainer::ScopedTypedData<ImageDataGL> img(data, p_sourceImageID.getValue());
DataContainer::ScopedTypedData<ImageDataRenderTarget> entryPoints(data, p_entryImageID.getValue());
DataContainer::ScopedTypedData<ImageDataRenderTarget> exitPoints(data, p_exitImageID.getValue());
if (img != 0 && entryPoints != 0 && exitPoints != 0) {
if (img->getDimensionality() == 3) {
......@@ -97,7 +97,7 @@ namespace campvis {
}
glPushAttrib(GL_ALL_ATTRIB_BITS);
_transferFunction.getTF()->uploadTexture();
p_transferFunction.getTF()->uploadTexture();
glEnable(GL_DEPTH_TEST);
_shader->activate();
......@@ -105,14 +105,14 @@ namespace campvis {
_shader->setIgnoreUniformLocationError(true);
decorateRenderProlog(data, _shader);
_shader->setUniform("_viewportSizeRCP", 1.f / tgt::vec2(_renderTargetSize.getValue()));
_shader->setUniform("_jitterEntryPoints", _jitterEntryPoints.getValue());
_shader->setUniform("_jitterStepSizeMultiplier", _jitterStepSizeMultiplier.getValue());
_shader->setUniform("_samplingStepSize", _samplingStepSize.getValue() * .1f);
_shader->setUniform("_jitterEntryPoints", p_jitterEntryPoints.getValue());
_shader->setUniform("_jitterStepSizeMultiplier", p_jitterStepSizeMultiplier.getValue());
_shader->setUniform("_samplingStepSize", p_samplingStepSize.getValue() * .1f);
const tgt::Camera& cam = _camera.getValue();
const tgt::Camera& cam = p_camera.getValue();
float n = cam.getNearDist();
float f = cam.getFarDist();
_shader->setUniform("_cameraPosition", _camera.getValue().getPosition());
_shader->setUniform("_cameraPosition", p_camera.getValue().getPosition());
_shader->setUniform("const_to_z_e_1", 0.5f + 0.5f*((f+n)/(f-n)));
_shader->setUniform("const_to_z_e_2", ((f-n)/(f*n)));
_shader->setUniform("const_to_z_w_1", ((f*n)/(f-n)));
......@@ -122,7 +122,7 @@ namespace campvis {
tgt::TextureUnit volumeUnit, entryUnit, exitUnit, tfUnit;
img->bind(_shader, volumeUnit, "_volume");
_transferFunction.getTF()->bind(_shader, tfUnit);
p_transferFunction.getTF()->bind(_shader, tfUnit);
if (! _bindEntryExitDepthTextures) {
entryPoints->bind(_shader, &entryUnit, 0, "_entryPoints");
......
......@@ -98,15 +98,15 @@ namespace campvis {
*/
virtual void process(DataContainer& data);
DataNameProperty _sourceImageID; ///< image ID for input image
DataNameProperty _entryImageID; ///< image ID for output entry points image
DataNameProperty _exitImageID; ///< image ID for output exit points image
CameraProperty _camera; ///< Camera used for ray casting
TransferFunctionProperty _transferFunction; ///< Transfer function
FloatProperty _samplingStepSize; ///< Ray casting step size
BoolProperty _jitterEntryPoints; ///< Flag whether to jitter the entry points
FloatProperty _jitterStepSizeMultiplier; ///< Step size multiplier for entry points jitter
DataNameProperty p_sourceImageID; ///< image ID for input image
DataNameProperty p_entryImageID; ///< image ID for output entry points image
DataNameProperty p_exitImageID; ///< image ID for output exit points image
CameraProperty p_camera; ///< Camera used for ray casting
TransferFunctionProperty p_transferFunction; ///< Transfer function
FloatProperty p_samplingStepSize; ///< Ray casting step size
BoolProperty p_jitterEntryPoints; ///< Flag whether to jitter the entry points
FloatProperty p_jitterStepSizeMultiplier; ///< Step size multiplier for entry points jitter
protected:
/**
......
......@@ -67,10 +67,6 @@ namespace campvis {
}
}
PropertyCollection& VisualizationPipeline::getPropertyCollection() {
return _properties;
}
void VisualizationPipeline::init() {
AbstractPipeline::init();
}
......
......@@ -90,12 +90,6 @@ namespace campvis {
*/
virtual void onEvent(tgt::Event* e);
/**
* Returns the PropertyCollection of this processor.
* \return _properties
*/
PropertyCollection& getPropertyCollection();
/**
* Sets the Canvas hosting the OpenGL context for this pipeline.
* \param canvas Canvas hosting the OpenGL context for this pipeline
......@@ -120,6 +114,12 @@ namespace campvis {
*/
const std::string& getRenderTargetID() const;
/**
* Adds the event handler \a eventHandler to this pipeline's list of event handlers.
* \param eventHandler The event handler to add.
*/
void addEventHandler(AbstractEventHandler* eventHandler);
/// Signal emitted when the pipeline's render target has changed
sigslot::signal0<> s_renderTargetChanged;
......
......@@ -45,11 +45,11 @@ namespace campvis {
MhdImageReader::MhdImageReader()
: AbstractProcessor()
, _url("url", "Image URL", "")
, _targetImageID("targetImageName", "Target Image ID", "MhdImageReader.output", DataNameProperty::WRITE)
, p_url("url", "Image URL", "")
, p_targetImageID("targetImageName", "Target Image ID", "MhdImageReader.output", DataNameProperty::WRITE)
{
addProperty(&_url);
addProperty(&_targetImageID);
addProperty(&p_url);
addProperty(&p_targetImageID);
}
MhdImageReader::~MhdImageReader() {
......@@ -59,7 +59,7 @@ namespace campvis {
void MhdImageReader::process(DataContainer& data) {
try {
// start parsing
TextFileParser tfp(_url.getValue(), true, "=");
TextFileParser tfp(p_url.getValue(), true, "=");
tfp.parse<TextFileParser::ItemSeparatorLines>();
// init optional parameters with sane default values
......@@ -124,11 +124,11 @@ namespace campvis {
// get raw image location:
url = StringUtils::trim(tfp.getString("ElementDataFile"));
if (url == "LOCAL") {
url = _url.getValue();
url = p_url.getValue();
// find beginning of local data:
tgt::File* file = FileSys.open(_url.getValue());
tgt::File* file = FileSys.open(p_url.getValue());
if (!file || !file->isOpen())
throw tgt::FileException("Could not open file " + _url.getValue() + " for reading.", _url.getValue());
throw tgt::FileException("Could not open file " + p_url.getValue() + " for reading.", p_url.getValue());
while (!file->eof()) {
std::string line = StringUtils::trim(file->getLine());
......@@ -144,15 +144,15 @@ namespace campvis {
return;
}
else {
url = tgt::FileSystem::cleanupPath(tgt::FileSystem::dirName(_url.getValue()) + "/" + url);
url = tgt::FileSystem::cleanupPath(tgt::FileSystem::dirName(p_url.getValue()) + "/" + url);
}
// all parsing done - lets create the image:
ImageDataDisk* image = new ImageDataDisk(url, dimensionality, size, pt, 1, offset, e);
data.addData(_targetImageID.getValue(), image);
_targetImageID.issueWrite();
data.addData(p_targetImageID.getValue(), image);
p_targetImageID.issueWrite();
}
catch (tgt::Exception& e) {
LERROR("Error while parsing MHD header: " << e.what());
......
......@@ -66,8 +66,8 @@ namespace campvis {
/// \see AbstractProcessor::getDescription()
virtual const std::string getDescription() const { return "Reads an MHD image into the pipeline."; };
StringProperty _url; ///< URL for file to read
DataNameProperty _targetImageID; ///< image ID for read image
StringProperty p_url; ///< URL for file to read
DataNameProperty p_targetImageID; ///< image ID for read image
protected:
......
......@@ -87,11 +87,11 @@ namespace campvis {
GradientVolumeGenerator::GradientVolumeGenerator()
: AbstractProcessor()
, _inputVolume("InputVolume", "Input Volume ID", "volume", DataNameProperty::READ)
, _outputGradients("OutputGradients", "Output Gradient Volume ID", "gradients", DataNameProperty::WRITE)
, p_inputVolume("InputVolume", "Input Volume ID", "volume", DataNameProperty::READ)
, p_outputGradients("OutputGradients", "Output Gradient Volume ID", "gradients", DataNameProperty::WRITE)
{
addProperty(&_inputVolume);
addProperty(&_outputGradients);
addProperty(&p_inputVolume);
addProperty(&p_outputGradients);
}
GradientVolumeGenerator::~GradientVolumeGenerator() {
......@@ -99,14 +99,14 @@ namespace campvis {
}
void GradientVolumeGenerator::process(DataContainer& data) {
DataContainer::ScopedTypedData<ImageDataLocal> input(data, _inputVolume.getValue());
DataContainer::ScopedTypedData<ImageDataLocal> input(data, p_inputVolume.getValue());
if (input != 0) {
GenericImageDataLocal<float, 4>* output = new GenericImageDataLocal<float, 4>(input->getDimensionality(), input->getSize(), 0);
tbb::parallel_for(tbb::blocked_range<size_t>(0, input->getNumElements()), ApplyCentralDifferences(input, output));
data.addData(_outputGradients.getValue(), output);
_outputGradients.issueWrite();
data.addData(p_outputGradients.getValue(), output);
p_outputGradients.issueWrite();
}
else {
LDEBUG("No suitable input image found.");
......
......@@ -62,8 +62,8 @@ namespace campvis {
virtual void process(DataContainer& data);
DataNameProperty _inputVolume; ///< ID for input volume
DataNameProperty _outputGradients; //< ID for output gradient volume
DataNameProperty p_inputVolume; ///< ID for input volume
DataNameProperty p_outputGradients; //< ID for output gradient volume
protected:
......
......@@ -142,15 +142,15 @@ namespace campvis {
LHHistogram::LHHistogram()
: AbstractProcessor()
, _inputVolume("InputVolume", "Input Volume ID", "volume", DataNameProperty::READ)
, _inputGradients("InputGradients", "Input Gradient Volume ID", "gradients", DataNameProperty::READ)
, _outputFL("OutputFL", "FL Output Volume", "fl", DataNameProperty::WRITE)
, _outputFH("OutputFH", "FH Output Volume", "fh", DataNameProperty::WRITE)
, p_inputVolume("InputVolume", "Input Volume ID", "volume", DataNameProperty::READ)
, p_inputGradients("InputGradients", "Input Gradient Volume ID", "gradients", DataNameProperty::READ)
, p_outputFL("OutputFL", "FL Output Volume", "fl", DataNameProperty::WRITE)
, p_outputFH("OutputFH", "FH Output Volume", "fh", DataNameProperty::WRITE)
{
addProperty(&_inputVolume);
addProperty(&_inputGradients);
addProperty(&_outputFL);
addProperty(&_outputFH);
addProperty(&p_inputVolume);
addProperty(&p_inputGradients);
addProperty(&p_outputFL);
addProperty(&p_outputFH);
}
LHHistogram::~LHHistogram() {
......@@ -158,8 +158,8 @@ namespace campvis {
}
void LHHistogram::process(DataContainer& data) {
DataContainer::ScopedTypedData<ImageDataLocal> intensities(data, _inputVolume.getValue());
DataContainer::ScopedTypedData< GenericImageDataLocal<float, 4> > gradients(data, _inputGradients.getValue());
DataContainer::ScopedTypedData<ImageDataLocal> intensities(data, p_inputVolume.getValue());
DataContainer::ScopedTypedData< GenericImageDataLocal<float, 4> > gradients(data, p_inputGradients.getValue());
if (intensities != 0 && gradients != 0) {
ImageDataLocal* fl = intensities->clone();
......@@ -182,10 +182,10 @@ namespace campvis {
delete [] tmp;
data.addData("foo", tex);
data.addData(_outputFH.getValue(), fh);
data.addData(_outputFL.getValue(), fl);
_outputFH.issueWrite();
_outputFL.issueWrite();
data.addData(p_outputFH.getValue(), fh);
data.addData(p_outputFL.getValue(), fl);
p_outputFH.issueWrite();
p_outputFL.issueWrite();
}
else {
LDEBUG("No suitable intensities image found.");
......
......@@ -62,11 +62,11 @@ namespace campvis {
virtual void process(DataContainer& data);
DataNameProperty _inputVolume; ///< ID for input volume
DataNameProperty _inputGradients; ///< ID for input gradient volume
DataNameProperty p_inputVolume; ///< ID for input volume
DataNameProperty p_inputGradients; ///< ID for input gradient volume
DataNameProperty _outputFL; ///< ID for output FL volume
DataNameProperty _outputFH; ///< ID for output FH volume
DataNameProperty p_outputFL; ///< ID for output FL volume
DataNameProperty p_outputFH; ///< ID for output FH volume
protected:
......
......@@ -58,16 +58,16 @@ namespace campvis {
_trackballEH = new TrackballNavigationEventHandler(&_camera, _renderTargetSize.getValue());
_eventHandlers.push_back(_trackballEH);
_processors.push_back(&_imageReader);
_processors.push_back(&_pgGenerator);
_processors.push_back(&_vmgGenerator);
_processors.push_back(&_vmRenderer);
_processors.push_back(&_eepGenerator);
_processors.push_back(&_vmEepGenerator);
_processors.push_back(&_dvrNormal);
_processors.push_back(&_dvrVM);
_processors.push_back(&_depthDarkening);
_processors.push_back(&_combine);
addProcessor(&_imageReader);
addProcessor(&_pgGenerator);
addProcessor(&_vmgGenerator);
addProcessor(&_vmRenderer);
addProcessor(&_eepGenerator);
addProcessor(&_vmEepGenerator);
addProcessor(&_dvrNormal);
addProcessor(&_dvrVM);
addProcessor(&_depthDarkening);
addProcessor(&_combine);
}
DVRVis::~DVRVis() {
......@@ -77,67 +77,67 @@ namespace campvis {
void DVRVis::init() {
VisualizationPipeline::init();
_camera.addSharedProperty(&_vmgGenerator._camera);
_camera.addSharedProperty(&_vmRenderer._camera);
_camera.addSharedProperty(&_eepGenerator._camera);
_camera.addSharedProperty(&_vmEepGenerator._camera);
_camera.addSharedProperty(&_dvrNormal._camera);
_camera.addSharedProperty(&_dvrVM._camera);
_camera.addSharedProperty(&_vmgGenerator.p_camera);
_camera.addSharedProperty(&_vmRenderer.p_camera);
_camera.addSharedProperty(&_eepGenerator.p_camera);
_camera.addSharedProperty(&_vmEepGenerator.p_camera);
_camera.addSharedProperty(&_dvrNormal.p_camera);
_camera.addSharedProperty(&_dvrVM.p_camera);
//_imageReader._url.setValue("D:\\Medical Data\\Dentalscan\\dental.mhd");
_imageReader._url.setValue("D:\\Medical Data\\smallHeart.mhd");
_imageReader._targetImageID.setValue("reader.output");
//_imageReader.p_url.setValue("D:\\Medical Data\\Dentalscan\\dental.mhd");
_imageReader.p_url.setValue("D:\\Medical Data\\smallHeart.mhd");
_imageReader.p_targetImageID.setValue("reader.output");
_dvrNormal._targetImageID.setValue("drr.output");
_dvrNormal._sourceImageID.setValue("eep.input");
_dvrNormal.p_targetImageID.setValue("drr.output");
_dvrNormal.p_sourceImageID.setValue("eep.input");
Geometry1DTransferFunction* dvrTF = new Geometry1DTransferFunction(128, tgt::vec2(0.f, .05f));
dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.4f, .42f), tgt::col4(255, 0, 0, 255), tgt::col4(255, 0, 0, 255)));
dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.45f, .5f), tgt::col4(0, 255, 0, 255), tgt::col4(0, 255, 0, 255)));
_dvrNormal._transferFunction.replaceTF(dvrTF);
_dvrNormal.p_transferFunction.replaceTF(dvrTF);
Geometry1DTransferFunction* vmTF = new Geometry1DTransferFunction(128, tgt::vec2(0.f, .05f));
vmTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.4f, .42f), tgt::col4(255, 0, 0, 255), tgt::col4(255, 0, 0, 255)));
vmTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.45f, .5f), tgt::col4(0, 255, 0, 255), tgt::col4(0, 255, 0, 255)));
_dvrVM._transferFunction.replaceTF(vmTF);
_dvrVM.p_transferFunction.replaceTF(vmTF);
_dvrVM._targetImageID.setValue("dvr.output");
_dvrVM._sourceImageID.setValue("eep.input");
_dvrVM.p_targetImageID.setValue("dvr.output");
_dvrVM.p_sourceImageID.setValue("eep.input");
_eepGenerator._sourceImageID.setValue("eep.input");
_vmEepGenerator._sourceImageID.setValue("eep.input");
_pgGenerator._sourceImageID.setValue("eep.input");
_eepGenerator.p_sourceImageID.setValue("eep.input");
_vmEepGenerator.p_sourceImageID.setValue("eep.input");
_pgGenerator.p_sourceImageID.setValue("eep.input");
_vmRenderer._renderTargetID.connect(&_combine._mirrorRenderID);
_vmEepGenerator._entryImageID.setValue("vm.eep.entry");
_vmEepGenerator._exitImageID.setValue("vm.eep.exit");
_vmEepGenerator._enableMirror.setValue(true);
_vmRenderer.p_renderTargetID.connect(&_combine.p_mirrorRenderID);
_vmEepGenerator.p_entryImageID.setValue("vm.eep.entry");
_vmEepGenerator.p_exitImageID.setValue("vm.eep.exit");
_vmEepGenerator.p_enableMirror.setValue(true);
// not the most beautiful way... *g*
// this will all get better with scripting support.
static_cast<BoolProperty*>(_vmEepGenerator.getProperty("applyMask"))->setValue(true);
_vmRenderer._renderTargetID.connect(static_cast<DataNameProperty*>(_vmEepGenerator.getProperty("maskID")));
_vmRenderer.p_renderTargetID.connect(static_cast<DataNameProperty*>(_vmEepGenerator.getProperty("maskID")));
_renderTargetID.setValue("combine");
_pgGenerator._geometryID.connect(&_vmEepGenerator._geometryID);
_vmgGenerator._mirrorID.connect(&_vmEepGenerator._mirrorID);
_vmgGenerator._mirrorID.connect(&_vmRenderer._geometryID);
_vmgGenerator._mirrorCenter.setValue(tgt::vec3(0.f, 0.f, -20.f));
_vmgGenerator._poi.setValue(tgt::vec3(40.f, 40.f, 40.f));
_vmgGenerator._size.setValue(60.f);
_pgGenerator.p_geometryID.connect(&_vmEepGenerator.p_geometryID);
_vmgGenerator.p_mirrorID.connect(&_vmEepGenerator.p_mirrorID);
_vmgGenerator.p_mirrorID.connect(&_vmRenderer.p_geometryID);
_vmgGenerator.p_mirrorCenter.setValue(tgt::vec3(0.f, 0.f, -20.f));
_vmgGenerator.p_poi.setValue(tgt::vec3(40.f, 40.f, 40.f));
_vmgGenerator.p_size.setValue(60.f);
_eepGenerator._entryImageID.connect(&_dvrNormal._entryImageID);
_vmEepGenerator._entryImageID.connect(&_dvrVM._entryImageID);
_eepGenerator.p_entryImageID.connect(&_dvrNormal.p_entryImageID);
_vmEepGenerator.p_entryImageID.connect(&_dvrVM.p_entryImageID);
_eepGenerator._exitImageID.connect(&_dvrNormal._exitImageID);
_vmEepGenerator._exitImageID.connect(&_dvrVM._exitImageID);
_eepGenerator.p_exitImageID.connect(&_dvrNormal.p_exitImageID);
_vmEepGenerator.p_exitImageID.connect(&_dvrVM.p_exitImageID);
_dvrVM._targetImageID.connect(&_combine._mirrorImageID);
_combine._targetImageID.setValue("combine");
_dvrVM.p_targetImageID.connect(&_combine.p_mirrorImageID);
_combine.p_targetImageID.setValue("combine");
_dvrNormal._targetImageID.connect(&_depthDarkening._inputImage);
_depthDarkening._outputImage.connect(&_combine._normalImageID);
_dvrNormal.p_targetImageID.connect(&_depthDarkening.p_inputImage);
_depthDarkening.p_outputImage.connect(&_combine.p_normalImageID);
_imageReader.s_invalidated.connect<DVRVis>(this, &DVRVis::onProcessorInvalidated);
_vmgGenerator.s_invalidated.connect<DVRVis>(this, &DVRVis::onProcessorInvalidated);
......@@ -169,7 +169,7 @@ namespace campvis {
ImageDataLocal* local = ImageDataConverter::tryConvert<ImageDataLocal>(img);
if (local != 0) {
DataHandle dh = _data.addData("clr.input", local);
_dvrNormal._transferFunction.getTF()->setImageHandle(dh);
_dvrNormal.p_transferFunction.getTF()->setImageHandle(dh);
}
{
tgt::GLContextScopedLock lock(_canvas->getContext());
......
......@@ -40,13 +40,13 @@ namespace campvis {
, _gvg()
, _lhh()
, _sliceExtractor(_renderTargetSize)
, _wheelHandler(&_sliceExtractor._sliceNumber)
, _wheelHandler(&_sliceExtractor.p_sliceNumber)
{
_processors.push_back(&_imageReader);
// _processors.push_back(&_gvg);
// _processors.push_back(&_lhh);
_processors.push_back(&_sliceExtractor);
_eventHandlers.push_back(&_wheelHandler);
addProcessor(&_imageReader);
// addProcessor(&_gvg);
// addProcessor(&_lhh);
addProcessor(&_sliceExtractor);
addEventHandler(&_wheelHandler);
}
SliceVis::~SliceVis() {
......@@ -55,21 +55,21 @@ namespace campvis {
void SliceVis::init() {
VisualizationPipeline::init();
_imageReader._url.setValue("D:\\Medical Data\\Dentalscan\\dental.mhd");
_imageReader._targetImageID.setValue("reader.output");
_imageReader.p_url.setValue("D:\\Medical Data\\Dentalscan\\dental.mhd");
_imageReader.p_targetImageID.setValue("reader.output");
_gvg._inputVolume.setValue("se.input");
_gvg.p_inputVolume.setValue("se.input");
// _lhh._inputVolume.setValue("se.input");
// _lhh.p_inputVolume.setValue("se.input");
// _gvg._outputGradients.connect(&_lhh._inputGradients);
_sliceExtractor._sourceImageID.setValue("se.input");
_sliceExtractor._sliceNumber.setValue(0);
_sliceExtractor.p_sourceImageID.setValue("se.input");
_sliceExtractor.p_sliceNumber.setValue(0);
// TODO: replace this hardcoded domain by automatically determined from image min/max values
_sliceExtractor._transferFunction.getTF()->setIntensityDomain(tgt::vec2(0, 0.05f));
_sliceExtractor.p_transferFunction.getTF()->setIntensityDomain(tgt::vec2(0, 0.05f));
_renderTargetID.setValue("renderTarget");
_renderTargetID.addSharedProperty(&(_sliceExtractor._targetImageID));
_renderTargetID.addSharedProperty(&(_sliceExtractor.p_targetImageID));
_imageReader.s_invalidated.connect<SliceVis>(this, &SliceVis::onProcessorInvalidated);
_gvg.s_invalidated.connect<SliceVis>(this, &SliceVis::onProcessorInvalidated);
......@@ -107,10 +107,10 @@ namespace campvis {
if (e->pressed()) {
switch (e->keyCode()) {
case tgt::KeyEvent::K_UP:
_sliceExtractor._sliceNumber.increment();
_sliceExtractor.p_sliceNumber.increment();
break;