NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkSingleVideoWidget.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkSingleVideoWidget_h
16 #define niftkSingleVideoWidget_h
17 
18 #include "niftkIGIOverlayEditorExports.h"
20 #include "niftkBitmapOverlay.h"
21 #include <mitkDataStorage.h>
22 #include <vtkSmartPointer.h>
23 #include <vtkMatrix4x4.h>
25 
26 namespace niftk
27 {
49 class NIFTKIGIOVERLAYEDITOR_EXPORT SingleVideoWidget : public Single3DViewWidget
50 {
51  Q_OBJECT
52 
53 public:
54 
55  SingleVideoWidget(QWidget* parent = 0,
56  Qt::WindowFlags f = 0,
57  mitk::RenderingManager* renderingManager = 0);
58 
59  virtual ~SingleVideoWidget();
60 
64  virtual void SetDataStorage(mitk::DataStorage* ds) override;
65 
69  virtual void SetImageNode(mitk::DataNode* node) override;
70 
74  virtual void Update() override;
75 
79  void SetUseOverlay(const bool& b);
80 
89  void SetTransformNode(const mitk::DataNode* node);
90 
94  float GetOpacity() const;
95 
100  void SetOpacity(const float& value);
101 
107  void SetEyeHandFileName(const std::string& fileName);
108 
109 protected:
110 
114  virtual void NodeRemoved(const mitk::DataNode* node) override;
115 
119  virtual void NodeChanged(const mitk::DataNode* node) override;
120 
124  virtual void NodeAdded(const mitk::DataNode* node) override;
125 
129  virtual void resizeEvent(QResizeEvent* event) override;
130 
131 private:
132 
136  void UpdateCameraIntrinsicParameters();
137 
146  void UpdateCameraViaTrackingTransformation();
147 
148  niftk::BitmapOverlay::Pointer m_BitmapOverlay;
149  mitk::DataNode::Pointer m_TransformNode;
150  vtkSmartPointer<vtkOpenGLMatrixDrivenCamera> m_MatrixDrivenCamera;
151  bool m_IsCalibrated;
152  bool m_UseOverlay;
153  std::string m_EyeHandFileName;
154  vtkSmartPointer<vtkMatrix4x4> m_EyeHandMatrix;
155 };
156 
157 } // end namespace
158 
159 #endif
Derived from niftk::Single3DViewWidget to provide a widget that given a video image, will render it at video frame rate into both the foreground and the background layer, and additionally merge VTK renderings.
Definition: niftkSingleVideoWidget.h:49
GLdouble GLdouble GLdouble b
Definition: glew.h:7885
Base class widget containing a single 3D render window whose purpose is to render a 3D VTK scene...
Definition: niftkSingle3DViewWidget.h:43
GLsizei const GLfloat * value
Definition: glew.h:1833
cl_event event
Definition: glew.h:3231
Definition: niftkExceptionObject.h:21
GLsizei const GLcharARB ** string
Definition: glew.h:5194
GLclampf f
Definition: glew.h:3136