MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitk::IGTLMessageSource Class Reference

OpenIGTLink message source. More...

#include <mitkIGTLMessageSource.h>

Inheritance diagram for mitk::IGTLMessageSource:
mitk::IGTLDeviceSource mitk::ImageToIGTLMessageFilter mitk::NavigationDataToIGTLMessageFilter mitk::IGTL2DImageDeviceSource mitk::IGTL3DImageDeviceSource mitk::IGTLMessageProvider mitk::IGTLTrackingDataDeviceSource

Public Member Functions

 mitkClassMacroItkParent (IGTLMessageSource, itk::ProcessObject)
 
 itkGetMacro (Name, std::string)
 
 itkSetMacro (Name, std::string)
 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.
 
 itkGetMacro (Type, std::string)
 
 itkSetMacro (Type, std::string)
 Sets the human readable type of this source. There will be a default type, or you can set the name with the method SetType(). You have to set this parameter otherwise it will not be found by the message provider.
 
IGTLMessageGetOutput (void)
 return the output (output with id 0) of the filter
 
IGTLMessageGetOutput (DataObjectPointerArraySizeType idx)
 return the output with id idx of the filter
 
IGTLMessageGetOutput (const std::string &messageName)
 return the output with name messageName of the filter
 
DataObjectPointerArraySizeType GetOutputIndex (std::string messageName)
 return the index of the output with name messageName, -1 if no output with that name was found
 
virtual void RegisterAsMicroservice ()
 Registers this object as a Microservice, making it available to every module and/or plugin. To unregister, call UnregisterMicroservice().
 
virtual void UnRegisterMicroservice ()
 Registers this object as a Microservice, making it available to every module and/or plugin.
 
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().
 
virtual void GraftNthOutput (unsigned int idx, itk::DataObject *graft)
 Graft the specified DataObject onto this ProcessObject's output.
 
virtual void GraftOutput (itk::DataObject *graft)
 Graft the specified DataObject onto this ProcessObject's output.
 
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.
 
virtual mitk::PropertyList::ConstPointer GetParameters () const
 Get all filter parameters as a PropertyList.
 
void SetFPS (unsigned int fps)
 Sets the fps used for streaming this source.
 
unsigned int GetFPS ()
 Gets the fps used for streaming this source.
 

Static Public Attributes

static const std::string US_INTERFACE_NAME
 These Constants are used in conjunction with Microservices.
 
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
 

Protected Member Functions

 IGTLMessageSource ()
 
 ~IGTLMessageSource () override
 

Protected Attributes

std::string m_Name
 
std::string m_Type
 
std::mutex m_StreamingFPSMutex
 
unsigned int m_StreamingFPS
 
us::ServiceRegistration< Self > m_ServiceRegistration
 

Detailed Description

OpenIGTLink message source.

Base class for all OpenIGTLink filters that produce OpenIGTLink message objects as output. This class defines the output-interface for OpenIGTLinkMessageFilters.

Warning
: if Update() is called on any output object, all IGTLMessage filters will generate new output data for all outputs, not just the one on which Update() was called.

Definition at line 41 of file mitkIGTLMessageSource.h.

Constructor & Destructor Documentation

◆ IGTLMessageSource()

mitk::IGTLMessageSource::IGTLMessageSource ( )
protected

Definition at line 33 of file mitkIGTLMessageSource.cpp.

◆ ~IGTLMessageSource()

mitk::IGTLMessageSource::~IGTLMessageSource ( )
overrideprotected

Definition at line 39 of file mitkIGTLMessageSource.cpp.

Member Function Documentation

◆ GetFPS()

unsigned int mitk::IGTLMessageSource::GetFPS ( )

Gets the fps used for streaming this source.

Definition at line 190 of file mitkIGTLMessageSource.cpp.

◆ GetMicroserviceID()

std::string mitk::IGTLMessageSource::GetMicroserviceID ( )

Returns the id that this device is registered with. The id will only be valid, if the IGTLMessageSource has been registered using RegisterAsMicroservice().

Definition at line 124 of file mitkIGTLMessageSource.cpp.

◆ GetOutput() [1/3]

mitk::IGTLMessage * mitk::IGTLMessageSource::GetOutput ( const std::string & messageName)

return the output with name messageName of the filter

Definition at line 68 of file mitkIGTLMessageSource.cpp.

◆ GetOutput() [2/3]

mitk::IGTLMessage * mitk::IGTLMessageSource::GetOutput ( DataObjectPointerArraySizeType idx)

return the output with id idx of the filter

Definition at line 55 of file mitkIGTLMessageSource.cpp.

◆ GetOutput() [3/3]

mitk::IGTLMessage * mitk::IGTLMessageSource::GetOutput ( void )

return the output (output with id 0) of the filter

Definition at line 44 of file mitkIGTLMessageSource.cpp.

◆ GetOutputIndex()

itk::ProcessObject::DataObjectPointerArraySizeType mitk::IGTLMessageSource::GetOutputIndex ( std::string messageName)

return the index of the output with name messageName, -1 if no output with that name was found

Warning
if a subclass has outputs that have different data type than igtl::MessageBase, they have to overwrite this method

Definition at line 86 of file mitkIGTLMessageSource.cpp.

◆ GetParameters()

mitk::PropertyList::ConstPointer mitk::IGTLMessageSource::GetParameters ( ) const
virtual

Get all filter parameters as a PropertyList.

This method allows to get all parameters of a filter with one method call. The returned PropertyList must be assigned to a SmartPointer immediately, or else it will get destroyed. Every filter must overwrite this method to create a filter-specific PropertyList. Note that property names must be unique over all MITK-IGT filters. Therefore each filter should use its name as a prefix for each property name. Secondly, each filter should list the property names and data types in the method documentation.

Definition at line 174 of file mitkIGTLMessageSource.cpp.

◆ GraftNthOutput()

void mitk::IGTLMessageSource::GraftNthOutput ( unsigned int idx,
itk::DataObject * graft )
virtual

Graft the specified DataObject onto this ProcessObject's output.

See itk::ImageSource::GraftNthOutput for details

Definition at line 136 of file mitkIGTLMessageSource.cpp.

◆ GraftOutput()

void mitk::IGTLMessageSource::GraftOutput ( itk::DataObject * graft)
virtual

Graft the specified DataObject onto this ProcessObject's output.

See itk::ImageSource::Graft Output for details

Definition at line 131 of file mitkIGTLMessageSource.cpp.

◆ itkGetMacro() [1/2]

mitk::IGTLMessageSource::itkGetMacro ( Name ,
std::string  )
Returns
Returns a human readable name of this source. There will be a default name, or you can set the name with the method SetName() if you want to change it.

◆ itkGetMacro() [2/2]

mitk::IGTLMessageSource::itkGetMacro ( Type ,
std::string  )
Returns
Returns a human readable type of this source. There will be a default type, or you can set the name with the method SetType(). You have to set this parameter otherwise it will not be found by the message provider.

◆ itkSetMacro() [1/2]

mitk::IGTLMessageSource::itkSetMacro ( Name ,
std::string  )

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.

◆ itkSetMacro() [2/2]

mitk::IGTLMessageSource::itkSetMacro ( Type ,
std::string  )

Sets the human readable type of this source. There will be a default type, or you can set the name with the method SetType(). You have to set this parameter otherwise it will not be found by the message provider.

◆ MakeOutput() [1/2]

itk::DataObject::Pointer mitk::IGTLMessageSource::MakeOutput ( const DataObjectIdentifierType & name)
override

This is a default implementation to make sure we have something. Once all the subclasses of ProcessObject provide an appopriate MakeOutput(), then ProcessObject::MakeOutput() can be made pure virtual.

Definition at line 164 of file mitkIGTLMessageSource.cpp.

◆ MakeOutput() [2/2]

itk::DataObject::Pointer mitk::IGTLMessageSource::MakeOutput ( DataObjectPointerArraySizeType idx)
override

Allocates a new output object and returns it. Currently the index idx is not evaluated.

Parameters
idxthe index of the output for which an object should be created
Returns
the new object

Definition at line 159 of file mitkIGTLMessageSource.cpp.

◆ mitkClassMacroItkParent()

mitk::IGTLMessageSource::mitkClassMacroItkParent ( IGTLMessageSource ,
itk::ProcessObject  )

◆ RegisterAsMicroservice()

void mitk::IGTLMessageSource::RegisterAsMicroservice ( )
virtual

Registers this object as a Microservice, making it available to every module and/or plugin. To unregister, call UnregisterMicroservice().

Reimplemented in mitk::IGTLDeviceSource.

Definition at line 100 of file mitkIGTLMessageSource.cpp.

◆ SetFPS()

void mitk::IGTLMessageSource::SetFPS ( unsigned int fps)

Sets the fps used for streaming this source.

Definition at line 182 of file mitkIGTLMessageSource.cpp.

◆ SetParameters()

virtual void mitk::IGTLMessageSource::SetParameters ( const mitk::PropertyList * )
inlinevirtual

Set all filter parameters as the PropertyList p.

This method allows to set all parameters of a filter with one method call. For the names of the parameters, take a look at the GetParameters method of the filter This method has to be overwritten by each MITK-IGT filter.

Definition at line 162 of file mitkIGTLMessageSource.h.

◆ UnRegisterMicroservice()

void mitk::IGTLMessageSource::UnRegisterMicroservice ( )
virtual

Registers this object as a Microservice, making it available to every module and/or plugin.

Definition at line 115 of file mitkIGTLMessageSource.cpp.

Member Data Documentation

◆ m_Name

std::string mitk::IGTLMessageSource::m_Name
protected

Definition at line 193 of file mitkIGTLMessageSource.h.

◆ m_ServiceRegistration

us::ServiceRegistration<Self> mitk::IGTLMessageSource::m_ServiceRegistration
protected

Definition at line 202 of file mitkIGTLMessageSource.h.

◆ m_StreamingFPS

unsigned int mitk::IGTLMessageSource::m_StreamingFPS
protected

The frames per second used for streaming

Definition at line 200 of file mitkIGTLMessageSource.h.

◆ m_StreamingFPSMutex

std::mutex mitk::IGTLMessageSource::m_StreamingFPSMutex
protected

mutex to control access to m_StreamingFPS

Definition at line 198 of file mitkIGTLMessageSource.h.

◆ m_Type

std::string mitk::IGTLMessageSource::m_Type
protected

Definition at line 194 of file mitkIGTLMessageSource.h.

◆ US_INTERFACE_NAME

const std::string mitk::IGTLMessageSource::US_INTERFACE_NAME
static
Initial value:
=
"org.mitk.services.IGTLMessageSource"

These Constants are used in conjunction with Microservices.

Definition at line 118 of file mitkIGTLMessageSource.h.

◆ US_PROPKEY_DEVICENAME

const std::string mitk::IGTLMessageSource::US_PROPKEY_DEVICENAME
static
Initial value:
=
US_INTERFACE_NAME + ".devicename"
static const std::string US_INTERFACE_NAME
These Constants are used in conjunction with Microservices.

Definition at line 119 of file mitkIGTLMessageSource.h.

◆ US_PROPKEY_DEVICETYPE

const std::string mitk::IGTLMessageSource::US_PROPKEY_DEVICETYPE
static
Initial value:
=
US_INTERFACE_NAME + ".devicetype"

Definition at line 120 of file mitkIGTLMessageSource.h.

◆ US_PROPKEY_ID

const std::string mitk::IGTLMessageSource::US_PROPKEY_ID
static
Initial value:

Definition at line 121 of file mitkIGTLMessageSource.h.

◆ US_PROPKEY_ISACTIVE

const std::string mitk::IGTLMessageSource::US_PROPKEY_ISACTIVE
static
Initial value:
=
US_INTERFACE_NAME + ".isActive"

Definition at line 122 of file mitkIGTLMessageSource.h.


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