Commit 622bc116 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

* Introducing VolumeExplorer::getVolumeRenderer() and VolumeExplorer::getSliceRenderer().

* Replaced two assertions in PointPredicateHistogramProperty with ifs and LERRORs.
* Minor adjustments in IvusTcDemo.
parent 4cab6cbe
...@@ -146,7 +146,10 @@ namespace campvis { ...@@ -146,7 +146,10 @@ namespace campvis {
do { do {
// set each underflowed value to 0 and adjust the other importances by an according fraction. // set each underflowed value to 0 and adjust the other importances by an according fraction.
std::for_each(underflowIndices.begin(), underflowIndices.end(), [&] (int underflowIndex) { std::for_each(underflowIndices.begin(), underflowIndices.end(), [&] (int underflowIndex) {
tgtAssert(! adjustableIndices.empty(), "The vector of adjustable indices is empty, but we need at least one. This should not happen!"); if (adjustableIndices.empty()) {
LERROR("The vector of adjustable indices is empty, but we need at least one. This should not happen!");
return;
}
float delta = newImportances[underflowIndex] / adjustableIndices.size(); float delta = newImportances[underflowIndex] / adjustableIndices.size();
std::for_each(adjustableIndices.begin(), adjustableIndices.end(), [&] (int index) { std::for_each(adjustableIndices.begin(), adjustableIndices.end(), [&] (int index) {
...@@ -178,7 +181,10 @@ namespace campvis { ...@@ -178,7 +181,10 @@ namespace campvis {
predicates[i]->p_importance.setValue(newImportances[i]); predicates[i]->p_importance.setValue(newImportances[i]);
sum += newImportances[i]; sum += newImportances[i];
} }
tgtAssert(std::abs(sum - 1.f) < 0.0001f, "Sum of importances is not 1 - sth. went wrong!");
if (std::abs(sum - 1.f) > 0.001f)
LERROR("Sum of importances is not 1 - sth. went wrong!");
--_ignoreSignals; --_ignoreSignals;
s_changed.emitSignal(this); s_changed.emitSignal(this);
......
...@@ -68,9 +68,12 @@ namespace campvis { ...@@ -68,9 +68,12 @@ namespace campvis {
_ve.p_inputVolume.setValue("image.ivus"); _ve.p_inputVolume.setValue("image.ivus");
_ve.p_outputImage.setValue("combine"); _ve.p_outputImage.setValue("combine");
_ve.getVolumeRenderer()->getRaycastingProcessor()->p_samplingRate.setValue(1.f);
_renderTargetID.setValue("combine"); _renderTargetID.setValue("combine");
_imageReader.p_fileExtension.setValue("bmp"); _imageReader.p_fileExtension.setValue("bmp");
_imageReader.p_imageSpacing.setValue(tgt::vec3(.1f, .1f, .75f));
// initialize predicates with default config // initialize predicates with default config
PointPredicateHistogramProperty* php = &p_predicateHistogram; PointPredicateHistogramProperty* php = &p_predicateHistogram;
...@@ -79,10 +82,10 @@ namespace campvis { ...@@ -79,10 +82,10 @@ namespace campvis {
AbstractPointPredicate* vpToAdd = 0; AbstractPointPredicate* vpToAdd = 0;
vpToAdd = new RangePointPredicate("cm", "ConfidenceMap", "Confidence"); // vpToAdd = new RangePointPredicate("cm", "ConfidenceMap", "Confidence");
static_cast<RangePointPredicate*>(vpToAdd)->p_range.setValue(tgt::vec2(0.25f, 1.f)); // static_cast<RangePointPredicate*>(vpToAdd)->p_range.setValue(tgt::vec2(0.25f, 1.f));
histogram->addPredicate(vpToAdd); // histogram->addPredicate(vpToAdd);
//
vpToAdd = new RangePointPredicate("tc.r", "Calcified", "Calcified Tissue"); vpToAdd = new RangePointPredicate("tc.r", "Calcified", "Calcified Tissue");
static_cast<RangePointPredicate*>(vpToAdd)->p_range.setValue(tgt::vec2(0.15f, 1.f)); static_cast<RangePointPredicate*>(vpToAdd)->p_range.setValue(tgt::vec2(0.15f, 1.f));
vpToAdd->p_color.setValue(tgt::vec2(0.f, 1.f)); vpToAdd->p_color.setValue(tgt::vec2(0.f, 1.f));
......
...@@ -466,4 +466,12 @@ namespace campvis { ...@@ -466,4 +466,12 @@ namespace campvis {
} }
} }
VolumeRenderer* VolumeExplorer::getVolumeRenderer() {
return &_raycaster;
}
SliceRenderProcessor* VolumeExplorer::getSliceRenderer() {
return _sliceRenderer;
}
} }
...@@ -91,6 +91,18 @@ namespace campvis { ...@@ -91,6 +91,18 @@ namespace campvis {
/// \see tgt::EventListener::onEvent() /// \see tgt::EventListener::onEvent()
virtual void onEvent(tgt::Event* e); virtual void onEvent(tgt::Event* e);
/**
* Returns the VolumeRenderer processor.
* \return &_raycaster
*/
VolumeRenderer* getVolumeRenderer();
/**
* Returns the SliceRenderProcessor.
* \return _sliceRenderer
*/
SliceRenderProcessor* getSliceRenderer();
DataNameProperty p_inputVolume; ///< image ID for first input image DataNameProperty p_inputVolume; ///< image ID for first input image
DataNameProperty p_outputImage; ///< image ID for output image DataNameProperty p_outputImage; ///< image ID for output image
......
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