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

Commit 7d35a6e5 authored by Oliver Zettinig's avatar Oliver Zettinig Committed by CAMP C++ Builder
Browse files

Revert vis/mprdemp and vis/mprrenderer to current version in dev branch

parent 4d6ba047
......@@ -52,7 +52,6 @@ void main() {
}
}
else {
out_Color = vec4(1, 0, 0, 1);
//discard;
discard;
}
}
......@@ -39,9 +39,6 @@ namespace campvis {
, _imageReader()
, _mprRenderer(&_canvasSize)
, _compositor(&_canvasSize)
, _trackerPose()
, _probeToTip()
, _igtlClient()
, _trackballEH(0)
{
addProperty(_camera);
......@@ -50,14 +47,9 @@ namespace campvis {
addEventListenerToBack(_trackballEH);
addProcessor(&_lsp);
addProcessor(&_imageReader);
addProcessor(&_compositor);
addProcessor(&_mprRenderer);
addProcessor(&_igtlClient);
addProcessor(&_trackerPose);
addProcessor(&_probeToTip);
addProcessor(&_compositor);
}
MprDemo::~MprDemo() {
......@@ -85,21 +77,6 @@ namespace campvis {
Geometry1DTransferFunction* tf = new Geometry1DTransferFunction(128, tgt::vec2(0.f, .08f));
tf->addGeometry(TFGeometry1D::createQuad(tgt::vec2(0.f, 1.f), tgt::col4(0, 0, 0, 255), tgt::col4(255, 255, 255, 255)));
_mprRenderer.p_transferFunction.replaceTF(tf);
_trackerPose.p_matrixAID.setValue("IGTL.transform.ProbeToTracker");
_trackerPose.p_matrixAType.selectByOption("data");
_trackerPose.p_matrixBID.setValue("IGTL.transform.ReferenceToTracker");
_trackerPose.p_matrixBType.selectByOption("data");
// _trackerPose.p_matrixBModifiers.setValue("I");
_trackerPose.p_targetMatrixID.setValue("ProbeToReference");
//this is the Image->Probe matrix from the TRUS config file
_probeToTip.p_matrixAString.setValue("0.13758 0.0266467 0.00606382 -310.999 0.00447841 0.00887565 -0.137823 -18.5525 -0.0272137 0.133125 0.00797508 -105.741 0 0 0 1");
_probeToTip.p_matrixBID.setValue("ProbeToReference");
_probeToTip.p_matrixBType.selectByOption("data");
_probeToTip.p_targetMatrixID.setValue("TipToReference");
_probeToTip.p_targetMatrixID.addSharedProperty(&_mprRenderer.p_transformationID);
}
void MprDemo::deinit() {
......
......@@ -33,9 +33,6 @@
#include "modules/vis/processors/mprrenderer.h"
#include "modules/vis/processors/rendertargetcompositor.h"
#include "modules/openigtlink/processors/openigtlinkclient.h"
#include "modules/base/processors/matrixprocessor.h"
namespace campvis {
class MprDemo : public AutoEvaluationPipeline {
public:
......@@ -75,10 +72,6 @@ namespace campvis {
MprRenderer _mprRenderer;
RenderTargetCompositor _compositor;
MatrixProcessor _trackerPose;
MatrixProcessor _probeToTip;
OpenIGTLinkClient _igtlClient;
TrackballNavigationEventListener* _trackballEH;
};
......
......@@ -40,8 +40,6 @@
#include "core/tools/quadrenderer.h"
#include "core/datastructures/transformdata.h"
namespace campvis {
const std::string MprRenderer::loggerCat_ = "CAMPVis.modules.vis.MprRenderer";
......@@ -50,7 +48,6 @@ namespace campvis {
, p_sourceImageID("sourceImageID", "Input Image", "", DataNameProperty::READ)
, p_targetImageID("targetImageID", "Output Image", "", DataNameProperty::WRITE)
, p_camera("Camera", "Camera")
, p_transformationID("transformationID", "Input Transformation", "", DataNameProperty::READ)
, p_planeNormal("PlaneNormal", "Clipping Plane Normal", tgt::vec3(0.f, 0.f, 1.f), tgt::vec3(-1.f), tgt::vec3(1.f), tgt::vec3(.1f), tgt::ivec3(2))
, p_planeDistance("PlaneDistance", "Clipping Plane Distance", 0.f, -1000.f, 1000.f, 1.f, 1)
, p_planeSize("PlaneSize", "Clipping Plane Size", 100.f, 0.f, 1000.f, 1.f, 1)
......@@ -62,7 +59,6 @@ namespace campvis {
addProperty(p_sourceImageID, INVALID_RESULT | INVALID_PROPERTIES);
addProperty(p_targetImageID);
addProperty(p_camera);
addProperty(p_transformationID);
addProperty(p_planeNormal);
addProperty(p_planeDistance);
addProperty(p_planeSize);
......@@ -100,41 +96,20 @@ namespace campvis {
if (abs(tgt::dot(temp, n) > 0.9))
temp = tgt::vec3(0.0, 1.0, 0.0);
tgt::vec3 inPlaneA;
tgt::vec3 inPlaneB;
tgt::vec3 base;
{
ScopedTypedData<TransformData> td(data, p_transformationID.getValue());
if (td)
{
// convention for now: the slice in xy plane centered at (0,0,0) is sampled
// coordinate system supplied by the transformation
tgt::mat4 t = td->getTransform();
base = t * tgt::vec3(0, 0, 0);
inPlaneA = tgt::normalize((t * tgt::vec4(1, 0, 0, 0)).xyz()) * 0.5f * p_planeSize.getValue();
inPlaneB = tgt::normalize((t * tgt::vec4(0, 1, 0, 0)).xyz()) * 0.5f * p_planeSize.getValue();
}
else {
inPlaneA = tgt::normalize(tgt::cross(n, temp)) * 0.5f * p_planeSize.getValue();
inPlaneB = tgt::normalize(tgt::cross(n, inPlaneA)) * 0.5f * p_planeSize.getValue();
base = (n * -p_planeDistance.getValue());
// move to image center if wanted
if (p_relativeToImageCenter.getValue())
base += img->getParent()->getWorldBounds().center();
}
}
// construct the four texCoords
std::vector<tgt::vec3> texCoords;
texCoords.push_back(base + inPlaneA + inPlaneB);
texCoords.push_back(base - inPlaneA + inPlaneB);
texCoords.push_back(base - inPlaneA - inPlaneB);
texCoords.push_back(base + inPlaneA - inPlaneB);
tgt::vec3 inPlaneA = tgt::normalize(tgt::cross(n, temp)) * 0.5f * p_planeSize.getValue();
tgt::vec3 inPlaneB = tgt::normalize(tgt::cross(n, inPlaneA)) * 0.5f * p_planeSize.getValue();
tgt::vec3 base = (n * -p_planeDistance.getValue());
// move to image center if wanted
if (p_relativeToImageCenter.getValue())
base += img->getParent()->getWorldBounds().center();
// construct the four texCoords
std::vector<tgt::vec3> texCoords;
texCoords.push_back(base + inPlaneA + inPlaneB);
texCoords.push_back(base - inPlaneA + inPlaneB);
texCoords.push_back(base - inPlaneA - inPlaneB);
texCoords.push_back(base + inPlaneA - inPlaneB);
FaceGeometry slice(texCoords, texCoords);
// perform the rendering
......
......@@ -72,8 +72,6 @@ namespace campvis {
CameraProperty p_camera;
DataNameProperty p_transformationID; ///< transformation id for input transformation
Vec3Property p_planeNormal; ///< Clipping plane normal
FloatProperty p_planeDistance; ///< Clipping plane distance
FloatProperty p_planeSize; ///< Size of clipping plane
......
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