Medical Imaging Interaction Toolkit  2018.4.99-b7f3afaa
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 //itk
27 #include <itkFastMutexLock.h>
28 
29 namespace mitk {
30 
42  class MITKOPENIGTLINK_EXPORT IGTLMessageSource : public itk::ProcessObject
43  {
44  public:
45  mitkClassMacroItkParent(IGTLMessageSource, itk::ProcessObject);
46 
51  itkGetMacro(Name,std::string);
52 
57  itkSetMacro(Name,std::string);
58 
64  itkGetMacro(Type,std::string);
65 
71  itkSetMacro(Type,std::string);
72 
76  IGTLMessage* GetOutput(void);
77 
81  IGTLMessage* GetOutput(DataObjectPointerArraySizeType idx);
82 
86  IGTLMessage* GetOutput(const std::string& messageName);
87 
95  DataObjectPointerArraySizeType GetOutputIndex(std::string messageName);
96 
101  virtual void RegisterAsMicroservice();
102 
107  virtual void UnRegisterMicroservice();
108 
114  std::string GetMicroserviceID();
115 
119  static const std::string US_INTERFACE_NAME;
120  static const std::string US_PROPKEY_DEVICENAME;
121  static const std::string US_PROPKEY_DEVICETYPE;
122  static const std::string US_PROPKEY_ID;
123  static const std::string US_PROPKEY_ISACTIVE; //NOT IMPLEMENTED YET!
124 
130  virtual void GraftNthOutput(unsigned int idx, itk::DataObject *graft);
131 
137  virtual void GraftOutput(itk::DataObject *graft);
138 
145  itk::DataObject::Pointer MakeOutput ( DataObjectPointerArraySizeType idx ) override;
146 
153  itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
154 
163  virtual void SetParameters(const mitk::PropertyList*){};
164 
178  virtual mitk::PropertyList::ConstPointer GetParameters() const;
179 
183  void SetFPS(unsigned int fps);
184 
188  unsigned int GetFPS();
189 
190  protected:
192  ~IGTLMessageSource() override;
193 
194  std::string m_Name;
195  std::string m_Type;
196 
197 
199  itk::FastMutexLock::Pointer m_StreamingFPSMutex;
201  unsigned int m_StreamingFPS;
202 
204  };
205 } // namespace mitk
206 // This is the microservice declaration. Do not meddle!
207 MITK_DECLARE_SERVICE_INTERFACE(mitk::IGTLMessageSource, "org.mitk.services.IGTLMessageSource")
208 #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:49
static const std::string US_PROPKEY_DEVICETYPE
OpenIGTLink message source.
itk::FastMutexLock::Pointer m_StreamingFPSMutex
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.