Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef MITKDoseImageVtkMapper2D2D_H_HEADER_INCLUDED
18 #define MITKDoseImageVtkMapper2D2D_H_HEADER_INCLUDED
19 
20 //MITK
21 #include <mitkCommon.h>
22 #include <MitkDicomRTExports.h>
23 
24 //MITK Rendering
25 #include "mitkBaseRenderer.h"
26 #include "mitkVtkMapper.h"
27 #include "mitkExtractSliceFilter.h"
28 
29 //VTK
30 #include <vtkSmartPointer.h>
31 #include <vtkPropAssembly.h>
32 #include <vtkCellArray.h>
33 
34 class vtkActor;
35 class vtkPolyDataMapper;
36 class vtkPlaneSource;
37 class vtkImageData;
38 class vtkLookupTable;
39 class vtkImageExtractComponents;
40 class vtkImageReslice;
41 class vtkImageChangeInformation;
42 class vtkPoints;
44 class vtkPolyData;
45 class vtkMitkApplyLevelWindowToRGBFilter;
47 
48 namespace mitk {
49 
120  {
121 
122  public:
125 
127  itkFactorylessNewMacro(Self)
128  itkCloneMacro(Self)
129 
130 
131  const mitk::Image *GetInput(void);
132 
135  virtual void Update(mitk::BaseRenderer * renderer);
136 
137  //### methods of MITK-VTK rendering pipeline
138  virtual vtkProp* GetVtkProp(mitk::BaseRenderer* renderer);
139  //### end of methods of MITK-VTK rendering pipeline
140 
141 
150  {
151  public:
153  vtkSmartPointer<vtkActor> m_Actor;
154 
155  vtkSmartPointer<vtkPropAssembly> m_Actors;
157  vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
158  vtkSmartPointer<vtkImageExtractComponents> m_VectorComponentExtractor;
160  vtkSmartPointer<vtkImageData> m_ReslicedImage;
168  vtkSmartPointer<vtkPolyData> m_EmptyPolyData;
170  vtkSmartPointer<vtkPlaneSource> m_Plane;
172  vtkSmartPointer<vtkTexture> m_Texture;
174  vtkSmartPointer<vtkLookupTable> m_DefaultLookupTable;
175  vtkSmartPointer<vtkLookupTable> m_BinaryLookupTable;
176  vtkSmartPointer<vtkLookupTable> m_ColorLookupTable;
180  vtkSmartPointer<vtkMitkThickSlicesFilter> m_TSFilter;
184  vtkSmartPointer<vtkPolyData> m_OutlinePolyData;
185 
187  itk::TimeStamp m_LastUpdateTime;
188 
191 
193  vtkSmartPointer<vtkMitkLevelWindowFilter> m_LevelWindowFilter;
194 
196  LocalStorage();
198  ~LocalStorage();
199  };
200 
203 
205  LocalStorage* GetLocalStorage(mitk::BaseRenderer* renderer);
206 
208  static void SetDefaultProperties(mitk::DataNode* node, mitk::BaseRenderer* renderer = NULL, bool overwrite = false);
209 
213  void ApplyRenderingMode(mitk::BaseRenderer *renderer);
214 
215  protected:
219  void TransformActor(mitk::BaseRenderer* renderer);
220 
236  void GeneratePlane(mitk::BaseRenderer* renderer, double planeBounds[6]);
237 
242  vtkSmartPointer<vtkPolyData> CreateOutlinePolyData(mitk::BaseRenderer* renderer);
243 
247  virtual ~DoseImageVtkMapper2D();
248 
261  virtual void GenerateDataForRenderer(mitk::BaseRenderer *renderer);
262 
266  float CalculateLayerDepth(mitk::BaseRenderer* renderer);
267 
272  void ApplyLookuptable(mitk::BaseRenderer* renderer);
273 
279  void ApplyColorTransferFunction(mitk::BaseRenderer* renderer);
280 
286  void ApplyLevelWindow(mitk::BaseRenderer* renderer);
287 
289  void ApplyColor( mitk::BaseRenderer* renderer );
290 
292  void ApplyOpacity( mitk::BaseRenderer* renderer );
293 
304  bool RenderingGeometryIntersectsImage( const PlaneGeometry* renderingGeometry, SlicedGeometry3D* imageGeometry );
305 
306  private:
307  void CreateLevelOutline(mitk::BaseRenderer* renderer, const mitk::IsoDoseLevel* level, float pref, vtkSmartPointer<vtkPoints> points, vtkSmartPointer<vtkCellArray> lines, vtkSmartPointer<vtkUnsignedCharArray> colors);
308 
309  };
310 
311 } // namespace mitk
312 
313 #endif /* MITKDoseImageVtkMapper2D_H_HEADER_INCLUDED_C10E906E */
itk::TimeStamp m_LastUpdateTime
Timestamp of last update of stored data.
Base class for mapper specific rendering ressources.
Definition: mitkMapper.h:200
#define MITKCORE_EXPORT
vtkSmartPointer< vtkMitkLevelWindowFilter > m_LevelWindowFilter
This filter is used to apply the level window to Grayvalue and RBG(A) images.
double ScalarType
vtkSmartPointer< vtkPolyDataMapper > m_Mapper
Mapper of a 2D render window.
Organizes the rendering process.
vtkSmartPointer< vtkImageExtractComponents > m_VectorComponentExtractor
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:35
vtkSmartPointer< vtkTexture > m_Texture
The texture which is used to render the current slice.
vtkSmartPointer< vtkLookupTable > m_ColorLookupTable
DataCollection - Class to facilitate loading/accessing structured data.
vtkSmartPointer< vtkImageData > m_ReslicedImage
Current slice of a 2D render window.
Base class of all Vtk Mappers in order to display primitives by exploiting Vtk functionality.
Definition: mitkVtkMapper.h:53
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:54
vtkSmartPointer< vtkPolyData > m_EmptyPolyData
Empty vtkPolyData that is set when rendering geometry does not intersect the image geometry...
mitk::ScalarType * m_mmPerPixel
mmPerPixel relation between pixel and mm. (World spacing).
Mapper to resample and display 2D slices of a 3D image.
#define MITKDICOMRT_EXPORT
vtkSmartPointer< vtkLookupTable > m_DefaultLookupTable
The lookuptables for colors and level window.
vtkSmartPointer< vtkLookupTable > m_BinaryLookupTable
Stores values needed for the representation/visualization of dose iso levels.
mitk::LocalStorageHandler< LocalStorage > m_LSH
The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
vtkSmartPointer< vtkPlaneSource > m_Plane
Plane on which the slice is rendered as texture.
Image class for storing images.
Definition: mitkImage.h:76
Applies the grayvalue or color/opacity level window to scalar or RGB(A) images.
Internal class holding the mapper, actor, etc. for each of the 3 2D render windows.
Describes the geometry of a data object consisting of slices.
mitk::ExtractSliceFilter::Pointer m_Reslicer
The actual reslicer (one per renderer)
vtkSmartPointer< vtkPolyData > m_OutlinePolyData
PolyData object containg all lines/points needed for outlining the contour. This container is used to...
vtkSmartPointer< vtkActor > m_Actor
Actor of a 2D render window.
Describes a two-dimensional, rectangular plane.
vtkSmartPointer< vtkMitkThickSlicesFilter > m_TSFilter
Filter for thick slices.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66
vtkSmartPointer< vtkPropAssembly > m_Actors