MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkIGTLMessage.h
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12
13
14#ifndef mitkIGTLMessage_h
15#define mitkIGTLMessage_h
16
17#include <itkDataObject.h>
18#include "MitkOpenIGTLinkExports.h"
19#include <mitkNumericTypes.h>
20#include <mitkCommon.h>
21
22#include "igtlMessageBase.h"
23
24namespace mitk {
25
35 class MITKOPENIGTLINK_EXPORT IGTLMessage : public itk::DataObject
36 {
37 public:
41 mitkNewMacro1Param(Self, igtl::MessageBase::Pointer);
42
46 typedef double TimeStampType;
47
51 void SetMessage(igtl::MessageBase::Pointer msg);
55 itkGetConstMacro(Message, igtl::MessageBase::Pointer);
59 virtual bool IsDataValid() const;
64 itkSetMacro(DataValid, bool);
77
88 void Graft(const DataObject *data) override;
89
95 void CopyInformation(const DataObject* data) override;
96
102 void PrintSelf(std::ostream& os, itk::Indent indent) const override;
103
104 std::string ToString() const;
105
116 void Compose(const mitk::IGTLMessage::Pointer n, const bool pre = false);
117
120 const char* GetIGTLMessageType() const;
121
122 template < typename IGTLMessageType > IGTLMessageType* GetMessage() const;
123
124 protected:
126
127 IGTLMessage();
128
132 IGTLMessage(const mitk::IGTLMessage& toCopy);
133
137 IGTLMessage(igtl::MessageBase::Pointer message);
138
139 ~IGTLMessage() override;
140
144 igtl::MessageBase::Pointer m_Message;
145
157 std::string m_Name;
158
159 private:
160
161 // pre = false
162 static mitk::IGTLMessage::Pointer getComposition(
163 const mitk::IGTLMessage::Pointer nd1,
164 const mitk::IGTLMessage::Pointer nd2);
165
169 itkSetMacro(IGTTimeStamp, TimeStampType);
170
171 };
172
189 MITKOPENIGTLINK_EXPORT bool Equal( const mitk::IGTLMessage& leftHandSide,
190 const mitk::IGTLMessage& rightHandSide,
191 ScalarType eps = mitk::eps,
192 bool verbose = false );
193
194} // namespace mitk
195#endif
A wrapper for the OpenIGTLink message type.
igtl::MessageBase::Pointer m_Message
holds the actual OpenIGTLink message
itkSetMacro(DataValid, bool)
sets the dataValid flag of the IGTLMessage object indicating if the object contains valid data
itkGetConstMacro(IGTTimeStamp, TimeStampType)
gets the IGT timestamp of the IGTLMessage object
double TimeStampType
type that holds the time at which the data was recorded in milliseconds
itkFactorylessNewMacro(Self)
void Compose(const mitk::IGTLMessage::Pointer n, const bool pre=false)
itkGetStringMacro(Name)
returns the name of the IGTLMessage object
std::string m_Name
name of the navigation data
itkSetStringMacro(Name)
set the name of the IGTLMessage object
itkGetConstMacro(Message, igtl::MessageBase::Pointer)
returns the OpenIGTLink message
mitkClassMacroItkParent(IGTLMessage, itk::DataObject)
TimeStampType m_IGTTimeStamp
contains the time at which the tracking data was recorded
bool m_DataValid
defines if the object contains valid values
mitkNewMacro1Param(Self, igtl::MessageBase::Pointer)
Time stamp in milliseconds.
IGT Exceptions.
MITKIGTBASE_EXPORT bool Equal(const mitk::NavigationData &leftHandSide, const mitk::NavigationData &rightHandSide, ScalarType eps=mitk::eps, bool verbose=false)
Equal A function comparing two navigation data objects for beeing equal in meta- and imagedata.