Commit 3e5d7398 authored by Jakob Weiss's avatar Jakob Weiss
Browse files

mprdemo fixes

parent a4252322
...@@ -50,21 +50,20 @@ namespace campvis { ...@@ -50,21 +50,20 @@ namespace campvis {
, p_matrixBID("MatrixB_ID", "Matrix B", "matrixB", DataNameProperty::READ) , p_matrixBID("MatrixB_ID", "Matrix B", "matrixB", DataNameProperty::READ)
, p_matrixBString("MatrixB_String", "Matrix B String", "identity") , p_matrixBString("MatrixB_String", "Matrix B String", "identity")
, p_matrixBModifiers("MatrixBModifiers", "Matrix B Modifiers") , p_matrixBModifiers("MatrixBModifiers", "Matrix B Modifiers")
, p_targetMatrixID("TargetMatrixID", "Target Matrix ID", "ProbeToReference", DataNameProperty::WRITE)
, p_targetMatrixID("TargetMatrixID", "Target Matrix ID", "result.matrix", DataNameProperty::WRITE)
, _lastdc(nullptr) , _lastdc(nullptr)
{ {
addProperty(p_matrixAType, INVALID_PROPERTIES); addProperty(p_matrixAType, INVALID_PROPERTIES);
addProperty(p_matrixAID, INVALID_RESULT); addProperty(p_matrixAID, VALID);
addProperty(p_matrixAString, INVALID_RESULT); addProperty(p_matrixAString, VALID);
addProperty(p_matrixAModifiers, INVALID_RESULT); addProperty(p_matrixAModifiers, VALID);
addProperty(p_matrixBType, INVALID_PROPERTIES); addProperty(p_matrixBType, INVALID_PROPERTIES);
addProperty(p_matrixBID, INVALID_RESULT); addProperty(p_matrixBID, VALID);
addProperty(p_matrixBString, INVALID_RESULT); addProperty(p_matrixBString, VALID);
addProperty(p_matrixBModifiers, INVALID_RESULT); addProperty(p_matrixBModifiers, VALID);
addProperty(p_targetMatrixID, INVALID_RESULT); addProperty(p_targetMatrixID, VALID);
invalidate(INVALID_PROPERTIES); invalidate(INVALID_PROPERTIES);
} }
...@@ -85,14 +84,14 @@ namespace campvis { ...@@ -85,14 +84,14 @@ namespace campvis {
void MatrixProcessor::updateResult(DataContainer& data) { void MatrixProcessor::updateResult(DataContainer& data) {
LINFO("Updating Result"); LINFO("Updating Result");
//if (&data != _lastdc) { if (&data != _lastdc) {
// if (_lastdc) { if (_lastdc) {
// _lastdc->s_dataAdded.disconnect(this); _lastdc->s_dataAdded.disconnect(this);
// } }
// data.s_dataAdded.connect(this, &MatrixProcessor::DataContainerDataAdded); data.s_dataAdded.connect(this, &MatrixProcessor::DataContainerDataAdded);
// _lastdc = &data; _lastdc = &data;
//} }
tgt::mat4 matA = tgt::mat4::createIdentity(); tgt::mat4 matA = tgt::mat4::createIdentity();
if(p_matrixAType.getOptionValue() == "fixed") if(p_matrixAType.getOptionValue() == "fixed")
......
...@@ -84,7 +84,7 @@ namespace campvis { ...@@ -84,7 +84,7 @@ namespace campvis {
StringProperty p_matrixBString; StringProperty p_matrixBString;
StringProperty p_matrixBModifiers; ///< modifier string to be applied to matrix A. \see MatrixProcessor::processModifierString() StringProperty p_matrixBModifiers; ///< modifier string to be applied to matrix A. \see MatrixProcessor::processModifierString()
DataNameProperty p_targetMatrixID; ///< image ID for read image DataNameProperty p_targetMatrixID; ///< name for the output matrix
void DataContainerDataAdded(const std::string& name, const DataHandle& data); void DataContainerDataAdded(const std::string& name, const DataHandle& data);
......
...@@ -40,6 +40,7 @@ namespace campvis { ...@@ -40,6 +40,7 @@ namespace campvis {
, _mprRenderer(&_canvasSize) , _mprRenderer(&_canvasSize)
, _compositor(&_canvasSize) , _compositor(&_canvasSize)
, _trackerPose() , _trackerPose()
, _probeToTip()
, _igtlClient() , _igtlClient()
, _trackballEH(0) , _trackballEH(0)
{ {
...@@ -49,11 +50,13 @@ namespace campvis { ...@@ -49,11 +50,13 @@ namespace campvis {
addEventListenerToBack(_trackballEH); addEventListenerToBack(_trackballEH);
addProcessor(&_lsp); addProcessor(&_lsp);
addProcessor(&_igtlClient);
addProcessor(&_imageReader); addProcessor(&_imageReader);
addProcessor(&_trackerPose);
addProcessor(&_mprRenderer);
addProcessor(&_compositor); addProcessor(&_compositor);
addProcessor(&_mprRenderer);
addProcessor(&_igtlClient);
addProcessor(&_trackerPose);
addProcessor(&_probeToTip);
} }
...@@ -65,8 +68,6 @@ namespace campvis { ...@@ -65,8 +68,6 @@ namespace campvis {
AutoEvaluationPipeline::init(); AutoEvaluationPipeline::init();
_imageReader.s_validated.connect(this, &MprDemo::onProcessorValidated); _imageReader.s_validated.connect(this, &MprDemo::onProcessorValidated);
_trackerPose.s_validated.connect(this, &MprDemo::onProcessorValidated);
_igtlClient.s_validated.connect(this, &MprDemo::onProcessorValidated);
_camera.addSharedProperty(&_mprRenderer.p_camera); _camera.addSharedProperty(&_mprRenderer.p_camera);
_mprRenderer.p_targetImageID.setValue("MPR"); _mprRenderer.p_targetImageID.setValue("MPR");
...@@ -89,9 +90,16 @@ namespace campvis { ...@@ -89,9 +90,16 @@ namespace campvis {
_trackerPose.p_matrixAType.selectByOption("data"); _trackerPose.p_matrixAType.selectByOption("data");
_trackerPose.p_matrixBID.setValue("IGTL.transform.ReferenceToTracker"); _trackerPose.p_matrixBID.setValue("IGTL.transform.ReferenceToTracker");
_trackerPose.p_matrixBType.selectByOption("data"); _trackerPose.p_matrixBType.selectByOption("data");
_trackerPose.p_matrixBModifiers.setValue("I"); // _trackerPose.p_matrixBModifiers.setValue("I");
_trackerPose.p_targetMatrixID.setValue("ProbeToReference"); _trackerPose.p_targetMatrixID.setValue("ProbeToReference");
_trackerPose.p_targetMatrixID.addSharedProperty(&_mprRenderer.p_transformationID);
//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() { void MprDemo::deinit() {
......
...@@ -76,6 +76,7 @@ namespace campvis { ...@@ -76,6 +76,7 @@ namespace campvis {
RenderTargetCompositor _compositor; RenderTargetCompositor _compositor;
MatrixProcessor _trackerPose; MatrixProcessor _trackerPose;
MatrixProcessor _probeToTip;
OpenIGTLinkClient _igtlClient; OpenIGTLinkClient _igtlClient;
TrackballNavigationEventListener* _trackballEH; TrackballNavigationEventListener* _trackballEH;
......
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