Medical Imaging Interaction Toolkit  2018.4.99-87d68d9f
Medical Imaging Interaction Toolkit
mitk::IGTLTrackingDataDeviceSource Class Reference

Connects a mitk::IGTLDevice to a MITK-OpenIGTLink-Message-Filter-Pipeline. More...

#include <mitkIGTLTrackingDataDeviceSource.h>

Inheritance diagram for mitk::IGTLTrackingDataDeviceSource:
Collaboration diagram for mitk::IGTLTrackingDataDeviceSource:

Public Types

enum  TrackingMessageType { TDATA, TRANSFORM, QTDATA, UNKNOWN }
 

Public Member Functions

 mitkClassMacro (IGTLTrackingDataDeviceSource, IGTLDeviceSource)
 
Pointer Clone () const
 
virtual void SettrackingDataType (TrackingMessageType _arg)
 
virtual TrackingMessageType GettrackingDataType () const
 
- Public Member Functions inherited from mitk::IGTLDeviceSource
 mitkClassMacro (IGTLDeviceSource, IGTLMessageSource)
 
Pointer Clone () const
 
virtual void SetIGTLDevice (mitk::IGTLDevice *td)
 sets the OpenIGTLink device that will be used as a data source More...
 
virtual mitk::IGTLDeviceGetIGTLDevice ()
 returns the OpenIGTLink device that is used by this filter More...
 
void RegisterAsMicroservice () override
 Registers this object as a Microservice, making it available to every module and/or plugin. To unregister, call UnregisterMicroservice(). More...
 
void Connect ()
 Establishes a connection to the OpenIGTLink device. If there is already a connection the method does nothing. More...
 
void Disconnect ()
 Closes the connection to the OpenIGTLink device. More...
 
void StartCommunication ()
 starts the communication of the device. This needs to be called before Update() or GetOutput()->Update(). If the device is already communicating the method does nothing. More...
 
void StopCommunication ()
 stops the communication of the device. More...
 
virtual bool IsConnected ()
 returns true if a connection to the OpenIGTLink device is established More...
 
virtual bool IsCommunicating ()
 returns true if communication is in progress More...
 
void UpdateOutputInformation () override
 Used for pipeline update. More...
 
- Public Member Functions inherited from mitk::IGTLMessageSource
 mitkClassMacroItkParent (IGTLMessageSource, itk::ProcessObject)
 
virtual std::string GetName ()
 
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 method if you need to define it on your own. More...
 
virtual std::string GetType ()
 
virtual void SetType (std::string _arg)
 
IGTLMessageGetOutput (void)
 return the output (output with id 0) of the filter More...
 
IGTLMessageGetOutput (DataObjectPointerArraySizeType idx)
 return the output with id idx of the filter More...
 
IGTLMessageGetOutput (const std::string &messageName)
 return the output with name messageName of the filter More...
 
DataObjectPointerArraySizeType GetOutputIndex (std::string messageName)
 return the index of the output with name messageName, -1 if no output with that name was found More...
 
virtual void UnRegisterMicroservice ()
 Registers this object as a Microservice, making it available to every module and/or plugin. More...
 
std::string GetMicroserviceID ()
 Returns the id that this device is registered with. The id will only be valid, if the IGTLMessageSource has been registered using RegisterAsMicroservice(). More...
 
virtual void GraftNthOutput (unsigned int idx, itk::DataObject *graft)
 Graft the specified DataObject onto this ProcessObject's output. More...
 
virtual void GraftOutput (itk::DataObject *graft)
 Graft the specified DataObject onto this ProcessObject's output. More...
 
itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 
itk::DataObject::Pointer MakeOutput (const DataObjectIdentifierType &name) override
 
virtual void SetParameters (const mitk::PropertyList *)
 Set all filter parameters as the PropertyList p. More...
 
virtual mitk::PropertyList::ConstPointer GetParameters () const
 Get all filter parameters as a PropertyList. More...
 
void SetFPS (unsigned int fps)
 Sets the fps used for streaming this source. More...
 
unsigned int GetFPS ()
 Gets the fps used for streaming this source. More...
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from mitk::IGTLDeviceSource
static Pointer New ()
 

Protected Member Functions

 IGTLTrackingDataDeviceSource ()
 
 ~IGTLTrackingDataDeviceSource () override
 
void GenerateData () override
 filter execute method More...
 
- Protected Member Functions inherited from mitk::IGTLDeviceSource
 IGTLDeviceSource ()
 
 ~IGTLDeviceSource () override
 
void GenerateData () override
 filter execute method More...
 
void CreateOutputs ()
 Create the necessary outputs for the m_IGTLDevice. More...
 
virtual void OnIncomingMessage ()
 This method is called when the IGTL device hold by this class receives a new message. More...
 
virtual void OnIncomingCommand ()
 This method is called when the IGTL device hold by this class receives a new command. More...
 
virtual void OnLostConnection ()
 This method is called when the IGTL device lost the connection to the other side. More...
 
virtual void RemoveObservers ()
 Removes all observers that listen to the igtl device. More...
 
virtual void SetInput (unsigned int idx, const IGTLMessage *msg)
 Set input with id idx of this filter. More...
 
const IGTLMessageGetInput (void) const
 Get the input of this filter. More...
 
const IGTLMessageGetInput (unsigned int idx) const
 Get the input with id idx of this filter. More...
 
const IGTLMessageGetInput (std::string msgName) const
 Get the input with name messageName of this filter. More...
 
DataObjectPointerArraySizeType GetInputIndex (std::string msgName)
 return the index of the input with name msgName, throw std::invalid_argument exception if that name was not found More...
 
DataObjectPointerArraySizeType GetOutputIndex (std::string msgName)
 return the index of the output with name msgName, -1 if no output with that name was found More...
 
- Protected Member Functions inherited from mitk::IGTLMessageSource
 IGTLMessageSource ()
 
 ~IGTLMessageSource () override
 

Protected Attributes

TrackingMessageType m_trackingDataType
 
- Protected Attributes inherited from mitk::IGTLDeviceSource
mitk::IGTLDevice::Pointer m_IGTLDevice
 
unsigned int m_LostConnectionObserverTag
 
unsigned int m_IncomingCommandObserverTag
 
unsigned int m_IncomingMessageObserverTag
 
- Protected Attributes inherited from mitk::IGTLMessageSource
std::string m_Name
 
std::string m_Type
 
itk::FastMutexLock::Pointer m_StreamingFPSMutex
 
unsigned int m_StreamingFPS
 
us::ServiceRegistration< Self > m_ServiceRegistration
 

Additional Inherited Members

- Static Public Attributes inherited from mitk::IGTLDeviceSource
static const std::string US_PROPKEY_IGTLDEVICENAME
 These Constants are used in conjunction with Microservices. More...
 
- Static Public Attributes inherited from mitk::IGTLMessageSource
static const std::string US_INTERFACE_NAME
 These Constants are used in conjunction with Microservices. More...
 
static const std::string US_PROPKEY_DEVICENAME
 
static const std::string US_PROPKEY_DEVICETYPE
 
static const std::string US_PROPKEY_ID
 
static const std::string US_PROPKEY_ISACTIVE
 

Detailed Description

Connects a mitk::IGTLDevice to a MITK-OpenIGTLink-Message-Filter-Pipeline.

This class is the source of most OpenIGTLink tracking data pipelines. Deriving from IGTLDeviceSource it encapsulates a mitk::IGTLDevice and provides the tracking data messages of the connected OpenIGTLink devices as igtl::MessageBase objects. This means it filters for TDATA, QTDATA and TRANSFORM messages. It can be configured to listen to one of these message types or to all of them.

Note, that there is just one single output.

Definition at line 33 of file mitkIGTLTrackingDataDeviceSource.h.

Member Enumeration Documentation

◆ TrackingMessageType

OpenIGTLink tracking data message types

Enumerator
TDATA 
TRANSFORM 
QTDATA 
UNKNOWN 

Definition at line 37 of file mitkIGTLTrackingDataDeviceSource.h.

Constructor & Destructor Documentation

◆ IGTLTrackingDataDeviceSource()

mitk::IGTLTrackingDataDeviceSource::IGTLTrackingDataDeviceSource ( )
protected

◆ ~IGTLTrackingDataDeviceSource()

mitk::IGTLTrackingDataDeviceSource::~IGTLTrackingDataDeviceSource ( )
overrideprotected

Definition at line 32 of file mitkIGTLTrackingDataDeviceSource.cpp.

Member Function Documentation

◆ Clone()

Pointer mitk::IGTLTrackingDataDeviceSource::Clone ( ) const

◆ GenerateData()

void mitk::IGTLTrackingDataDeviceSource::GenerateData ( )
overrideprotected

filter execute method

queries the OpenIGTLink device for new messages and updates its output igtl::MessageBase objects with it.

Warning
Will raise a std::out_of_range exception, if tools were added to the OpenIGTLink device after it was set as input for this filter

Definition at line 36 of file mitkIGTLTrackingDataDeviceSource.cpp.

References mitk::IGTLMessageSource::GetOutput(), mitk::IGTLDeviceSource::m_IGTLDevice, m_trackingDataType, MITK_INFO, MITK_WARN, QTDATA, mitk::IGTLMessage::SetMessage(), mitk::IGTLMessage::SetName(), TDATA, TRANSFORM, and UNKNOWN.

◆ GettrackingDataType()

virtual TrackingMessageType mitk::IGTLTrackingDataDeviceSource::GettrackingDataType ( ) const
virtual

◆ mitkClassMacro()

mitk::IGTLTrackingDataDeviceSource::mitkClassMacro ( IGTLTrackingDataDeviceSource  ,
IGTLDeviceSource   
)

◆ New()

static Pointer mitk::IGTLTrackingDataDeviceSource::New ( )
static

◆ SettrackingDataType()

virtual void mitk::IGTLTrackingDataDeviceSource::SettrackingDataType ( TrackingMessageType  _arg)
virtual

Sets the tracking data type the source should listen to. If it is set to unknown (default) it listens to all tracking data message types.

Member Data Documentation

◆ m_trackingDataType

TrackingMessageType mitk::IGTLTrackingDataDeviceSource::m_trackingDataType
protected

Definition at line 53 of file mitkIGTLTrackingDataDeviceSource.h.

Referenced by GenerateData().


The documentation for this class was generated from the following files: