NorMIT-nav  2023.01.05-dev+develop.0da12
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_*/
cx::VolumePropertyPtr
boost::shared_ptr< class VolumeProperty > VolumePropertyPtr
Definition: cxVolumeProperty.h:23
cxRepImpl.h
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxForwardDeclarations.h
cx::VolumetricRep::mImage
ImagePtr mImage
Definition: cxVolumetricRep.h:95
cx::VolumetricBaseRep::~VolumetricBaseRep
virtual ~VolumetricBaseRep()
Definition: cxVolumetricRep.h:46
cx::VolumetricRep::mMapper
vtkVolumeMapperPtr mMapper
Definition: cxVolumetricRep.h:91
vtkVolumePtr
vtkSmartPointer< class vtkVolume > vtkVolumePtr
Definition: vtkForwardDeclarations.h:152
cx::VolumetricRep::getType
virtual QString getType() const
Definition: cxVolumetricRep.h:76
vtkVolumeMapperPtr
vtkSmartPointer< class vtkVolumeMapper > vtkVolumeMapperPtr
Definition: vtkForwardDeclarations.h:150
vtkForwardDeclarations.h
cx::ImagePtr
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
cx::VolumetricRep::New
static VolumetricRepPtr New(QString uid="")
Definition: cxVolumetricRep.h:75
cx::ViewPtr
boost::shared_ptr< class View > ViewPtr
Definition: cxForwardDeclarations.h:110
cx::RepImpl
Default implementation of Rep.
Definition: cxRepImpl.h:42
cx::VolumetricBaseRep::VolumetricBaseRep
VolumetricBaseRep()
Definition: cxVolumetricRep.h:55
cx::ImageMapperMonitorPtr
boost::shared_ptr< class ImageMapperMonitor > ImageMapperMonitorPtr
Definition: cxImageMapperMonitor.h:27
cx::VolumetricRep
Display a volume in 3D.
Definition: cxVolumetricRep.h:69
cx::VolumetricRep::mMaxVoxels
long mMaxVoxels
always resample volume below this size.
Definition: cxVolumetricRep.h:93
cx::VolumetricRepPtr
boost::shared_ptr< class VolumetricRep > VolumetricRepPtr
Definition: cxForwardDeclarations.h:112
cx::VolumetricRep::mVolume
vtkVolumePtr mVolume
Definition: cxVolumetricRep.h:92
cx::VolumetricRep::mVolumeProperty
cx::VolumePropertyPtr mVolumeProperty
Definition: cxVolumetricRep.h:90
cx::VolumetricBaseRep
Display a volume in 3D.
Definition: cxVolumetricRep.h:42
cx::VolumetricRep::mMonitor
cx::ImageMapperMonitorPtr mMonitor
helper object for visualizing clipping/cropping
Definition: cxVolumetricRep.h:96