Starting from 2021-07-01, all LRZ GitLab users will be required to explicitly accept the GitLab Terms of Service. Please see the detailed information at https://doku.lrz.de/display/PUBLIC/GitLab and make sure that your projects conform to the requirements.

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

Further clean up and fixes in registration module

parent 11eb6032
...@@ -61,7 +61,6 @@ namespace campvis { ...@@ -61,7 +61,6 @@ namespace campvis {
void VisualizationProcessor::deinit() { void VisualizationProcessor::deinit() {
_viewportSizeProperty->s_changed.disconnect(this); _viewportSizeProperty->s_changed.disconnect(this);
_fbo->detachAll();
delete _fbo; delete _fbo;
AbstractProcessor::deinit(); AbstractProcessor::deinit();
} }
......
...@@ -71,6 +71,7 @@ void FramebufferObject::attachTexture(Texture* texture, GLenum attachment, int m ...@@ -71,6 +71,7 @@ void FramebufferObject::attachTexture(Texture* texture, GLenum attachment, int m
glFramebufferTexture2D( GL_FRAMEBUFFER, attachment, texture->getType(), texture->getId(), mipLevel ); glFramebufferTexture2D( GL_FRAMEBUFFER, attachment, texture->getType(), texture->getId(), mipLevel );
break; break;
} }
LGL_ERROR;
size_t index = decodeAttachment(attachment); size_t index = decodeAttachment(attachment);
attachments_[index] = texture; attachments_[index] = texture;
...@@ -100,6 +101,7 @@ void FramebufferObject::detachTexture(GLenum attachment) { ...@@ -100,6 +101,7 @@ void FramebufferObject::detachTexture(GLenum attachment) {
break; break;
} }
attachments_[index] = 0; attachments_[index] = 0;
LGL_ERROR;
if (index < TGT_FRAMEBUFFEROBJECT_MAX_SUPPORTED_COLOR_ATTACHMENTS) if (index < TGT_FRAMEBUFFEROBJECT_MAX_SUPPORTED_COLOR_ATTACHMENTS)
--numColorAttachments_; --numColorAttachments_;
......
...@@ -206,7 +206,6 @@ int Texture::calcBpp(GLint internalformat) { ...@@ -206,7 +206,6 @@ int Texture::calcBpp(GLint internalformat) {
case GL_RGB10: case GL_RGB10:
case GL_R11F_G11F_B10F: case GL_R11F_G11F_B10F:
case GL_RGB9_E5: case GL_RGB9_E5:
case GL_R32F:
case GL_RGBA: case GL_RGBA:
case GL_RGBA8: case GL_RGBA8:
case GL_RGBA8_SNORM: case GL_RGBA8_SNORM:
......
...@@ -59,11 +59,11 @@ void main() { ...@@ -59,11 +59,11 @@ void main() {
vec4 movingLookupTexCoord = _registrationInverse * vec4(referenceLookupTexCoord, 1.0); vec4 movingLookupTexCoord = _registrationInverse * vec4(referenceLookupTexCoord, 1.0);
// fetch texels // fetch texels
float referenceValue = texture(_referenceTexture, referenceLookupTexCoord).a; float referenceValue = texture(_referenceTexture, referenceLookupTexCoord).r;
float movingValue = 0.0; float movingValue = 0.0;
if (!_applyMask || referenceValue > 0.0) if (!_applyMask || referenceValue > 0.0)
movingValue = texture(_movingTexture, movingLookupTexCoord.xyz).a; movingValue = texture(_movingTexture, movingLookupTexCoord.xyz).r;
// compute differences // compute differences
difference = referenceValue - movingValue; difference = referenceValue - movingValue;
......
...@@ -64,7 +64,7 @@ void main() { ...@@ -64,7 +64,7 @@ void main() {
for (float z = zStart; z < zEnd; z += _referenceTextureParams._sizeRCP.z) { for (float z = zStart; z < zEnd; z += _referenceTextureParams._sizeRCP.z) {
// fetch value from reference volume // fetch value from reference volume
vec3 referenceLookupTexCoord = vec3(ex_TexCoord.xy, z); vec3 referenceLookupTexCoord = vec3(ex_TexCoord.xy, z);
float referenceValue = texture(_referenceTexture, referenceLookupTexCoord).a; float referenceValue = texture(_referenceTexture, referenceLookupTexCoord).r;
// apply mask if requested // apply mask if requested
if (!_applyMask || referenceValue > 0.0) { if (!_applyMask || referenceValue > 0.0) {
...@@ -75,7 +75,7 @@ void main() { ...@@ -75,7 +75,7 @@ void main() {
// fetch value from moving volume // fetch value from moving volume
float movingValue = 0.0; float movingValue = 0.0;
if (all(greaterThanEqual(movingLookupTexCoord.xyz, vec3(0.0))) && all(lessThanEqual(movingLookupTexCoord.xyz, vec3(1.0)))) { if (all(greaterThanEqual(movingLookupTexCoord.xyz, vec3(0.0))) && all(lessThanEqual(movingLookupTexCoord.xyz, vec3(1.0)))) {
movingValue = texture(_movingTexture, movingLookupTexCoord.xyz).a; movingValue = texture(_movingTexture, movingLookupTexCoord.xyz).r;
} }
float avg = (referenceValue + movingValue) / 2.0; float avg = (referenceValue + movingValue) / 2.0;
......
...@@ -58,7 +58,7 @@ void main() { ...@@ -58,7 +58,7 @@ void main() {
for (float z = zStart; z < zEnd; z += _referenceTextureParams._sizeRCP.z) { for (float z = zStart; z < zEnd; z += _referenceTextureParams._sizeRCP.z) {
// fetch value from reference volume // fetch value from reference volume
vec3 referenceLookupTexCoord = vec3(ex_TexCoord.xy, z); vec3 referenceLookupTexCoord = vec3(ex_TexCoord.xy, z);
float referenceValue = texture(_referenceTexture, referenceLookupTexCoord).a; float referenceValue = texture(_referenceTexture, referenceLookupTexCoord).r;
// apply mask if requested // apply mask if requested
if (!_applyMask || referenceValue > 0.0) { if (!_applyMask || referenceValue > 0.0) {
...@@ -69,7 +69,7 @@ void main() { ...@@ -69,7 +69,7 @@ void main() {
// fetch value from moving volume // fetch value from moving volume
float movingValue = 0.0; float movingValue = 0.0;
if (all(greaterThanEqual(movingLookupTexCoord.xyz, vec3(0.0))) && all(lessThanEqual(movingLookupTexCoord.xyz, vec3(1.0)))) { if (all(greaterThanEqual(movingLookupTexCoord.xyz, vec3(0.0))) && all(lessThanEqual(movingLookupTexCoord.xyz, vec3(1.0)))) {
movingValue = texture(_movingTexture, movingLookupTexCoord.xyz).a; movingValue = texture(_movingTexture, movingLookupTexCoord.xyz).r;
} }
// compute difference metrics // compute difference metrics
......
...@@ -45,13 +45,11 @@ namespace campvis { ...@@ -45,13 +45,11 @@ namespace campvis {
, _movingReader() , _movingReader()
, _sm() , _sm()
, _ve(&_canvasSize) , _ve(&_canvasSize)
, _se(&_canvasSize)
{ {
addProcessor(&_referenceReader); addProcessor(&_referenceReader);
addProcessor(&_movingReader); addProcessor(&_movingReader);
addProcessor(&_sm); addProcessor(&_sm);
addProcessor(&_ve); addProcessor(&_ve);
addProcessor(&_se);
addEventListenerToBack(&_ve); addEventListenerToBack(&_ve);
} }
...@@ -71,23 +69,15 @@ namespace campvis { ...@@ -71,23 +69,15 @@ namespace campvis {
_movingReader.p_targetImageID.addSharedProperty(&_sm.p_movingId); _movingReader.p_targetImageID.addSharedProperty(&_sm.p_movingId);
_sm.p_differenceImageId.addSharedProperty(&_ve.p_inputVolume); _sm.p_differenceImageId.addSharedProperty(&_ve.p_inputVolume);
_sm.p_differenceImageId.addSharedProperty(&_se.p_sourceImageID);
_ve.p_outputImage.setValue("volumeexplorer"); _ve.p_outputImage.setValue("volumeexplorer");
_se.p_targetImageID.setValue("sliceexplorer"); _renderTargetID.setValue("volumeexplorer");
_renderTargetID.setValue("sliceexplorer");
Geometry1DTransferFunction* dvrTF = new Geometry1DTransferFunction(128, tgt::vec2(-1.f, 1.f)); Geometry1DTransferFunction* dvrTF = new Geometry1DTransferFunction(128, tgt::vec2(-1.f, 1.f));
dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(0.f, .5f), tgt::col4(0, 0, 255, 255), tgt::col4(255, 255, 255, 0))); dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(0.f, .5f), tgt::col4(0, 0, 255, 255), tgt::col4(255, 255, 255, 0)));
dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.5f, 1.f), tgt::col4(255, 255, 255, 0), tgt::col4(255, 0, 0, 255))); dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.5f, 1.f), tgt::col4(255, 255, 255, 0), tgt::col4(255, 0, 0, 255)));
MetaProperty* mp = static_cast<MetaProperty*>(_ve.getProperty("SliceExtractorProperties")); MetaProperty* mp = static_cast<MetaProperty*>(_ve.getProperty("SliceExtractorProperties"));
static_cast<TransferFunctionProperty*>(mp->getProperty("transferFunction"))->replaceTF(dvrTF); static_cast<TransferFunctionProperty*>(mp->getProperty("transferFunction"))->replaceTF(dvrTF);
Geometry1DTransferFunction* seTF = new Geometry1DTransferFunction(128, tgt::vec2(-1.f, 1.f));
seTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(0.f, .5f), tgt::col4(0, 0, 255, 255), tgt::col4(255, 255, 255, 255)));
seTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.5f, 1.f), tgt::col4(255, 255, 255, 255), tgt::col4(255, 0, 0, 255)));
_se.p_transferFunction.replaceTF(seTF);
} }
void ReducerTest::onProcessorValidated(AbstractProcessor* processor) { void ReducerTest::onProcessorValidated(AbstractProcessor* processor) {
......
...@@ -75,7 +75,6 @@ namespace campvis { ...@@ -75,7 +75,6 @@ namespace campvis {
SimilarityMeasure _sm; SimilarityMeasure _sm;
VolumeExplorer _ve; VolumeExplorer _ve;
SliceExtractor _se;
}; };
......
...@@ -405,7 +405,7 @@ namespace campvis { ...@@ -405,7 +405,7 @@ namespace campvis {
referenceUnit.activate(); referenceUnit.activate();
// create temporary texture for result // create temporary texture for result
tgt::Texture* similarityTex = new tgt::Texture(0, tgt::ivec3(size), GL_ALPHA, GL_ALPHA32F_ARB, GL_FLOAT, tgt::Texture::NEAREST); tgt::Texture* similarityTex = new tgt::Texture(0, tgt::ivec3(size), GL_RED, GL_R32F, GL_FLOAT, tgt::Texture::NEAREST);
similarityTex->uploadTexture(); similarityTex->uploadTexture();
similarityTex->setWrapping(tgt::Texture::CLAMP); similarityTex->setWrapping(tgt::Texture::CLAMP);
......
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