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

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

* Added raycaster profiling capability to VolumeRenderer processor

* Added GCC pragma to ignore false-positive warning in ItkWatershedFilter
parent b9c6c3c5
...@@ -157,6 +157,8 @@ namespace campvis { ...@@ -157,6 +157,8 @@ namespace campvis {
if (input != 0 && input->getParent()->getNumChannels() == 1) { if (input != 0 && input->getParent()->getNumChannels() == 1) {
ImageData* id = new ImageData(input->getDimensionality(), input->getSize(), 1); ImageData* id = new ImageData(input->getDimensionality(), input->getSize(), 1);
// disable known false-positive warning in ITK code when using GCC:
#pragma GCC diagnostic ignored "-Warray-bounds"
DISPATCH_ITK_FILTER(input, \ DISPATCH_ITK_FILTER(input, \
filter->SetLevel(p_level.getValue()); \ filter->SetLevel(p_level.getValue()); \
filter->SetThreshold(p_threshold.getValue()); \ filter->SetThreshold(p_threshold.getValue()); \
......
...@@ -40,6 +40,8 @@ namespace campvis { ...@@ -40,6 +40,8 @@ namespace campvis {
, p_inputVolume("InputVolume", "Input Volume", "", DataNameProperty::READ, AbstractProcessor::VALID) , p_inputVolume("InputVolume", "Input Volume", "", DataNameProperty::READ, AbstractProcessor::VALID)
, p_camera("Camera", "Camera", tgt::Camera(), AbstractProcessor::VALID) , p_camera("Camera", "Camera", tgt::Camera(), AbstractProcessor::VALID)
, p_outputImage("OutputImage", "Output Image", "vr.output", DataNameProperty::WRITE, AbstractProcessor::VALID) , p_outputImage("OutputImage", "Output Image", "vr.output", DataNameProperty::WRITE, AbstractProcessor::VALID)
, p_profileRaycaster("ProfileRaycaster", "Profile Raycaster's Execution Time", false)
, _timerQueryRaycaster(0)
, p_pgProps("PGGProps", "Proxy Geometry Generator", AbstractProcessor::VALID) , p_pgProps("PGGProps", "Proxy Geometry Generator", AbstractProcessor::VALID)
, p_eepProps("EEPProps", "Entry/Exit Points Generator", AbstractProcessor::VALID) , p_eepProps("EEPProps", "Entry/Exit Points Generator", AbstractProcessor::VALID)
, p_raycasterProps("RaycasterProps", "Raycaster", AbstractProcessor::VALID) , p_raycasterProps("RaycasterProps", "Raycaster", AbstractProcessor::VALID)
...@@ -52,6 +54,7 @@ namespace campvis { ...@@ -52,6 +54,7 @@ namespace campvis {
addProperty(&p_inputVolume); addProperty(&p_inputVolume);
addProperty(&_raycaster->p_transferFunction); addProperty(&_raycaster->p_transferFunction);
addProperty(&p_outputImage); addProperty(&p_outputImage);
addProperty(&p_profileRaycaster);
p_pgProps.addPropertyCollection(_pgGenerator); p_pgProps.addPropertyCollection(_pgGenerator);
_pgGenerator.p_sourceImageID.setVisible(false); _pgGenerator.p_sourceImageID.setVisible(false);
...@@ -104,9 +107,13 @@ namespace campvis { ...@@ -104,9 +107,13 @@ namespace campvis {
_pgGenerator.s_invalidated.connect(this, &VolumeRenderer::onProcessorInvalidated); _pgGenerator.s_invalidated.connect(this, &VolumeRenderer::onProcessorInvalidated);
_eepGenerator.s_invalidated.connect(this, &VolumeRenderer::onProcessorInvalidated); _eepGenerator.s_invalidated.connect(this, &VolumeRenderer::onProcessorInvalidated);
_raycaster->s_invalidated.connect(this, &VolumeRenderer::onProcessorInvalidated); _raycaster->s_invalidated.connect(this, &VolumeRenderer::onProcessorInvalidated);
glGenQueries(1, &_timerQueryRaycaster);
} }
void VolumeRenderer::deinit() { void VolumeRenderer::deinit() {
glDeleteQueries(1, &_timerQueryRaycaster);
_pgGenerator.s_invalidated.disconnect(this); _pgGenerator.s_invalidated.disconnect(this);
_eepGenerator.s_invalidated.disconnect(this); _eepGenerator.s_invalidated.disconnect(this);
_raycaster->s_invalidated.disconnect(this); _raycaster->s_invalidated.disconnect(this);
...@@ -126,7 +133,18 @@ namespace campvis { ...@@ -126,7 +133,18 @@ namespace campvis {
_eepGenerator.process(data); _eepGenerator.process(data);
} }
if (getInvalidationLevel() & RAYCASTER_INVALID) { if (getInvalidationLevel() & RAYCASTER_INVALID) {
_raycaster->process(data); if (p_profileRaycaster.getValue()) {
glBeginQuery(GL_TIME_ELAPSED, _timerQueryRaycaster);
_raycaster->process(data);
glEndQuery(GL_TIME_ELAPSED);
GLuint64 timer_result;
glGetQueryObjectui64v(_timerQueryRaycaster, GL_QUERY_RESULT, &timer_result);
LINFO("Raycaster Execution time: " << static_cast<double>(timer_result) / 1e06 << "ms.");
}
else {
_raycaster->process(data);
}
} }
validate(INVALID_RESULT | PG_INVALID | EEP_INVALID | RAYCASTER_INVALID); validate(INVALID_RESULT | PG_INVALID | EEP_INVALID | RAYCASTER_INVALID);
...@@ -171,5 +189,8 @@ namespace campvis { ...@@ -171,5 +189,8 @@ namespace campvis {
// nothing to do here // nothing to do here
} }
RaycastingProcessor* VolumeRenderer::getRaycastingProcessor() {
return _raycaster;
}
} }
...@@ -84,9 +84,18 @@ namespace campvis { ...@@ -84,9 +84,18 @@ namespace campvis {
/// \see VisualizationPipeline::setViewportSizeProperty() /// \see VisualizationPipeline::setViewportSizeProperty()
virtual void setViewportSizeProperty(IVec2Property* viewportSizeProp); virtual void setViewportSizeProperty(IVec2Property* viewportSizeProp);
DataNameProperty p_inputVolume; ///< image ID for first input image /**
CameraProperty p_camera; * Returns the used RaycastingProcessor.
DataNameProperty p_outputImage; ///< image ID for output image * \return _raycaster
*/
RaycastingProcessor* getRaycastingProcessor();
DataNameProperty p_inputVolume; ///< image ID for first input image
CameraProperty p_camera; ///< Camera
DataNameProperty p_outputImage; ///< image ID for output image
BoolProperty p_profileRaycaster; ///< Flag whether the raycaster's execution time shall be profiled
GLuint _timerQueryRaycaster; ///< OpenGL timer query for raycaster
MetaProperty p_pgProps; ///< MetaProperty for properties of the ProxyGeometryGenerator processor MetaProperty p_pgProps; ///< MetaProperty for properties of the ProxyGeometryGenerator processor
MetaProperty p_eepProps; ///< MetaProperty for properties of the EEPGenerator processor MetaProperty p_eepProps; ///< MetaProperty for properties of the EEPGenerator processor
......
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