CustusX  22.04-rc5
An IGT application
cxVolumetricRep.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 CXVOLUMETRICREP_H_
14 #define CXVOLUMETRICREP_H_
15 
16 #include "cxResourceVisualizationExport.h"
17 
18 #include "cxRepImpl.h"
19 
20 #include "vtkForwardDeclarations.h"
21 #include "cxForwardDeclarations.h"
22 
23 
24 namespace cx
25 {
26  typedef boost::shared_ptr<class VolumeProperty> VolumePropertyPtr;
27  typedef boost::shared_ptr<class ImageMapperMonitor> ImageMapperMonitorPtr;
28 }
29 
30 namespace cx
31 {
32 
33 
42 class cxResourceVisualization_EXPORT VolumetricBaseRep : public RepImpl
43 {
44  Q_OBJECT
45 public:
46  virtual ~VolumetricBaseRep() {}
47 
48  virtual void setImage(ImagePtr image) = 0;
49  virtual ImagePtr getImage() = 0;
50  virtual bool hasImage(ImagePtr image) const = 0;
51  virtual vtkVolumePtr getVtkVolume() = 0;
52  //virtual void setResampleFactor(double factor) = 0; ///< set how detailed the image should be
53  virtual void setMaxVolumeSize(long maxVoxels) = 0;
54 protected:
56 };
57 
69 class cxResourceVisualization_EXPORT VolumetricRep : public VolumetricBaseRep
70 {
71  Q_OBJECT
72 public:
73  virtual ~VolumetricRep();
74 
75  static VolumetricRepPtr New(QString uid="") { return wrap_new(new VolumetricRep(), uid); }
76  virtual QString getType() const { return "VolumetricRep"; }
77  virtual void setImage(ImagePtr image);
78  virtual ImagePtr getImage();
79  virtual bool hasImage(ImagePtr image) const;
80  virtual vtkVolumePtr getVtkVolume() { return mVolume; }
81  void setMaxVolumeSize(long maxVoxels);
82  void setUseGPUVolumeRayCastMapper();
83  void setUseVolumeTextureMapper();
84 
85 protected:
86  VolumetricRep();
87  virtual void addRepActorsToViewRenderer(ViewPtr view);
88  virtual void removeRepActorsFromViewRenderer(ViewPtr view);
89 
93  long mMaxVoxels;
94 
97 
98 protected slots:
99  void transformChangedSlot();
100  void vtkImageDataChangedSlot();
101  void updateVtkImageDataSlot();
102 };
103 //---------------------------------------------------------
104 } // namespace cx
105 //---------------------------------------------------------
106 
107 #endif /*CXVOLUMETRICREP_H_*/
vtkSmartPointer< class vtkVolume > vtkVolumePtr
vtkVolumeMapperPtr mMapper
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
long mMaxVoxels
always resample volume below this size.
boost::shared_ptr< class View > ViewPtr
cx::VolumePropertyPtr mVolumeProperty
boost::shared_ptr< class ImageMapperMonitor > ImageMapperMonitorPtr
Display a volume in 3D.
Display a volume in 3D.
Default implementation of Rep.
Definition: cxRepImpl.h:42
vtkSmartPointer< class vtkVolumeMapper > vtkVolumeMapperPtr
vtkVolumePtr mVolume
virtual vtkVolumePtr getVtkVolume()
get the images vtkVolume
virtual QString getType() const
boost::shared_ptr< class VolumeProperty > VolumePropertyPtr
static VolumetricRepPtr New(QString uid="")
boost::shared_ptr< class VolumetricRep > VolumetricRepPtr
cx::ImageMapperMonitorPtr mMonitor
helper object for visualizing clipping/cropping
Namespace for all CustusX production code.