CustusX  2023.01.05-dev+develop.0da12
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_
vtkSmartPointer< class vtkImageThreshold > vtkImageThresholdPtr
vtkSmartPointer< class vtkMatrix4x4 > vtkMatrix4x4Ptr
Definition: cxMathBase.h:37
vtkSmartPointer< class vtkTexture > vtkTexturePtr
vtkSmartPointer< class vtkActor > vtkActorPtr
vtkSmartPointer< class vtkDataSetMapper > vtkDataSetMapperPtr
Wrap vtkActor displaying a video image, possibly clipped by a sector.
vtkSmartPointer< vtkImageChangeInformation > vtkImageChangeInformationPtr
Definition: cxImage.cpp:46
vtkSmartPointer< class UltrasoundSectorSource > UltrasoundSectorSourcePtr
vtkSmartPointer< class vtkTransformTextureCoords > vtkTransformTextureCoordsPtr
boost::shared_ptr< VideoGraphics > VideoGraphicsPtr
vtkSmartPointer< class vtkTextureMapToPlane > vtkTextureMapToPlanePtr
vtkSmartPointer< class vtkImageMask > vtkImageMaskPtr
boost::shared_ptr< class VideoSourceGraphics > VideoSourceGraphicsPtr
vtkSmartPointer< class vtkLookupTable > vtkLookupTablePtr
vtkSmartPointer< vtkDataSetMapper > vtkDataSetMapperPtr
vtkSmartPointer< vtkPolyData > vtkPolyDataPtr
vtkSmartPointer< class vtkPlaneSource > vtkPlaneSourcePtr
vtkSmartPointer< vtkImageMask > vtkImageMaskPtr
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
vtkSmartPointer< class vtkTransformTextureCoords > vtkTransformTextureCoordsPtr
Namespace for all CustusX production code.