Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
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 QmitkOpenCVVideoControls_h
18 #define QmitkOpenCVVideoControls_h
19 
20 #include <cv.h>
21 #include <ui_QmitkOpenCVVideoControls.h>
22 #include <MitkOpenCVVideoSupportUIExports.h>
24 
25 class QmitkRenderWindow;
27 namespace mitk
28 {
29  class VideoSource;
30  class OpenCVVideoSource;
31 }
32 
33 class QmitkOpenCVVideoControlsPrivate;
34 
40 class MITKOPENCVVIDEOSUPPORTUI_EXPORT QmitkOpenCVVideoControls : public QWidget, public mitk::PropertyListReplacedObserver
41 {
42  Q_OBJECT
43 
44 public:
48  QmitkOpenCVVideoControls(QmitkVideoBackground* _VideoBackground, QmitkRenderWindow* _RenderWindow
49  , QWidget* parent = 0, Qt::WindowFlags f = 0);
50 
54  virtual ~QmitkOpenCVVideoControls();
55 
59  void SetRenderWindow(QmitkRenderWindow* _RenderWindow);
60 
64  QmitkRenderWindow* GetRenderWindow() const;
65 
69  void SetVideoBackground(QmitkVideoBackground* _VideoBackground);
70 
74  QmitkVideoBackground* GetVideoBackground() const;
75 
79  void AfterPropertyListReplaced( const std::string& id, mitk::PropertyList* propertyList ) override;
80 
81 signals:
85  void NewOpenCVFrameAvailable(const IplImage*);
86 
87 protected slots:
88  void on_UseGrabbingDeviceButton_clicked(bool checked=false);
89  void on_UseVideoFileButton_clicked(bool checked=false);
90  void on_VideoProgressSlider_sliderPressed();
91  void on_VideoProgressSlider_sliderReleased();
92  void on_RepeatVideoButton_clicked( bool checked=false );
93  void on_PlayButton_clicked(bool checked=false);
94  void on_StopButton_clicked(bool checked=false);
95  void Play();
96  void Stop();
97  void Reset();
98  void SwitchPlayButton(bool paused);
99  void QObjectDestroyed( QObject * obj = 0 );
100 
101  void NewFrameAvailable(mitk::VideoSource* videoSource);
102  void EndOfVideoSourceReached(mitk::VideoSource* videoSource);
103 
104 protected:
108  Ui::QmitkOpenCVVideoControls* m_Controls;
110 
111 private:
112 
113  friend class QmitkOpenCVVideoControlsPrivate;
114 
115  QScopedPointer<QmitkOpenCVVideoControlsPrivate> d;
116 
117 };
118 
119 #endif
virtual void AfterPropertyListReplaced(const std::string &id, mitk::PropertyList *propertyList)
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