Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
QmitkIGTLStreamingManagementWidget.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 QmitkIGTLStreamingManagementWidget_h
14 #define QmitkIGTLStreamingManagementWidget_h
15 
16 //QT headers
17 #include <QWidget>
18 #include <QTimer>
19 
20 //mitk headers
21 #include "MitkOpenIGTLinkUIExports.h"
23 #include "mitkIGTLClient.h"
24 #include "mitkDataStorage.h"
25 
26 //itk
27 #include <itkCommand.h>
28 
29 //ui header
30 #include "ui_QmitkIGTLStreamingManagementWidgetControls.h"
31 
39 class MITKOPENIGTLINKUI_EXPORT QmitkIGTLStreamingManagementWidget : public QWidget
40 {
41  Q_OBJECT
42 
43  public:
44  static const std::string VIEW_ID;
45 
53  void LoadSource(mitk::IGTLMessageProvider::Pointer provider);
54 
55  QmitkIGTLStreamingManagementWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
57 
58 
59  protected slots:
60  void OnStartStreaming();
61  void OnStopStreaming();
62  void OnStreamingTimerTimeout();
63 
67  void SourceSelected(mitk::IGTLMessageSource::Pointer source);
68 
72  void AdaptGUIToState();
73 
77  void SelectSourceAndAdaptGUI();
78 
79  signals:
84  void AdaptGUIToStateSignal();
90  void SelectSourceAndAdaptGUISignal();
91 
92  protected:
93 
97  void OnMessageReceived();
98 
102  void OnCommandReceived();
103 
108  void OnLostConnection();
109 
113  void OnNewConnection();
114 
118  void OnStartStreamingTimer();
119 
123  void OnStopStreamingTimer();
124 
128  void OnDeviceStateChanged();
129 
131  void FillCommandsComboBox();
132 
134  virtual void CreateConnections();
135 
136  virtual void CreateQtPartControl(QWidget *parent);
137 
138  Ui::QmitkIGTLStreamingManagementWidgetControls* m_Controls;
139 
141  mitk::IGTLDevice::Pointer m_IGTLDevice;
142 
144  mitk::IGTLMessageProvider::Pointer m_IGTLMsgProvider;
145 
147  mitk::IGTLMessageSource::Pointer m_IGTLMsgSource;
148 
151 
154 
162 
163  //############## private help methods #######################
164  void DisableSourceControls();
165  void RemoveObserver();
166 };
167 #endif
QmitkIGTLStreamingManagementWidget::m_IGTLDevice
mitk::IGTLDevice::Pointer m_IGTLDevice
holds the OpenIGTLink device
Definition: QmitkIGTLStreamingManagementWidget.h:141
QmitkIGTLStreamingManagementWidget::m_StateModifiedObserverTag
unsigned long m_StateModifiedObserverTag
Definition: QmitkIGTLStreamingManagementWidget.h:159
QmitkIGTLStreamingManagementWidget::m_LostConnectionObserverTag
unsigned long m_LostConnectionObserverTag
Definition: QmitkIGTLStreamingManagementWidget.h:157
QmitkIGTLStreamingManagementWidget::m_StreamingTimer
QTimer m_StreamingTimer
the streaming timer that periodically calls the update method of the provider
Definition: QmitkIGTLStreamingManagementWidget.h:153
QmitkIGTLStreamingManagementWidget::VIEW_ID
static const std::string VIEW_ID
Definition: QmitkIGTLStreamingManagementWidget.h:44
mitkDataStorage.h
QmitkIGTLStreamingManagementWidget::m_MessageReceivedObserverTag
unsigned long m_MessageReceivedObserverTag
Definition: QmitkIGTLStreamingManagementWidget.h:155
QmitkIGTLStreamingManagementWidget::m_IGTLMsgSource
mitk::IGTLMessageSource::Pointer m_IGTLMsgSource
holds the IGTLDeviceSource we are working with.
Definition: QmitkIGTLStreamingManagementWidget.h:147
QmitkIGTLStreamingManagementWidget::m_IsClient
bool m_IsClient
flag to indicate if the IGTL device is a client or a server
Definition: QmitkIGTLStreamingManagementWidget.h:150
mitkIGTLClient.h
QmitkIGTLStreamingManagementWidget::m_IGTLMsgProvider
mitk::IGTLMessageProvider::Pointer m_IGTLMsgProvider
holds the IGTL Message Provider that will send the stream
Definition: QmitkIGTLStreamingManagementWidget.h:144
QmitkIGTLStreamingManagementWidget::m_Controls
Ui::QmitkIGTLStreamingManagementWidgetControls * m_Controls
Definition: QmitkIGTLStreamingManagementWidget.h:138
QmitkIGTLStreamingManagementWidget::m_CommandReceivedObserverTag
unsigned long m_CommandReceivedObserverTag
Definition: QmitkIGTLStreamingManagementWidget.h:156
QmitkIGTLStreamingManagementWidget::m_StartStreamingTimerObserverTag
unsigned long m_StartStreamingTimerObserverTag
Definition: QmitkIGTLStreamingManagementWidget.h:160
QmitkIGTLStreamingManagementWidget
An object of this class offers an UI to manage the streaming of message sources.
Definition: QmitkIGTLStreamingManagementWidget.h:39
mitkIGTLMessageProvider.h
QmitkIGTLStreamingManagementWidget::m_NewConnectionObserverTag
unsigned long m_NewConnectionObserverTag
Definition: QmitkIGTLStreamingManagementWidget.h:158
QmitkIGTLStreamingManagementWidget::m_StopStreamingTimerObserverTag
unsigned long m_StopStreamingTimerObserverTag
Definition: QmitkIGTLStreamingManagementWidget.h:161