Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
QmitkToFRecorderWidget.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 QmitkToFRecorderWidget_h
14 #define QmitkToFRecorderWidget_h
15 
16 #include <MitkToFUIExports.h>
17 #include <ui_QmitkToFRecorderWidgetControls.h>
18 
19 //QT headers
20 #include <QWidget>
21 #include <QString>
22 #include <QDialog>
23 #include <QFileDialog>
24 
25 //itk headers
26 #include "itkCommand.h"
27 
28 //mitk headers
29 #include <mitkToFImageGrabber.h>
30 #include <mitkToFImageRecorder.h>
31 
32 struct QFileDialogArgs;
33 class QFileIconProvider;
34 class QFileDialogPrivate;
35 
41 class MITKTOFUI_EXPORT QmitkToFRecorderWidget :public QWidget
42 {
43 
44  //this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
45  Q_OBJECT
46 
47  public:
48 
49  static const std::string VIEW_ID;
50 
51  QmitkToFRecorderWidget(QWidget* p = nullptr, Qt::WindowFlags f1 = nullptr);
52  ~QmitkToFRecorderWidget() override;
53 
54  /* @brief This method is part of the widget an needs not to be called seperately. */
55  virtual void CreateQtPartControl(QWidget *parent);
56  /* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
57  virtual void CreateConnections();
58 
64  void SetParameter(mitk::ToFImageGrabber* ToFImageGrabber, mitk::ToFImageRecorder* toFImageRecorder);
68  void ResetGUIToInitial();
69 
70  signals:
74  void ToFCameraStarted();
78  void ToFCameraStopped();
82  void RecordingStarted();
86  void RecordingStopped();
87 
88  public slots:
93  void OnPlay();
98  void OnStop();
103  void OnStartRecorder();
107  void OnRecordingStopped();
111  void OnChangeRecordModeComboBox(int index);
112 
113  protected:
114 
118  void StartCamera();
122  void StopCamera();
126  void StopRecorder();
130  void StopRecordingCallback();
137  static QString getSaveFileName(mitk::ToFImageWriter::ToFImageType& tofImageType,
138  bool& distanceImageSelected,
139  bool& amplitudeImageSelected,
140  bool& intensityImageSelected,
141  bool& rgbImageSelected,
142  bool& rawDataSelected,
143  QWidget *parent = nullptr,
144  const QString &caption = QString(),
145  const QString &dir = QString(),
146  const QString &filter = QString(),
147  QString *selectedFilter = nullptr,
148  QFileDialog::Options options = nullptr
149  );
161  std::string prepareFilename(std::string dir,
162  std::string baseFilename,
163  std::string modulationFreq,
164  std::string integrationTime,
165  std::string numOfFrames,
166  std::string extension,
167  std::string imageType);
168 
169  Ui::QmitkToFRecorderWidgetControls* m_Controls;
170 
172  mitk::ToFImageRecorder::Pointer m_ToFImageRecorder;
173 
175 
176  typedef itk::SimpleMemberCommand<QmitkToFRecorderWidget> CommandType;
177  CommandType::Pointer m_StopRecordingCommand;
178 
179  private:
180 
181 };
182 
183 #endif
QmitkToFRecorderWidget::m_StopRecordingCommand
CommandType::Pointer m_StopRecordingCommand
itkCommand for abort of recording
Definition: QmitkToFRecorderWidget.h:177
mitk::ToFImageWriter::ToFImageType
ToFImageType
Definition: mitkToFImageWriter.h:76
QmitkToFRecorderWidget
Widget allowing to play / record ToF data.
Definition: QmitkToFRecorderWidget.h:41
QmitkToFRecorderWidget::m_Controls
Ui::QmitkToFRecorderWidgetControls * m_Controls
member holding the UI elements of this widget
Definition: QmitkToFRecorderWidget.h:169
QmitkToFRecorderWidget::VIEW_ID
static const std::string VIEW_ID
Definition: QmitkToFRecorderWidget.h:49
mitk::ToFImageRecorder::RecordMode
RecordMode
Definition: mitkToFImageRecorder.h:84
QmitkToFRecorderWidget::CommandType
itk::SimpleMemberCommand< QmitkToFRecorderWidget > CommandType
Definition: QmitkToFRecorderWidget.h:176
mitk::ToFImageGrabber
Image source providing ToF images. Interface for filters provided in ToFProcessing module.
Definition: mitkToFImageGrabber.h:34
QmitkToFRecorderWidget::m_ToFImageRecorder
mitk::ToFImageRecorder::Pointer m_ToFImageRecorder
member holding the recorder for ToF images
Definition: QmitkToFRecorderWidget.h:172
mitkToFImageRecorder.h
QmitkToFRecorderWidget::m_ToFImageGrabber
mitk::ToFImageGrabber::Pointer m_ToFImageGrabber
member holding the ToFImageGrabber for acquiring ToF images
Definition: QmitkToFRecorderWidget.h:171
mitk::ToFImageRecorder
Recorder class for ToF images.
Definition: mitkToFImageRecorder.h:44
mitk::ImageSource::Pointer
itk::SmartPointer< Self > Pointer
Definition: mitkImageSource.h:39
mitkToFImageGrabber.h
QmitkToFRecorderWidget::m_RecordMode
mitk::ToFImageRecorder::RecordMode m_RecordMode
member holding the RecordMode of the recorder (PerFrame / Infinite)
Definition: QmitkToFRecorderWidget.h:174