Medical Imaging Interaction Toolkit  2023.04.00
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>
17 #include <MitkOpenCVVideoSupportUIExports.h>
19 
20 #include <opencv2/core.hpp>
21 #include <opencv2/core/types_c.h>
22 
23 class QmitkRenderWindow;
25 namespace mitk
26 {
27  class VideoSource;
28  class OpenCVVideoSource;
29 }
30 
31 class QmitkOpenCVVideoControlsPrivate;
32 
38 class MITKOPENCVVIDEOSUPPORTUI_EXPORT QmitkOpenCVVideoControls : public QWidget, public mitk::PropertyListReplacedObserver
39 {
40  Q_OBJECT
41 
42 public:
46  QmitkOpenCVVideoControls(QmitkVideoBackground* _VideoBackground, QmitkRenderWindow* _RenderWindow
47  , QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
48 
52  ~QmitkOpenCVVideoControls() override;
53 
57  void SetRenderWindow(QmitkRenderWindow* _RenderWindow);
58 
62  QmitkRenderWindow* GetRenderWindow() const;
63 
67  void SetVideoBackground(QmitkVideoBackground* _VideoBackground);
68 
72  QmitkVideoBackground* GetVideoBackground() const;
73 
77  void AfterPropertyListReplaced(const std::string& id, mitk::PropertyList* propertyList) override;
78 
79 signals:
83  void NewOpenCVFrameAvailable(const IplImage*);
84 
85  protected slots:
86  void on_UseGrabbingDeviceButton_clicked(bool checked = false);
87  void on_UseVideoFileButton_clicked(bool checked = false);
88  void on_VideoProgressSlider_sliderPressed();
89  void on_VideoProgressSlider_sliderReleased();
90  void on_VideoProgressSlider_valueChanged(int value);
91  void on_RepeatVideoButton_clicked(bool checked = false);
92  void on_PlayButton_clicked(bool checked = false);
93  void on_StopButton_clicked(bool checked = false);
94  void Play();
95  void Stop();
96  void Reset();
97  void IsPlaying(bool paused);
98  void QObjectDestroyed(QObject * obj = nullptr);
99 
100  void NewFrameAvailable(mitk::VideoSource* videoSource);
101  void EndOfVideoSourceReached(mitk::VideoSource* videoSource);
102 
103 protected:
107  Ui::QmitkOpenCVVideoControls* m_Controls;
109 
110 private:
111 
112  friend class QmitkOpenCVVideoControlsPrivate;
113 
114  QScopedPointer<QmitkOpenCVVideoControlsPrivate> d;
115 };
116 
117 #endif
QmitkVideoBackground
Definition: QmitkVideoBackground.h:41
mitk::PropertyListReplacedObserver
Definition: mitkPropertyListReplacedObserver.h:28
QmitkRenderWindow
MITK implementation of the QVTKWidget.
Definition: QmitkRenderWindow.h:38
QmitkOpenCVVideoControls::m_VideoSource
mitk::OpenCVVideoSource * m_VideoSource
Definition: QmitkOpenCVVideoControls.h:106
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitkPropertyListReplacedObserver.h
QmitkOpenCVVideoControls::m_SliderCurrentlyMoved
bool m_SliderCurrentlyMoved
Definition: QmitkOpenCVVideoControls.h:108
QmitkOpenCVVideoControls::m_RenderWindow
QmitkRenderWindow * m_RenderWindow
Definition: QmitkOpenCVVideoControls.h:105
mitk::OpenCVVideoSource
Definition: mitkOpenCVVideoSource.h:39
mitk::VideoSource
Definition: mitkVideoSource.h:27
QmitkOpenCVVideoControls
Offers widgets to play/pause/stop a video on a certain render window with the use of an !...
Definition: QmitkOpenCVVideoControls.h:38
mitk::PropertyList
Key-value list holding instances of BaseProperty.
Definition: mitkPropertyList.h:64
mitk::PropertyListReplacedObserver::AfterPropertyListReplaced
virtual void AfterPropertyListReplaced(const std::string &id, mitk::PropertyList *propertyList)
QmitkOpenCVVideoControls::m_VideoBackground
QmitkVideoBackground * m_VideoBackground
Definition: QmitkOpenCVVideoControls.h:104
QmitkOpenCVVideoControls::m_Controls
Ui::QmitkOpenCVVideoControls * m_Controls
Definition: QmitkOpenCVVideoControls.h:107