Medical Imaging Interaction Toolkit  2018.4.99-1640525a
Medical Imaging Interaction Toolkit
QmitkOpenCVVideoControls.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 QmitkOpenCVVideoControls_h
14 #define QmitkOpenCVVideoControls_h
15 
16 #include <ui_QmitkOpenCVVideoControls.h>
19 
20 #include "opencv2/core.hpp"
21 
22 class QmitkRenderWindow;
24 namespace mitk
25 {
26  class VideoSource;
27  class OpenCVVideoSource;
28 }
29 
30 class QmitkOpenCVVideoControlsPrivate;
31 
38 {
39  Q_OBJECT
40 
41 public:
45  QmitkOpenCVVideoControls(QmitkVideoBackground* _VideoBackground, QmitkRenderWindow* _RenderWindow
46  , QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
47 
51  ~QmitkOpenCVVideoControls() override;
52 
56  void SetRenderWindow(QmitkRenderWindow* _RenderWindow);
57 
61  QmitkRenderWindow* GetRenderWindow() const;
62 
66  void SetVideoBackground(QmitkVideoBackground* _VideoBackground);
67 
71  QmitkVideoBackground* GetVideoBackground() const;
72 
76  void AfterPropertyListReplaced(const std::string& id, mitk::PropertyList* propertyList) override;
77 
78 signals:
82  void NewOpenCVFrameAvailable(const IplImage*);
83 
84  protected slots:
85  void on_UseGrabbingDeviceButton_clicked(bool checked = false);
86  void on_UseVideoFileButton_clicked(bool checked = false);
87  void on_VideoProgressSlider_sliderPressed();
88  void on_VideoProgressSlider_sliderReleased();
89  void on_VideoProgressSlider_valueChanged(int value);
90  void on_RepeatVideoButton_clicked(bool checked = false);
91  void on_PlayButton_clicked(bool checked = false);
92  void on_StopButton_clicked(bool checked = false);
93  void Play();
94  void Stop();
95  void Reset();
96  void IsPlaying(bool paused);
97  void QObjectDestroyed(QObject * obj = nullptr);
98 
99  void NewFrameAvailable(mitk::VideoSource* videoSource);
100  void EndOfVideoSourceReached(mitk::VideoSource* videoSource);
101 
102 protected:
106  Ui::QmitkOpenCVVideoControls* m_Controls;
108 
109 private:
110 
111  friend class QmitkOpenCVVideoControlsPrivate;
112 
113  QScopedPointer<QmitkOpenCVVideoControlsPrivate> d;
114 };
115 
116 #endif
#define MITKOPENCVVIDEOSUPPORTUI_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
Key-value list holding instances of BaseProperty.
Ui::QmitkOpenCVVideoControls * m_Controls
Offers widgets to play/pause/stop a video on a certain render window with the use of an !initialized!...
MITK implementation of the QVTKWidget.
mitk::OpenCVVideoSource * m_VideoSource
QmitkVideoBackground * m_VideoBackground