Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitkIGTLMessageSource.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 
14 #ifndef mitkIGTLMessageSource_h
15 #define mitkIGTLMessageSource_h
16 
17 #include <itkProcessObject.h>
18 #include "mitkPropertyList.h"
19 #include "MitkOpenIGTLinkExports.h"
20 #include "mitkIGTLMessage.h"
21 
22 // Microservices
23 #include <mitkServiceInterface.h>
24 #include <usServiceRegistration.h>
25 
26 #include <mutex>
27 
28 namespace mitk {
29 
41  class MITKOPENIGTLINK_EXPORT IGTLMessageSource : public itk::ProcessObject
42  {
43  public:
44  mitkClassMacroItkParent(IGTLMessageSource, itk::ProcessObject);
45 
50  itkGetMacro(Name,std::string);
51 
56  itkSetMacro(Name,std::string);
57 
63  itkGetMacro(Type,std::string);
64 
70  itkSetMacro(Type,std::string);
71 
75  IGTLMessage* GetOutput(void);
76 
80  IGTLMessage* GetOutput(DataObjectPointerArraySizeType idx);
81 
85  IGTLMessage* GetOutput(const std::string& messageName);
86 
94  DataObjectPointerArraySizeType GetOutputIndex(std::string messageName);
95 
100  virtual void RegisterAsMicroservice();
101 
106  virtual void UnRegisterMicroservice();
107 
113  std::string GetMicroserviceID();
114 
118  static const std::string US_INTERFACE_NAME;
119  static const std::string US_PROPKEY_DEVICENAME;
120  static const std::string US_PROPKEY_DEVICETYPE;
121  static const std::string US_PROPKEY_ID;
122  static const std::string US_PROPKEY_ISACTIVE; //NOT IMPLEMENTED YET!
123 
129  virtual void GraftNthOutput(unsigned int idx, itk::DataObject *graft);
130 
136  virtual void GraftOutput(itk::DataObject *graft);
137 
144  itk::DataObject::Pointer MakeOutput ( DataObjectPointerArraySizeType idx ) override;
145 
152  itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
153 
162  virtual void SetParameters(const mitk::PropertyList*){};
163 
177  virtual mitk::PropertyList::ConstPointer GetParameters() const;
178 
182  void SetFPS(unsigned int fps);
183 
187  unsigned int GetFPS();
188 
189  protected:
191  ~IGTLMessageSource() override;
192 
193  std::string m_Name;
194  std::string m_Type;
195 
196 
200  unsigned int m_StreamingFPS;
201 
203  };
204 } // namespace mitk
205 // This is the microservice declaration. Do not meddle!
206 MITK_DECLARE_SERVICE_INTERFACE(mitk::IGTLMessageSource, "org.mitk.services.IGTLMessageSource")
207 #endif
mitk::IGTLMessageSource::US_PROPKEY_DEVICENAME
static const std::string US_PROPKEY_DEVICENAME
Definition: mitkIGTLMessageSource.h:119
mitk::IGTLMessageSource::m_Name
std::string m_Name
Definition: mitkIGTLMessageSource.h:193
mitkServiceInterface.h
mitk::IGTLMessageSource::m_StreamingFPSMutex
std::mutex m_StreamingFPSMutex
Definition: mitkIGTLMessageSource.h:198
mitk::IGTLMessageSource::m_Type
std::string m_Type
Definition: mitkIGTLMessageSource.h:194
itk::SmartPointer< const Self >
mitk::IGTLMessageSource
OpenIGTLink message source.
Definition: mitkIGTLMessageSource.h:41
mitkClassMacroItkParent
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
mitk::IGTLMessage
A wrapper for the OpenIGTLink message type.
Definition: mitkIGTLMessage.h:35
mitk::IGTLMessageSource::SetParameters
virtual void SetParameters(const mitk::PropertyList *)
Set all filter parameters as the PropertyList p.
Definition: mitkIGTLMessageSource.h:162
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::IGTLMessageSource::US_INTERFACE_NAME
static const std::string US_INTERFACE_NAME
These Constants are used in conjunction with Microservices.
Definition: mitkIGTLMessageSource.h:118
mitkPropertyList.h
mitk::PropertyList
Key-value list holding instances of BaseProperty.
Definition: mitkPropertyList.h:64
usServiceRegistration.h
mitk::IGTLMessageSource::US_PROPKEY_ISACTIVE
static const std::string US_PROPKEY_ISACTIVE
Definition: mitkIGTLMessageSource.h:122
mitk::IGTLMessageSource::US_PROPKEY_DEVICETYPE
static const std::string US_PROPKEY_DEVICETYPE
Definition: mitkIGTLMessageSource.h:120
mitk::IGTLMessageSource::m_StreamingFPS
unsigned int m_StreamingFPS
Definition: mitkIGTLMessageSource.h:200
mitkIGTLMessage.h
us::ServiceRegistration< Self >
MITK_DECLARE_SERVICE_INTERFACE
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
Definition: mitkServiceInterface.h:26
mitk::IGTLMessageSource::US_PROPKEY_ID
static const std::string US_PROPKEY_ID
Definition: mitkIGTLMessageSource.h:121
mitk::IGTLMessageSource::m_ServiceRegistration
us::ServiceRegistration< Self > m_ServiceRegistration
Definition: mitkIGTLMessageSource.h:202