Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 
18 #ifndef MITKIGTLMESSAGESOURCE_H_HEADER_INCLUDED_
19 #define MITKIGTLMESSAGESOURCE_H_HEADER_INCLUDED_
20 
21 #include <itkProcessObject.h>
22 #include "mitkPropertyList.h"
23 #include "MitkOpenIGTLinkExports.h"
24 #include "mitkIGTLMessage.h"
25 
26 // Microservices
27 #include <mitkServiceInterface.h>
28 #include <usServiceRegistration.h>
29 
30 //itk
31 #include <itkFastMutexLock.h>
32 
33 namespace mitk {
34 
46  class MITKOPENIGTLINK_EXPORT IGTLMessageSource : public itk::ProcessObject
47  {
48  public:
49  mitkClassMacroItkParent(IGTLMessageSource, itk::ProcessObject);
50 
55  itkGetMacro(Name,std::string);
56 
61  itkSetMacro(Name,std::string);
62 
68  itkGetMacro(Type,std::string);
69 
75  itkSetMacro(Type,std::string);
76 
80  IGTLMessage* GetOutput(void);
81 
85  IGTLMessage* GetOutput(DataObjectPointerArraySizeType idx);
86 
90  IGTLMessage* GetOutput(const std::string& messageName);
91 
99  DataObjectPointerArraySizeType GetOutputIndex(std::string messageName);
100 
105  virtual void RegisterAsMicroservice();
106 
111  virtual void UnRegisterMicroservice();
112 
118  std::string GetMicroserviceID();
119 
123  static const std::string US_INTERFACE_NAME;
124  static const std::string US_PROPKEY_DEVICENAME;
125  static const std::string US_PROPKEY_DEVICETYPE;
126  static const std::string US_PROPKEY_ID;
127  static const std::string US_PROPKEY_ISACTIVE; //NOT IMPLEMENTED YET!
128 
134  virtual void GraftNthOutput(unsigned int idx, itk::DataObject *graft);
135 
141  virtual void GraftOutput(itk::DataObject *graft);
142 
149  virtual itk::DataObject::Pointer MakeOutput ( DataObjectPointerArraySizeType idx ) override;
150 
157  virtual itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
158 
167  virtual void SetParameters(const mitk::PropertyList*){};
168 
182  virtual mitk::PropertyList::ConstPointer GetParameters() const;
183 
187  void SetFPS(unsigned int fps);
188 
192  unsigned int GetFPS();
193 
194  protected:
196  virtual ~IGTLMessageSource();
197 
198  std::string m_Name;
199  std::string m_Type;
200 
201 
205  unsigned int m_StreamingFPS;
206 
208  };
209 } // namespace mitk
210 // This is the microservice declaration. Do not meddle!
211 MITK_DECLARE_SERVICE_INTERFACE(mitk::IGTLMessageSource, "org.mitk.services.IGTLMessageSource")
212 #endif /* MITKIGTLMESSAGESOURCE_H_HEADER_INCLUDED_ */
itk::SmartPointer< Self > Pointer
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.
Key-value list holding instances of BaseProperty.
A wrapper for the OpenIGTLink message type.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
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.
MITK_DECLARE_SERVICE_INTERFACE(mitk::ISimulationService,"org.mitk.ISimulationService")