24 #include <itkCommand.h> 29 this->
SetName(
"IGTLDeviceSource (tracking data)");
44 igtl::MessageBase::Pointer msgIn;
49 igtl::MessageBase::Pointer msgInTDATA =
dynamic_cast<igtl::MessageBase*
>(
m_IGTLDevice->GetNextTrackingDataMessage().GetPointer());
50 igtl::MessageBase::Pointer msgInTRANSFORM =
dynamic_cast<igtl::MessageBase*
>(
m_IGTLDevice->GetNextTransformMessage().GetPointer());
51 if (msgInTDATA.IsNull() && msgInTRANSFORM.IsNotNull()) { msgIn = msgInTRANSFORM; }
52 else if (msgInTDATA.IsNotNull() && msgInTRANSFORM.IsNull()) { msgIn = msgInTDATA; }
53 else if (msgInTDATA.IsNotNull() && msgInTRANSFORM.IsNotNull())
55 MITK_INFO <<
"Found both: TDATA and TRANSFORM messages. Using TRANSFORM as default.";
60 msgIn =
dynamic_cast<igtl::MessageBase*
>(
m_IGTLDevice->GetNextTrackingDataMessage().GetPointer());
63 MITK_WARN <<
"Receiving QTDATA is not implemented yet!";
66 msgIn =
dynamic_cast<igtl::MessageBase*
>(
m_IGTLDevice->GetNextTransformMessage().GetPointer());
70 if (msgIn.IsNotNull())
74 msgOut->
SetName(msgIn->GetDeviceName());
void GenerateData() override
filter execute method
TrackingMessageType m_trackingDataType
void SetMessage(igtl::MessageBase::Pointer msg)
Sets the OpenIGTLink message.
Connects a mitk::IGTLDevice to a MITK-OpenIGTLink-Message-Filter-Pipeline.
IGTLTrackingDataDeviceSource()
DataCollection - Class to facilitate loading/accessing structured data.
mitk::IGTLDevice::Pointer m_IGTLDevice
virtual void SetName(const char *_arg)
set the name of the IGTLMessage object
IGTLMessage * GetOutput(void)
return the output (output with id 0) of the filter
A wrapper for the OpenIGTLink message type.
virtual void SetName(std::string _arg)
Sets the human readable name of this source. There is also a default name, but you can use this metho...
~IGTLTrackingDataDeviceSource() override