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 24f269a7 authored by Declara Denis's avatar Declara Denis Committed by Christian Schulte zu Berge
Browse files

AdvancedUsFusion now supports rendering to texture

The texture has the same size as the original us-image
parent 7b772ff5
...@@ -64,6 +64,7 @@ namespace campvis { ...@@ -64,6 +64,7 @@ namespace campvis {
, p_gradientImageID("GradientImageId", "Gradient Input Image", "", DataNameProperty::READ) , p_gradientImageID("GradientImageId", "Gradient Input Image", "", DataNameProperty::READ)
, p_confidenceImageID("ConfidenceImageId", "Confidence Map Input", "", DataNameProperty::READ) , p_confidenceImageID("ConfidenceImageId", "Confidence Map Input", "", DataNameProperty::READ)
, p_targetImageID("targetImageID", "Output Image", "", DataNameProperty::WRITE) , p_targetImageID("targetImageID", "Output Image", "", DataNameProperty::WRITE)
, p_renderToTexture("RenderToTexture", "Render to an OpenGL Texture", false)
, p_sliceNumber("sliceNumber", "Slice Number", 0, 0, 0) , p_sliceNumber("sliceNumber", "Slice Number", 0, 0, 0)
, p_transferFunction("transferFunction", "Transfer Function", new SimpleTransferFunction(256)) , p_transferFunction("transferFunction", "Transfer Function", new SimpleTransferFunction(256))
, p_confidenceTF("ConfidenceTF", "Confidence to Uncertainty TF", new Geometry1DTransferFunction(256)) , p_confidenceTF("ConfidenceTF", "Confidence to Uncertainty TF", new Geometry1DTransferFunction(256))
...@@ -79,6 +80,7 @@ namespace campvis { ...@@ -79,6 +80,7 @@ namespace campvis {
addProperty(p_gradientImageID); addProperty(p_gradientImageID);
addProperty(p_confidenceImageID); addProperty(p_confidenceImageID);
addProperty(p_blurredScaling); addProperty(p_blurredScaling);
addProperty(p_renderToTexture);
addProperty(p_targetImageID); addProperty(p_targetImageID);
addProperty(p_sliceNumber); addProperty(p_sliceNumber);
addProperty(p_transferFunction); addProperty(p_transferFunction);
...@@ -132,18 +134,44 @@ namespace campvis { ...@@ -132,18 +134,44 @@ namespace campvis {
p_transferFunction.getTF()->bind(_shader, tfUnit); p_transferFunction.getTF()->bind(_shader, tfUnit);
p_confidenceTF.getTF()->bind(_shader, tf2Unit, "_confidenceTF", "_confidenceTFParams"); p_confidenceTF.getTF()->bind(_shader, tf2Unit, "_confidenceTF", "_confidenceTFParams");
FramebufferActivationGuard fag(this); if (p_renderToTexture.getValue() == true) {
createAndAttachColorTexture(); cgt::vec3 size = img->getSize();
createAndAttachDepthTexture(); cgt::Texture* resultTexture = new cgt::Texture(0, size, GL_RGB, GL_RGBA, GL_UNSIGNED_BYTE, cgt::Texture::LINEAR);
resultTexture->uploadTexture();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
QuadRdr.renderQuad(); _fbo->activate();
glViewport(0, 0, static_cast<GLsizei>(size.x), static_cast<GLsizei>(size.y));
decorateRenderEpilog(_shader); _fbo->attachTexture(resultTexture, GL_COLOR_ATTACHMENT0, 0, 0);
_shader->deactivate(); LGL_ERROR;
cgt::TextureUnit::setZeroUnit();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
data.addData(p_targetImageID.getValue(), new RenderData(_fbo)); QuadRdr.renderQuad();
_fbo->detachAll();
_fbo->deactivate();
_shader->deactivate();
ImageData* id = new ImageData(img->getParent()->getDimensionality(), size, 3);
ImageRepresentationGL::create(id, resultTexture);
const ImageMappingInformation& imi = img->getParent()->getMappingInformation();
id->setMappingInformation(img->getParent()->getMappingInformation());
cgt::TextureUnit::setZeroUnit();
data.addData(p_targetImageID.getValue(), id);
}
else {
FramebufferActivationGuard fag(this);
createAndAttachColorTexture();
createAndAttachDepthTexture();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
QuadRdr.renderQuad();
decorateRenderEpilog(_shader);
_shader->deactivate();
cgt::TextureUnit::setZeroUnit();
data.addData(p_targetImageID.getValue(), new RenderData(_fbo));
}
} }
else { else {
LERROR("Input image must have dimensionality of 3."); LERROR("Input image must have dimensionality of 3.");
......
...@@ -81,6 +81,7 @@ namespace campvis { ...@@ -81,6 +81,7 @@ namespace campvis {
DataNameProperty p_confidenceImageID; DataNameProperty p_confidenceImageID;
DataNameProperty p_targetImageID; ///< image ID for output image DataNameProperty p_targetImageID; ///< image ID for output image
BoolProperty p_renderToTexture;
IntProperty p_sliceNumber; ///< number of the slice to extract IntProperty p_sliceNumber; ///< number of the slice to extract
TransferFunctionProperty p_transferFunction; ///< Transfer function TransferFunctionProperty p_transferFunction; ///< Transfer function
TransferFunctionProperty p_confidenceTF; ///< Transfer function confidence to uncertainty TransferFunctionProperty p_confidenceTF; ///< Transfer function confidence to uncertainty
......
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