Medical Imaging Interaction Toolkit  2023.04.00
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 mitkIGTLDeviceSource_h
14 #define mitkIGTLDeviceSource_h
15 
16 #include "mitkIGTLDevice.h"
17 #include "mitkIGTLMessageSource.h"
18 
19 namespace mitk {
30  class MITKOPENIGTLINK_EXPORT IGTLDeviceSource : public IGTLMessageSource
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
mitk::IGTLDeviceSource::m_LostConnectionObserverTag
unsigned int m_LostConnectionObserverTag
Definition: mitkIGTLDeviceSource.h:200
mitk::IGTLDeviceSource::m_IncomingMessageObserverTag
unsigned int m_IncomingMessageObserverTag
Definition: mitkIGTLDeviceSource.h:202
mitkIGTLMessageSource.h
mitk::IGTLDeviceSource::US_PROPKEY_IGTLDEVICENAME
static const std::string US_PROPKEY_IGTLDEVICENAME
These Constants are used in conjunction with Microservices.
Definition: mitkIGTLDeviceSource.h:35
mitk::IGTLMessageSource
OpenIGTLink message source.
Definition: mitkIGTLMessageSource.h:41
mitk::IGTLDeviceSource::m_IGTLDevice
mitk::IGTLDevice::Pointer m_IGTLDevice
Definition: mitkIGTLDeviceSource.h:197
mitk::IGTLMessage
A wrapper for the OpenIGTLink message type.
Definition: mitkIGTLMessage.h:35
mitk::IGTLDevice
Interface for all OpenIGTLink Devices.
Definition: mitkIGTLDevice.h:62
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::IGTLDeviceSource::m_IncomingCommandObserverTag
unsigned int m_IncomingCommandObserverTag
Definition: mitkIGTLDeviceSource.h:201
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::IGTLDeviceSource
Connects a mitk::IGTLDevice to a MITK-OpenIGTLink-Message-Filter-Pipeline.
Definition: mitkIGTLDeviceSource.h:30
mitkIGTLDevice.h