NorMIT-nav  22.09
An IGT application
cxVideoGraphics.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 
13 #ifndef CXVIDEOGRAPHICS_H_
14 #define CXVIDEOGRAPHICS_H_
15 
16 #include "cxResourceVisualizationExport.h"
17 
18 #include "vtkForwardDeclarations.h"
19 #include "cxForwardDeclarations.h"
20 
21 typedef vtkSmartPointer<class vtkTransformTextureCoords> vtkTransformTextureCoordsPtr;
22 typedef vtkSmartPointer<class vtkDataSetMapper> vtkDataSetMapperPtr;
23 typedef vtkSmartPointer<class vtkImageMask> vtkImageMaskPtr;
24 typedef vtkSmartPointer<class UltrasoundSectorSource> UltrasoundSectorSourcePtr;
25 
26 namespace cx
27 {
28 typedef boost::shared_ptr<class VideoSourceGraphics> VideoSourceGraphicsPtr;
29 
41 class cxResourceVisualization_EXPORT VideoGraphics
42 {
43 public:
44  VideoGraphics();
45  virtual ~VideoGraphics();
46 
47  vtkActorPtr getActor();
48  void setActorUserMatrix(vtkMatrix4x4Ptr rMu);
49  void setVisibility(bool visible);
54  void setFlipVertical(bool on);
55  bool getFlipVertical();
56 
62  void setMask(vtkImageDataPtr mask);
63 
69  void setClip(vtkPolyDataPtr sector);
70 
73  void setInputVideo(vtkImageDataPtr video);
74 
77  void update();
78 
79 private:
80  void setLookupTable();
81 
82  void setupPipeline();
83  void connectVideoImageToPipeline();
84  void updatePlaneSourceBounds();
85  void updateLUT();
86  bool inputImageIsEmpty();
87 
88  vtkImageDataPtr mInputMask;
89  vtkPolyDataPtr mInputSector;
90  vtkImageDataPtr mInputVideo;
91 
92  vtkLookupTablePtr mLUT;
93  vtkImageChangeInformationPtr mDataRedirecter;
94  vtkActorPtr mPlaneActor;
95  vtkPlaneSourcePtr mPlaneSource;
96  vtkTexturePtr mTexture;
97  UltrasoundSectorSourcePtr mUSSource;
98  vtkDataSetMapperPtr mDataSetMapper;
99  vtkTransformTextureCoordsPtr mTransformTextureCoords;
100  vtkTextureMapToPlanePtr mTextureMapToPlane;
101 
102  vtkImageThresholdPtr mMapZeroToOne;
103  vtkImageMaskPtr mMaskFilter;
104 };
105 typedef boost::shared_ptr<VideoGraphics> VideoGraphicsPtr;
106 
107 } // namespace cx
108 
109 #endif // CXVIDEOGRAPHICS_H_
vtkMatrix4x4Ptr
vtkSmartPointer< class vtkMatrix4x4 > vtkMatrix4x4Ptr
Definition: cxMathBase.h:37
vtkDataSetMapperPtr
vtkSmartPointer< vtkDataSetMapper > vtkDataSetMapperPtr
Definition: cxVideoConnection.cpp:27
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxForwardDeclarations.h
vtkImageMaskPtr
vtkSmartPointer< vtkImageMask > vtkImageMaskPtr
Definition: cxTemporalCalibration.cpp:35
vtkImageThresholdPtr
vtkSmartPointer< class vtkImageThreshold > vtkImageThresholdPtr
Definition: vtkForwardDeclarations.h:81
vtkTransformTextureCoordsPtr
vtkSmartPointer< class vtkTransformTextureCoords > vtkTransformTextureCoordsPtr
Definition: cxVideoGraphics.h:21
vtkImageMaskPtr
vtkSmartPointer< class vtkImageMask > vtkImageMaskPtr
Definition: cxVideoGraphics.h:23
vtkImageDataPtr
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
Definition: cxVideoConnectionWidget.h:30
cx::VideoSourceGraphicsPtr
boost::shared_ptr< class VideoSourceGraphics > VideoSourceGraphicsPtr
Definition: cxVideoGraphics.h:28
vtkPlaneSourcePtr
vtkSmartPointer< class vtkPlaneSource > vtkPlaneSourcePtr
Definition: vtkForwardDeclarations.h:107
UltrasoundSectorSourcePtr
vtkSmartPointer< class UltrasoundSectorSource > UltrasoundSectorSourcePtr
Definition: cxVideoGraphics.h:24
vtkForwardDeclarations.h
cx::VideoGraphics
Wrap vtkActor displaying a video image, possibly clipped by a sector.
Definition: cxVideoGraphics.h:41
vtkDataSetMapperPtr
vtkSmartPointer< class vtkDataSetMapper > vtkDataSetMapperPtr
Definition: cxVideoGraphics.h:22
cx::VideoGraphicsPtr
boost::shared_ptr< VideoGraphics > VideoGraphicsPtr
Definition: cxVideoGraphics.h:105
cx::vtkPolyDataPtr
vtkSmartPointer< vtkPolyData > vtkPolyDataPtr
Definition: cxCenterlineRegistration.h:42
vtkActorPtr
vtkSmartPointer< class vtkActor > vtkActorPtr
Definition: vtkForwardDeclarations.h:31
vtkTextureMapToPlanePtr
vtkSmartPointer< class vtkTextureMapToPlane > vtkTextureMapToPlanePtr
Definition: vtkForwardDeclarations.h:137
vtkImageChangeInformationPtr
vtkSmartPointer< vtkImageChangeInformation > vtkImageChangeInformationPtr
Definition: cxImage.cpp:46
vtkTexturePtr
vtkSmartPointer< class vtkTexture > vtkTexturePtr
Definition: vtkForwardDeclarations.h:140
vtkLookupTablePtr
vtkSmartPointer< class vtkLookupTable > vtkLookupTablePtr
Definition: vtkForwardDeclarations.h:88
vtkTransformTextureCoordsPtr
vtkSmartPointer< class vtkTransformTextureCoords > vtkTransformTextureCoordsPtr
Definition: vtkForwardDeclarations.h:144