Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
QmitkUSNewVideoDeviceWidget.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 QmitkUSNewVideoDeviceWidget_h
14 #define QmitkUSNewVideoDeviceWidget_h
15 
16 #include "MitkUSUIExports.h"
17 #include "ui_QmitkUSNewVideoDeviceWidgetControls.h"
18 #include "mitkUSVideoDevice.h"
19 #include "mitkUSIGTLDevice.h"
20 #include "mitkUSDeviceReaderXML.h"
21 
22 //QT headers
23 #include <QWidget>
24 #include <QListWidgetItem>
25 
26 //mitk header
27 
33 class MITKUSUI_EXPORT QmitkUSNewVideoDeviceWidget :public QWidget
34 {
35  //this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
36  Q_OBJECT
37 
38 public:
39 
40  static const std::string VIEW_ID;
41 
42  QmitkUSNewVideoDeviceWidget(QWidget* p = nullptr, Qt::WindowFlags f1 = nullptr);
43  ~QmitkUSNewVideoDeviceWidget() override;
44 
45  /* @brief This method is part of the widget an needs not to be called seperately. */
46  virtual void CreateQtPartControl(QWidget *parent);
47  /* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
48  virtual void CreateConnections();
49 
50 signals:
51 
52  void Finished();
53 
54  public slots:
55 
56  /*
57  \brief Activates the widget and displays the given device's Data to edit.
58  */
59  void EditDevice(mitk::USDevice::Pointer device);
60 
61  /*
62  \brief Activates the widget with fields empty.
63  */
64  void CreateNewDevice();
65 
66  protected slots:
67 
68  /*
69  \brief Called, when the the user clicks the "Done" button (Labeled either "Add Device" or "Edit Device", depending on the situation.
70  */
71  void OnClickedDone();
72 
73  void OnClickedFinishedEditing();
74 
75  /*
76  \brief Called, when the button "Cancel" was clicked
77  */
78  void OnClickedCancel();
79 
80  /*
81  \brief Called, when the Use selects one of the Radiobuttons
82  */
83  void OnDeviceTypeSelection();
84 
85  void OnOpenFileButtonClicked();
86 
87  void OnClickedRemoveProbe();
88 
89  void OnClickedRemoveDepth();
90 
91  void OnClickedAddDepths();
92 
93  void OnProbeChanged(const QString & probename);
94 
95  void OnDepthChanged(int depth, mitk::USProbe::Pointer probe);
96 
97  void OnDepthChanged(const QString &depth);
98 
99  void OnSaveButtonClicked();
100 
101  void OnLoadConfigurationButtonClicked();
102 
103  void OnAddNewProbeClicked();
104 
105  void OnXSpacingSpinBoxChanged(double value);
106 
107  void OnYSpacingSpinBoxChanged(double value);
108 
109  void OnCroppingTopSpinBoxChanged(int value);
110 
111  void OnCroppingRightSpinBoxChanged(int value);
112 
113  void OnCroppingBottomSpinBoxChanged(int value);
114 
115  void OnCroppingLeftSpinBoxChanged(int value);
116 
117 protected:
118 
119  Ui::QmitkUSNewVideoDeviceWidgetControls* m_Controls;
120 
121  /*
122  \brief Constructs a ListItem from the given device for display in the list of active devices
123  */
124  QListWidgetItem* ConstructItemFromDevice(mitk::USDevice::Pointer device);
125 
126  void ChangeUIEditingUSVideoDevice();
127 
128  void CleanUpAfterEditingOfDevice();
129 
130  void CleanUpAfterCreatingNewDevice();
131 
132  void AddProbesToDevice(mitk::USDevice::Pointer device);
133 
134  mitk::USProbe::Pointer CheckIfProbeExistsAlready(const std::string &probe);
135 
136  void CollectUltrasoundDeviceConfigInformation(mitk::USDeviceReaderXML::USDeviceConfigData &config);
137 
142  void EnableDisableSpacingAndCropping(bool enable);
143 
144  /*
145  \brief Displays whether this widget is active or not. It gets activated by either sending a Signal to
146  * the "CreateNewDevice" Slot or to the "EditDevice" Slot. If the user finishes editing the device, a
147  * "EditingComplete" Signal is sent, and the widget is set to inactive again. Clicking Cancel also
148  * deactivates it.
149  */
150  bool m_Active;
151 
157 
162  std::vector<mitk::USProbe::Pointer> m_ConfigProbes;
163 };
164 
165 #endif
QmitkUSNewVideoDeviceWidget::m_Controls
Ui::QmitkUSNewVideoDeviceWidgetControls * m_Controls
member holding the UI elements of this widget
Definition: QmitkUSNewVideoDeviceWidget.h:119
mitk::USDeviceReaderXML::USDeviceConfigData_
Definition: mitkUSDeviceReaderXML.h:40
QmitkUSNewVideoDeviceWidget::m_TargetDevice
mitk::USDevice::Pointer m_TargetDevice
This is the device to edit. It is either the device transmitted in the "EditDevice" signal,...
Definition: QmitkUSNewVideoDeviceWidget.h:156
QmitkUSNewVideoDeviceWidget::VIEW_ID
static const std::string VIEW_ID
Definition: QmitkUSNewVideoDeviceWidget.h:40
mitkUSIGTLDevice.h
mitkUSDeviceReaderXML.h
mitkUSVideoDevice.h
QmitkUSNewVideoDeviceWidget::m_ConfigProbes
std::vector< mitk::USProbe::Pointer > m_ConfigProbes
The config probes are used to have a possibility to configure ultrasound probes without having an exi...
Definition: QmitkUSNewVideoDeviceWidget.h:162
QmitkUSNewVideoDeviceWidget::m_Active
bool m_Active
Definition: QmitkUSNewVideoDeviceWidget.h:150
mitk::ImageSource::Pointer
itk::SmartPointer< Self > Pointer
Definition: mitkImageSource.h:39
QmitkUSNewVideoDeviceWidget
This Widget enables the USer to create and connect Video Devices.
Definition: QmitkUSNewVideoDeviceWidget.h:33