Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkImageVtkMapper2D.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 MITKIMAGEVTKMAPPER2D_H_HEADER_INCLUDED_C10E906E
18 #define MITKIMAGEVTKMAPPER2D_H_HEADER_INCLUDED_C10E906E
19 
20 // MITK
21 #include <mitkCommon.h>
22 
23 // MITK Rendering
24 #include "mitkBaseRenderer.h"
25 #include "mitkExtractSliceFilter.h"
26 #include "mitkVtkMapper.h"
27 
28 // VTK
29 #include <vtkPropAssembly.h>
30 #include <vtkSmartPointer.h>
31 
32 class vtkActor;
33 class vtkPolyDataMapper;
34 class vtkPlaneSource;
35 class vtkImageData;
36 class vtkLookupTable;
37 class vtkImageExtractComponents;
38 class vtkImageReslice;
39 class vtkImageChangeInformation;
40 class vtkPoints;
42 class vtkPolyData;
43 class vtkMitkApplyLevelWindowToRGBFilter;
45 
46 namespace mitk
47 {
121  {
122  public:
125 
127  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
128 
130  const mitk::Image *GetInput(void);
131 
134  virtual void Update(mitk::BaseRenderer *renderer) override;
135 
136  //### methods of MITK-VTK rendering pipeline
137  virtual vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
138  //### end of methods of MITK-VTK rendering pipeline
139 
148  {
149  public:
151  vtkSmartPointer<vtkActor> m_Actor;
152 
153  vtkSmartPointer<vtkPropAssembly> m_Actors;
155  vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
156  vtkSmartPointer<vtkImageExtractComponents> m_VectorComponentExtractor;
158  vtkSmartPointer<vtkImageData> m_ReslicedImage;
166  vtkSmartPointer<vtkPolyData> m_EmptyPolyData;
168  vtkSmartPointer<vtkPlaneSource> m_Plane;
170  vtkSmartPointer<vtkTexture> m_Texture;
172  vtkSmartPointer<vtkLookupTable> m_DefaultLookupTable;
173  vtkSmartPointer<vtkLookupTable> m_BinaryLookupTable;
174  vtkSmartPointer<vtkLookupTable> m_ColorLookupTable;
178  vtkSmartPointer<vtkMitkThickSlicesFilter> m_TSFilter;
182  vtkSmartPointer<vtkPolyData> m_OutlinePolyData;
183 
185  itk::TimeStamp m_LastUpdateTime;
186 
189 
191  vtkSmartPointer<vtkMitkLevelWindowFilter> m_LevelWindowFilter;
192 
194  LocalStorage();
196  ~LocalStorage();
197  };
198 
201 
203  LocalStorage *GetLocalStorage(mitk::BaseRenderer *renderer);
204 
206  static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = NULL, bool overwrite = false);
207 
211  void ApplyRenderingMode(mitk::BaseRenderer *renderer);
212 
213  protected:
217  void TransformActor(mitk::BaseRenderer *renderer);
218 
234  void GeneratePlane(mitk::BaseRenderer *renderer, double planeBounds[6]);
235 
240  template <typename TPixel>
241  vtkSmartPointer<vtkPolyData> CreateOutlinePolyData(mitk::BaseRenderer *renderer);
242 
246  virtual ~ImageVtkMapper2D();
247 
260  virtual void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
261 
265  float CalculateLayerDepth(mitk::BaseRenderer *renderer);
266 
271  void ApplyLookuptable(mitk::BaseRenderer *renderer);
272 
279  void ApplyColorTransferFunction(mitk::BaseRenderer *renderer);
280 
287  void ApplyLevelWindow(mitk::BaseRenderer *renderer);
288 
290  void ApplyColor(mitk::BaseRenderer *renderer);
291 
293  void ApplyOpacity(mitk::BaseRenderer *renderer);
294 
305  bool RenderingGeometryIntersectsImage(const PlaneGeometry *renderingGeometry, SlicedGeometry3D *imageGeometry);
306  };
307 
308 } // namespace mitk
309 
310 #endif /* MITKIMAGEVTKMAPPER2D_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< vtkActor > m_Actor
Actor of a 2D render window.
vtkSmartPointer< vtkImageExtractComponents > m_VectorComponentExtractor
double ScalarType
Organizes the rendering process.
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:35
DataCollection - Class to facilitate loading/accessing structured data.
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< vtkLookupTable > m_ColorLookupTable
mitk::LocalStorageHandler< LocalStorage > m_LSH
The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows.
vtkSmartPointer< vtkPropAssembly > m_Actors
vtkSmartPointer< vtkLookupTable > m_DefaultLookupTable
The lookuptables for colors and level window.
vtkSmartPointer< vtkPolyData > m_OutlinePolyData
PolyData object containg all lines/points needed for outlining the contour. This container is used to...
Mapper to resample and display 2D slices of a 3D image.
vtkSmartPointer< vtkMitkLevelWindowFilter > m_LevelWindowFilter
This filter is used to apply the level window to Grayvalue and RBG(A) images.
mitk::ScalarType * m_mmPerPixel
mmPerPixel relation between pixel and mm. (World spacing).
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
vtkSmartPointer< vtkPolyDataMapper > m_Mapper
Mapper of a 2D render window.
Image class for storing images.
Definition: mitkImage.h:76
vtkSmartPointer< vtkPolyData > m_EmptyPolyData
Empty vtkPolyData that is set when rendering geometry does not intersect the image geometry...
vtkSmartPointer< vtkTexture > m_Texture
The texture which is used to render the current slice.
Applies the grayvalue or color/opacity level window to scalar or RGB(A) images.
vtkSmartPointer< vtkMitkThickSlicesFilter > m_TSFilter
Filter for thick slices.
Describes the geometry of a data object consisting of slices.
vtkSmartPointer< vtkLookupTable > m_BinaryLookupTable
Internal class holding the mapper, actor, etc. for each of the 3 2D render windows.
Describes a two-dimensional, rectangular plane.
vtkSmartPointer< vtkPlaneSource > m_Plane
Plane on which the slice is rendered as texture.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66
mitk::ExtractSliceFilter::Pointer m_Reslicer
The actual reslicer (one per renderer)
vtkSmartPointer< vtkImageData > m_ReslicedImage
Current slice of a 2D render window.