7 #ifndef __igtlPlusTrackedFrameMessage_h 8 #define __igtlPlusTrackedFrameMessage_h 10 #include "vtkPlusOpenIGTLinkExport.h" 12 #include "igsioTrackedFrame.h" 13 #include "igtl_types.h" 14 #include "igtl_win32header.h" 15 #include "igtlMessageBase.h" 16 #include "igtlObject.h" 17 #include "igtl_header.h" 18 #include "igtl_util.h" 19 #include "vtkMatrix4x4.h" 20 #include "vtkSmartPointer.h" 41 virtual igtl::MessageBase::Pointer Clone();
44 PlusStatus SetTrackedFrame(
const igsioTrackedFrame& trackedFrame,
const std::vector<igsioTransformName>& requestedTransforms);
47 igsioTrackedFrame GetTrackedFrame();
50 PlusStatus SetEmbeddedImageTransform(vtkSmartPointer<vtkMatrix4x4> matrix);
53 vtkSmartPointer<vtkMatrix4x4> GetEmbeddedImageTransform();
61 , m_NumberOfComponents(0)
63 , m_ImageDataSizeInBytes(0)
64 , m_XmlDataSizeInBytes(0)
65 , m_ImageOrientation(0)
67 m_FrameSize[0] = m_FrameSize[1] = m_FrameSize[2] = 0;
68 for (
int i = 0;
i < 4; ++
i)
70 for (
int j = 0; j < 4; ++j)
72 m_EmbeddedImageTransform[
i][j] = (
i == j) ? 1.f : 0.f;
79 size_t headersize = 0;
80 headersize +=
sizeof(igtl_uint16);
81 headersize +=
sizeof(igtl_uint16);
82 headersize +=
sizeof(igtl_uint16);
83 headersize +=
sizeof(igtl_uint16) * 3;
84 headersize +=
sizeof(igtl_uint32);
85 headersize +=
sizeof(igtl_uint32);
86 headersize +=
sizeof(igtl_uint16);
87 headersize +=
sizeof(igtl::Matrix4x4);
94 if (igtl_is_little_endian())
96 m_ScalarType = BYTE_SWAP_INT16(m_ScalarType);
97 m_NumberOfComponents = BYTE_SWAP_INT16(m_NumberOfComponents);
98 m_ImageType = BYTE_SWAP_INT16(m_ImageType);
99 m_FrameSize[0] = BYTE_SWAP_INT16(m_FrameSize[0]);
100 m_FrameSize[1] = BYTE_SWAP_INT16(m_FrameSize[1]);
101 m_FrameSize[2] = BYTE_SWAP_INT16(m_FrameSize[2]);
102 m_ImageDataSizeInBytes = BYTE_SWAP_INT32(m_ImageDataSizeInBytes);
103 m_XmlDataSizeInBytes = BYTE_SWAP_INT32(m_XmlDataSizeInBytes);
104 m_ImageOrientation = BYTE_SWAP_INT16(m_ImageOrientation);
111 igtl_uint16 m_FrameSize[3];
118 virtual igtlUint64 CalculateContentBufferSize();
119 virtual int PackContent();
120 virtual int UnpackContent();
igsioTrackedFrame m_TrackedFrame
IGTL message helper class for tracked frame messages.
std::string m_TrackedFrameXmlData
TrackedFrameHeader m_MessageHeader