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

Updated OpenIGTLink module.

refs #386
parent 9ccba1cb
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <memory> #include <memory>
#include <tbb/atomic.h> #include <tbb/atomic.h>
#include "tgt/bounds.h" #include "cgt/bounds.h"
#include "core/coreapi.h" #include "core/coreapi.h"
#include "core/datastructures/scopedtypeddata.h" // not directly needed here but by many classes including AbstractData #include "core/datastructures/scopedtypeddata.h" // not directly needed here but by many classes including AbstractData
...@@ -48,7 +48,7 @@ namespace campvis { ...@@ -48,7 +48,7 @@ namespace campvis {
* Returns the data extent in world coordinates. * Returns the data extent in world coordinates.
* \return The data extent in world coordinates. * \return The data extent in world coordinates.
*/ */
virtual tgt::Bounds getWorldBounds() const = 0; virtual cgt::Bounds getWorldBounds() const = 0;
}; };
// ================================================================================================ // ================================================================================================
......
...@@ -32,7 +32,7 @@ namespace campvis { ...@@ -32,7 +32,7 @@ namespace campvis {
: AutoEvaluationPipeline(dc) : AutoEvaluationPipeline(dc)
{ {
addProcessor(&_igtlClient); addProcessor(&_igtlClient);
addProcessor(&_matrixProcessor); addProcessor(&_matrixProcessor);
//addEventListenerToBack(&_ve); //addEventListenerToBack(&_ve);
} }
...@@ -44,12 +44,12 @@ namespace campvis { ...@@ -44,12 +44,12 @@ namespace campvis {
AutoEvaluationPipeline::init(); AutoEvaluationPipeline::init();
_igtlClient.s_validated.connect(this, &StreamingOIGTLDemo::onProcessorValidated); _igtlClient.s_validated.connect(this, &StreamingOIGTLDemo::onProcessorValidated);
_matrixProcessor.s_validated.connect(this, &StreamingOIGTLDemo::onProcessorValidated); _matrixProcessor.s_validated.connect(this, &StreamingOIGTLDemo::onProcessorValidated);
_renderTargetID.setValue("IGTL.image.ImagerClient"); _renderTargetID.setValue("IGTL.image.ImagerClient");
_matrixProcessor.p_matrixAID.setValue("IGTL.transform.ProbeToTracker"); _matrixProcessor.p_matrixAID.setValue("IGTL.transform.ProbeToTracker");
_matrixProcessor.p_matrixAType.selectByOption("data"); _matrixProcessor.p_matrixAType.selectByOption("data");
_matrixProcessor.p_matrixBID.setValue("IGTL.transform.ReferenceToTracker"); _matrixProcessor.p_matrixBID.setValue("IGTL.transform.ReferenceToTracker");
_matrixProcessor.p_matrixBType.selectByOption("data"); _matrixProcessor.p_matrixBType.selectByOption("data");
_igtlClient.p_address.setValue("127.0.0.1"); _igtlClient.p_address.setValue("127.0.0.1");
......
...@@ -64,7 +64,7 @@ namespace campvis { ...@@ -64,7 +64,7 @@ namespace campvis {
virtual void onProcessorValidated(AbstractProcessor *processor); virtual void onProcessorValidated(AbstractProcessor *processor);
OpenIGTLinkClient _igtlClient; OpenIGTLinkClient _igtlClient;
MatrixProcessor _matrixProcessor; MatrixProcessor _matrixProcessor;
}; };
} }
......
...@@ -48,8 +48,8 @@ namespace campvis { ...@@ -48,8 +48,8 @@ namespace campvis {
, p_targetImagePrefix("targetImageName", "Target Image Prefix", "IGTL.image.") , p_targetImagePrefix("targetImageName", "Target Image Prefix", "IGTL.image.")
, p_receiveTransforms("ReceiveTransforms", "Receive TRANSFORM Messages", true) , p_receiveTransforms("ReceiveTransforms", "Receive TRANSFORM Messages", true)
, p_targetTransformPrefix("targetTransformPrefix", "Target Transform Prefix", "IGTL.transform.") , p_targetTransformPrefix("targetTransformPrefix", "Target Transform Prefix", "IGTL.transform.")
, p_imageOffset("ImageOffset", "Image Offset in mm", tgt::vec3(0.f), tgt::vec3(-10000.f), tgt::vec3(10000.f), tgt::vec3(0.1f)) , p_imageOffset("ImageOffset", "Image Offset in mm", cgt::vec3(0.f), cgt::vec3(-10000.f), cgt::vec3(10000.f), cgt::vec3(0.1f))
, p_voxelSize("VoxelSize", "Voxel Size in mm", tgt::vec3(1.f), tgt::vec3(-100.f), tgt::vec3(100.f), tgt::vec3(0.1f)) , p_voxelSize("VoxelSize", "Voxel Size in mm", cgt::vec3(1.f), cgt::vec3(-100.f), cgt::vec3(100.f), cgt::vec3(0.1f))
, p_receivePositions("ReceivePositions", "Receive POSITION Messages", true) , p_receivePositions("ReceivePositions", "Receive POSITION Messages", true)
, p_targetPositionPrefix("targetPositionsPrefix", "Target Position Prefix", "IGTL.position.") , p_targetPositionPrefix("targetPositionsPrefix", "Target Position Prefix", "IGTL.position.")
, _stopExecution() , _stopExecution()
...@@ -75,7 +75,7 @@ namespace campvis { ...@@ -75,7 +75,7 @@ namespace campvis {
addProperty(p_receivePositions, INVALID_PROPERTIES); addProperty(p_receivePositions, INVALID_PROPERTIES);
addProperty(p_targetPositionPrefix, VALID); addProperty(p_targetPositionPrefix, VALID);
invalidate(INVALID_PROPERTIES); invalidate(INVALID_PROPERTIES);
} }
...@@ -151,13 +151,13 @@ namespace campvis { ...@@ -151,13 +151,13 @@ namespace campvis {
return; return;
} }
tgt::vec3 imageOffset(0.f); cgt::vec3 imageOffset(0.f);
tgt::vec3 voxelSize(1.f); cgt::vec3 voxelSize(1.f);
tgt::ivec3 size_i(1); cgt::ivec3 size_i(1);
imageMessage->GetSpacing(voxelSize.elem); imageMessage->GetSpacing(voxelSize.elem);
imageMessage->GetDimensions(size_i.elem); imageMessage->GetDimensions(size_i.elem);
tgt::svec3 size(size_i); cgt::svec3 size(size_i);
imageMessage->GetOrigin(imageOffset.elem); imageMessage->GetOrigin(imageOffset.elem);
size_t dimensionality = (size_i[2] == 1) ? ((size_i[1] == 1) ? 1 : 2) : 3; size_t dimensionality = (size_i[2] == 1) ? ((size_i[1] == 1) ? 1 : 2) : 3;
...@@ -192,7 +192,7 @@ namespace campvis { ...@@ -192,7 +192,7 @@ namespace campvis {
p_imageOffset.setVisible(p_receiveImages.getValue()); p_imageOffset.setVisible(p_receiveImages.getValue());
p_voxelSize.setVisible(p_receiveImages.getValue()); p_voxelSize.setVisible(p_receiveImages.getValue());
p_targetTransformPrefix.setVisible(p_receiveImages.getValue() || p_receiveTransforms.getValue()); p_targetTransformPrefix.setVisible(p_receiveImages.getValue() || p_receiveTransforms.getValue());
p_targetPositionPrefix.setVisible(p_receivePositions.getValue()); p_targetPositionPrefix.setVisible(p_receivePositions.getValue());
validate(INVALID_PROPERTIES); validate(INVALID_PROPERTIES);
} }
...@@ -246,7 +246,7 @@ namespace campvis { ...@@ -246,7 +246,7 @@ namespace campvis {
if (c & igtl::MessageHeader::UNPACK_BODY) // if CRC check is OK if (c & igtl::MessageHeader::UNPACK_BODY) // if CRC check is OK
{ {
tgt::mat4 mtx; cgt::mat4 mtx;
// Retrieve the transform data (this cast is a bit dubious but should be ok judging from the respective class internals) // Retrieve the transform data (this cast is a bit dubious but should be ok judging from the respective class internals)
transMsg->GetMatrix(*reinterpret_cast<igtl::Matrix4x4*>(mtx.elem)); transMsg->GetMatrix(*reinterpret_cast<igtl::Matrix4x4*>(mtx.elem));
#ifdef IGTL_CLIENT_DEBUGGING #ifdef IGTL_CLIENT_DEBUGGING
...@@ -346,7 +346,7 @@ namespace campvis { ...@@ -346,7 +346,7 @@ namespace campvis {
imgMsg->GetSpacing(spacing); imgMsg->GetSpacing(spacing);
imgMsg->GetSubVolume(svsize, svoffset); imgMsg->GetSubVolume(svsize, svoffset);
tgt::mat4 mtx; cgt::mat4 mtx;
// Retrieve the transform data (this cast is a bit dubious but should be ok judging from the class internals) // Retrieve the transform data (this cast is a bit dubious but should be ok judging from the class internals)
imgMsg->GetMatrix(*reinterpret_cast<igtl::Matrix4x4*>(mtx.elem)); imgMsg->GetMatrix(*reinterpret_cast<igtl::Matrix4x4*>(mtx.elem));
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <igtlMessageHeader.h> #include <igtlMessageHeader.h>
#include <igtlImageMessage.h> #include <igtlImageMessage.h>
#include <tgt/matrix.h> #include <cgt/matrix.h>
#include <ext/threading.h> #include <ext/threading.h>
#include <tbb/atomic.h> #include <tbb/atomic.h>
...@@ -118,8 +118,8 @@ namespace campvis { ...@@ -118,8 +118,8 @@ namespace campvis {
protected: protected:
/// Stores received data from a POSITION Message /// Stores received data from a POSITION Message
struct PositionMessageData { struct PositionMessageData {
tgt::vec3 _position; cgt::vec3 _position;
tgt::vec4 _quaternion; cgt::vec4 _quaternion;
}; };
/// Main method for the receiver thread. The new thread will /// Main method for the receiver thread. The new thread will
...@@ -139,7 +139,7 @@ namespace campvis { ...@@ -139,7 +139,7 @@ namespace campvis {
igtl::ClientSocket::Pointer _socket; igtl::ClientSocket::Pointer _socket;
//data //data
std::map<std::string, tgt::mat4> _receivedTransforms; ///< the transforms that has been received by the igtl worker thread, mapped by device name std::map<std::string, cgt::mat4> _receivedTransforms; ///< the transforms that has been received by the igtl worker thread, mapped by device name
std::map<std::string, igtl::ImageMessage::Pointer> _receivedImages; ///< the image messages received by the igtl worker thread, mapped by device name std::map<std::string, igtl::ImageMessage::Pointer> _receivedImages; ///< the image messages received by the igtl worker thread, mapped by device name
std::map<std::string, PositionMessageData> _receivedPositions; ///< position message data received by the igtl worker thread, mapped by device name std::map<std::string, PositionMessageData> _receivedPositions; ///< position message data received by the igtl worker thread, mapped by device name
......
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