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;
}; };
// ================================================================================================ // ================================================================================================
......
...@@ -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()
...@@ -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;
...@@ -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