Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef _QMITKTOFRECORDERWIDGET_H_INCLUDED
18 #define _QMITKTOFRECORDERWIDGET_H_INCLUDED
19 
20 #include <MitkToFUIExports.h>
21 #include <ui_QmitkToFRecorderWidgetControls.h>
22 
23 //QT headers
24 #include <QWidget>
25 #include <QString>
26 #include <QDialog>
27 #include <QFileDialog>
28 
29 //itk headers
30 #include "itkCommand.h"
31 
32 //mitk headers
33 #include <mitkToFImageGrabber.h>
34 #include <mitkToFImageRecorder.h>
35 
37 
38 struct QFileDialogArgs;
39 class QFileIconProvider;
40 class QFileDialogPrivate;
41 
47 class MITKTOFUI_EXPORT QmitkToFRecorderWidget :public QWidget
48 {
49 
50  //this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
51  Q_OBJECT
52 
53  public:
54 
55  static const std::string VIEW_ID;
56 
57  QmitkToFRecorderWidget(QWidget* p = 0, Qt::WindowFlags f1 = 0);
58  virtual ~QmitkToFRecorderWidget();
59 
60  /* @brief This method is part of the widget an needs not to be called seperately. */
61  virtual void CreateQtPartControl(QWidget *parent);
62  /* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
63  virtual void CreateConnections();
64 
70  void SetParameter(mitk::ToFImageGrabber* ToFImageGrabber, mitk::ToFImageRecorder* toFImageRecorder);
74  void ResetGUIToInitial();
75 
76  signals:
80  void ToFCameraStarted();
84  void ToFCameraStopped();
88  void RecordingStarted();
92  void RecordingStopped();
93 
94  public slots:
99  void OnPlay();
104  void OnStop();
109  void OnStartRecorder();
113  void OnRecordingStopped();
117  void OnChangeRecordModeComboBox(int index);
118 
119  protected:
120 
124  void StartCamera();
128  void StopCamera();
132  void StopRecorder();
136  void StopRecordingCallback();
143  static QString getSaveFileName(mitk::ToFImageWriter::ToFImageType& tofImageType,
144  bool& distanceImageSelected,
145  bool& amplitudeImageSelected,
146  bool& intensityImageSelected,
147  bool& rgbImageSelected,
148  bool& rawDataSelected,
149  QWidget *parent = 0,
150  const QString &caption = QString(),
151  const QString &dir = QString(),
152  const QString &filter = QString(),
153  QString *selectedFilter = 0,
154  QFileDialog::Options options = 0
155  );
167  std::string prepareFilename(std::string dir,
168  std::string baseFilename,
169  std::string modulationFreq,
170  std::string integrationTime,
171  std::string numOfFrames,
172  std::string extension,
173  std::string imageType);
174 
175  Ui::QmitkToFRecorderWidgetControls* m_Controls;
176 
179 
181 
182  typedef itk::SimpleMemberCommand<QmitkToFRecorderWidget> CommandType;
184 
185  private:
186 
187 };
188 
189 #endif // _QMITKTOFRECORDERWIDGET_H_INCLUDED
itk::SmartPointer< Self > Pointer
mitk::ToFImageRecorder::RecordMode m_RecordMode
member holding the RecordMode of the recorder (PerFrame / Infinite)
CommandType::Pointer m_StopRecordingCommand
itkCommand for abort of recording
Recorder class for ToF images.
Ui::QmitkToFRecorderWidgetControls * m_Controls
member holding the UI elements of this widget
Image source providing ToF images. Interface for filters provided in ToFProcessing module...
static const std::string VIEW_ID
itk::SimpleMemberCommand< QmitkToFRecorderWidget > CommandType
mitk::ToFImageRecorder::Pointer m_ToFImageRecorder
member holding the recorder for ToF images
Widget allowing to play / record ToF data.
mitk::ToFImageGrabber::Pointer m_ToFImageGrabber
member holding the ToFImageGrabber for acquiring ToF images