Medical Imaging Interaction Toolkit  2018.4.99-1640525a
Medical Imaging Interaction Toolkit
mitkIGTLDeviceSource.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 #ifndef IGTLDEVICESOURCE_H_HEADER_INCLUDED_
14 #define IGTLDEVICESOURCE_H_HEADER_INCLUDED_
15 
16 #include "mitkIGTLDevice.h"
17 #include "mitkIGTLMessageSource.h"
18 
19 namespace mitk {
31  {
32  public:
34  itkFactorylessNewMacro(Self);
35  itkCloneMacro(Self);
36 
40  static const std::string US_PROPKEY_IGTLDEVICENAME;
41 
45  virtual void SetIGTLDevice(mitk::IGTLDevice* td);
46 
50  itkGetObjectMacro(IGTLDevice, mitk::IGTLDevice);
51 
56  void RegisterAsMicroservice() override;
57 
65  void Connect();
66 
73  void Disconnect();
74 
83  void StartCommunication();
84 
91  void StopCommunication();
92 
97  virtual bool IsConnected();
98 
103  virtual bool IsCommunicating();
104 
108  void UpdateOutputInformation() override;
109 
110  protected:
112  ~IGTLDeviceSource() override;
113 
122  void GenerateData() override;
123 
130  void CreateOutputs();
131 
136  virtual void OnIncomingMessage();
137 
142  virtual void OnIncomingCommand();
143 
147  virtual void OnLostConnection();
148 
152  virtual void RemoveObservers();
153 
154 
155  using Superclass::SetInput;
156 
161  virtual void SetInput( unsigned int idx, const IGTLMessage* msg );
162 
166  const IGTLMessage* GetInput(void) const;
167 
171  const IGTLMessage* GetInput(unsigned int idx) const;
172 
176  const IGTLMessage* GetInput(std::string msgName) const;
177 
185  DataObjectPointerArraySizeType GetInputIndex(std::string msgName);
186 
194  DataObjectPointerArraySizeType GetOutputIndex(std::string msgName);
195 
197  mitk::IGTLDevice::Pointer m_IGTLDevice;
198 
203  };
204 } // namespace mitk
205 #endif /* MITKIGTLDeviceSource_H_HEADER_INCLUDED_ */
static const std::string US_PROPKEY_IGTLDEVICENAME
These Constants are used in conjunction with Microservices.
unsigned int m_IncomingCommandObserverTag
Connects a mitk::IGTLDevice to a MITK-OpenIGTLink-Message-Filter-Pipeline.
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKOPENIGTLINK_EXPORT
mitk::IGTLDevice::Pointer m_IGTLDevice
A wrapper for the OpenIGTLink message type.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
unsigned int m_LostConnectionObserverTag
OpenIGTLink message source.
Interface for all OpenIGTLink Devices.
unsigned int m_IncomingMessageObserverTag