Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitkDoseImageVtkMapper2D.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkDoseImageVtkMapper2D_h
14 #define mitkDoseImageVtkMapper2D_h
15 
16 //MITK
17 #include <mitkCommon.h>
18 #include <MitkRTExports.h>
19 
20 //MITK Rendering
21 #include "mitkBaseRenderer.h"
22 #include "mitkVtkMapper.h"
23 #include "mitkExtractSliceFilter.h"
24 
25 //VTK
26 #include <vtkSmartPointer.h>
27 #include <vtkPropAssembly.h>
28 #include <vtkCellArray.h>
29 
30 class vtkActor;
31 class vtkPolyDataMapper;
32 class vtkPlaneSource;
33 class vtkImageData;
34 class vtkLookupTable;
35 class vtkImageExtractComponents;
36 class vtkImageReslice;
37 class vtkImageChangeInformation;
38 class vtkPoints;
40 class vtkPolyData;
41 class vtkMitkApplyLevelWindowToRGBFilter;
43 
44 namespace mitk {
45 
112  {
113 
114  public:
117 
119  itkFactorylessNewMacro(Self);
120  itkCloneMacro(Self);
121 
123  const mitk::Image *GetInput(void);
124 
127  void Update(mitk::BaseRenderer * renderer) override;
128 
129  //### methods of MITK-VTK rendering pipeline
130  vtkProp* GetVtkProp(mitk::BaseRenderer* renderer) override;
131  //### end of methods of MITK-VTK rendering pipeline
132 
133 
142  {
143  public:
146 
177 
179  itk::TimeStamp m_LastUpdateTime;
180 
183 
186 
188  LocalStorage();
190  ~LocalStorage() override;
191  };
192 
195 
197  LocalStorage* GetLocalStorage(mitk::BaseRenderer* renderer);
198 
200  static void SetDefaultProperties(mitk::DataNode* node, mitk::BaseRenderer* renderer = nullptr, bool overwrite = false);
201 
205  void ApplyRenderingMode(mitk::BaseRenderer *renderer);
206 
207  protected:
211  void TransformActor(mitk::BaseRenderer* renderer);
212 
226  void GeneratePlane(mitk::BaseRenderer* renderer, double planeBounds[6]);
227 
232  vtkSmartPointer<vtkPolyData> CreateOutlinePolyData(mitk::BaseRenderer* renderer);
233 
237  ~DoseImageVtkMapper2D() override;
238 
251  void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
252 
256  float CalculateLayerDepth(mitk::BaseRenderer* renderer);
257 
262  void ApplyLookuptable(mitk::BaseRenderer* renderer);
263 
269  void ApplyColorTransferFunction(mitk::BaseRenderer* renderer);
270 
276  void ApplyLevelWindow(mitk::BaseRenderer* renderer);
277 
279  void ApplyColor( mitk::BaseRenderer* renderer );
280 
282  void ApplyOpacity( mitk::BaseRenderer* renderer );
283 
294  bool RenderingGeometryIntersectsImage( const PlaneGeometry* renderingGeometry, SlicedGeometry3D* imageGeometry );
295 
296  private:
297  void CreateLevelOutline(mitk::BaseRenderer* renderer, const mitk::IsoDoseLevel* level, float pref, vtkSmartPointer<vtkPoints> points, vtkSmartPointer<vtkCellArray> lines, vtkSmartPointer<vtkUnsignedCharArray> colors);
298 
299  };
300 
301 } // namespace mitk
302 
303 #endif
mitk::DoseImageVtkMapper2D::LocalStorage::m_LastUpdateTime
itk::TimeStamp m_LastUpdateTime
Timestamp of last update of stored data.
Definition: mitkDoseImageVtkMapper2D.h:179
mitk::DoseImageVtkMapper2D::LocalStorage::m_BinaryLookupTable
vtkSmartPointer< vtkLookupTable > m_BinaryLookupTable
Definition: mitkDoseImageVtkMapper2D.h:167
mitk::DoseImageVtkMapper2D
Mapper to resample and display 2D slices of a 3D image.
Definition: mitkDoseImageVtkMapper2D.h:111
mitk::DoseImageVtkMapper2D::LocalStorage::m_ColorLookupTable
vtkSmartPointer< vtkLookupTable > m_ColorLookupTable
Definition: mitkDoseImageVtkMapper2D.h:168
mitk::DoseImageVtkMapper2D::LocalStorage::m_Plane
vtkSmartPointer< vtkPlaneSource > m_Plane
Plane on which the slice is rendered as texture.
Definition: mitkDoseImageVtkMapper2D.h:162
mitk::DoseImageVtkMapper2D::LocalStorage::m_OutlinePolyData
vtkSmartPointer< vtkPolyData > m_OutlinePolyData
PolyData object containing all lines/points needed for outlining the contour. This container is used ...
Definition: mitkDoseImageVtkMapper2D.h:176
mitk::PlaneGeometry
Describes a two-dimensional, rectangular plane.
Definition: mitkPlaneGeometry.h:78
vtkSmartPointer< vtkActor >
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
mitk::DoseImageVtkMapper2D::LocalStorage::m_ReslicedImage
vtkSmartPointer< vtkImageData > m_ReslicedImage
Current slice of a 2D render window.
Definition: mitkDoseImageVtkMapper2D.h:152
mitk::DoseImageVtkMapper2D::LocalStorage::m_LevelWindowFilter
vtkSmartPointer< vtkMitkLevelWindowFilter > m_LevelWindowFilter
This filter is used to apply the level window to Grayvalue and RBG(A) images.
Definition: mitkDoseImageVtkMapper2D.h:185
itk::SmartPointer< Self >
mitk::DoseImageVtkMapper2D::LocalStorage::m_Actor
vtkSmartPointer< vtkActor > m_Actor
Actor of a 2D render window.
Definition: mitkDoseImageVtkMapper2D.h:145
mitk::DoseImageVtkMapper2D::m_LSH
mitk::LocalStorageHandler< LocalStorage > m_LSH
The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows.
Definition: mitkDoseImageVtkMapper2D.h:194
mitk::DoseImageVtkMapper2D::LocalStorage::m_mmPerPixel
mitk::ScalarType * m_mmPerPixel
mmPerPixel relation between pixel and mm. (World spacing).
Definition: mitkDoseImageVtkMapper2D.h:182
mitk::DoseImageVtkMapper2D::LocalStorage::m_Texture
vtkSmartPointer< vtkTexture > m_Texture
The texture which is used to render the current slice.
Definition: mitkDoseImageVtkMapper2D.h:164
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::DoseImageVtkMapper2D::LocalStorage::m_Mapper
vtkSmartPointer< vtkPolyDataMapper > m_Mapper
Mapper of a 2D render window.
Definition: mitkDoseImageVtkMapper2D.h:149
MITKRT_EXPORT
#define MITKRT_EXPORT
Definition: MitkRTExports.h:15
mitk::LocalStorageHandler< LocalStorage >
mitk::DoseImageVtkMapper2D::LocalStorage::m_TSFilter
vtkSmartPointer< vtkMitkThickSlicesFilter > m_TSFilter
Filter for thick slices.
Definition: mitkDoseImageVtkMapper2D.h:172
mitk::DoseImageVtkMapper2D::LocalStorage::m_DefaultLookupTable
vtkSmartPointer< vtkLookupTable > m_DefaultLookupTable
The lookuptables for colors and level window.
Definition: mitkDoseImageVtkMapper2D.h:166
mitk::Mapper
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:46
mitk::DoseImageVtkMapper2D::LocalStorage::m_EmptyPolyData
vtkSmartPointer< vtkPolyData > m_EmptyPolyData
Empty vtkPolyData that is set when rendering geometry does not intersect the image geometry.
Definition: mitkDoseImageVtkMapper2D.h:160
mitk::DoseImageVtkMapper2D::LocalStorage::m_Reslicer
mitk::ExtractSliceFilter::Pointer m_Reslicer
The actual reslicer (one per renderer)
Definition: mitkDoseImageVtkMapper2D.h:170
mitk::DoseImageVtkMapper2D::LocalStorage::m_VectorComponentExtractor
vtkSmartPointer< vtkImageExtractComponents > m_VectorComponentExtractor
Definition: mitkDoseImageVtkMapper2D.h:150
mitk::VtkMapper
Base class of all Vtk Mappers in order to display primitives by exploiting Vtk functionality.
Definition: mitkVtkMapper.h:47
mitk::Mapper::BaseLocalStorage
Base class for mapper specific rendering resources.
Definition: mitkMapper.h:190
vtkMitkLevelWindowFilter
Applies the grayvalue or color/opacity level window to scalar or RGB(A) images.
Definition: vtkMitkLevelWindowFilter.h:33
mitkCommon.h
vtkMitkThickSlicesFilter
Definition: vtkMitkThickSlicesFilter.h:28
mitkVtkMapper.h
mitk::SlicedGeometry3D
Describes the geometry of a data object consisting of slices.
Definition: mitkSlicedGeometry3D.h:62
mitk::DoseImageVtkMapper2D::LocalStorage
Internal class holding the mapper, actor, etc. for each of the 3 2D render windows.
Definition: mitkDoseImageVtkMapper2D.h:141
mitk::IsoDoseLevel
Stores values needed for the representation/visualization of dose iso levels.
Definition: mitkIsoDoseLevel.h:36
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitkExtractSliceFilter.h
mitk::BaseRenderer
Definition: mitkBaseRenderer.h:56
mitk::DoseImageVtkMapper2D::LocalStorage::m_Actors
vtkSmartPointer< vtkPropAssembly > m_Actors
Definition: mitkDoseImageVtkMapper2D.h:147
mitkBaseRenderer.h
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
mitk::ROIMapperHelper::SetDefaultProperties
void SetDefaultProperties(DataNode *node, BaseRenderer *renderer, bool override)
Set common default properties for both 2-d and 3-d ROI mappers.
MitkRTExports.h
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20