Medical Imaging Interaction Toolkit  2022.04.99-b3e02403
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_HEADER_INCLUDED_
15 #define MITKIGTLMESSAGESOURCE_H_HEADER_INCLUDED_
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 /* MITKIGTLMESSAGESOURCE_H_HEADER_INCLUDED_ */
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
static const std::string US_PROPKEY_ISACTIVE
virtual void SetParameters(const mitk::PropertyList *)
Set all filter parameters as the PropertyList p.
us::ServiceRegistration< Self > m_ServiceRegistration
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKOPENIGTLINK_EXPORT
Key-value list holding instances of BaseProperty.
A wrapper for the OpenIGTLink message type.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
static const std::string US_PROPKEY_DEVICETYPE
OpenIGTLink message source.
static const std::string US_PROPKEY_ID
static const std::string US_PROPKEY_DEVICENAME
static const std::string US_INTERFACE_NAME
These Constants are used in conjunction with Microservices.