Medical Imaging Interaction Toolkit  2024.06.00
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 (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 mitkImageVtkMapper2D_h
14 #define mitkImageVtkMapper2D_h
15 
16 // MITK
17 #include <mitkCommon.h>
18 
19 // MITK Rendering
20 #include "mitkBaseRenderer.h"
21 #include "mitkExtractSliceFilter.h"
22 #include "mitkVtkMapper.h"
23 
24 // VTK
25 #include <vtkPropAssembly.h>
26 #include <vtkSmartPointer.h>
27 
28 class vtkActor;
29 class vtkPolyDataMapper;
30 class vtkPlaneSource;
31 class vtkImageData;
32 class vtkLookupTable;
33 class vtkImageExtractComponents;
34 class vtkImageReslice;
35 class vtkImageChangeInformation;
36 class vtkPoints;
38 class vtkPolyData;
39 class vtkMitkApplyLevelWindowToRGBFilter;
41 
42 namespace mitk
43 {
117  {
118  public:
121 
123  itkFactorylessNewMacro(Self);
124  itkCloneMacro(Self);
125 
127  const mitk::Image *GetInput(void);
128 
131  void Update(mitk::BaseRenderer *renderer) override;
132 
133  //### methods of MITK-VTK rendering pipeline
134  vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
135  //### end of methods of MITK-VTK rendering pipeline
136 
145  {
146  public:
151 
159  vtkProp* m_PublicActors = nullptr;
160 
190 
192  itk::TimeStamp m_LastUpdateTime;
193 
196 
199 
201  LocalStorage();
203  ~LocalStorage() override;
204  };
205 
207  const LocalStorage *GetConstLocalStorage(mitk::BaseRenderer *renderer);
208 
210  static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
211 
215  void ApplyRenderingMode(mitk::BaseRenderer *renderer);
216 
217  protected:
220 
222  LocalStorage* GetLocalStorage(mitk::BaseRenderer* renderer);
223 
227  void TransformActor(mitk::BaseRenderer *renderer);
228 
242  void GeneratePlane(mitk::BaseRenderer *renderer, double planeBounds[6]);
243 
248  template <typename TPixel>
249  vtkSmartPointer<vtkPolyData> CreateOutlinePolyData(mitk::BaseRenderer *renderer);
250 
254  ~ImageVtkMapper2D() override;
255 
268  void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
269 
273  float CalculateLayerDepth(mitk::BaseRenderer *renderer);
274 
279  void ApplyLookuptable(mitk::BaseRenderer *renderer);
280 
287  void ApplyColorTransferFunction(mitk::BaseRenderer *renderer);
288 
295  void ApplyLevelWindow(mitk::BaseRenderer *renderer);
296 
298  void ApplyColor(mitk::BaseRenderer *renderer);
299 
301  void ApplyOpacity(mitk::BaseRenderer *renderer);
302 
313  bool RenderingGeometryIntersectsImage(const PlaneGeometry *renderingGeometry, SlicedGeometry3D *imageGeometry);
314 
316  void SetToInvalidState(mitk::ImageVtkMapper2D::LocalStorage* localStorage);
317  };
318 
319 } // namespace mitk
320 
321 #endif
mitk::ImageVtkMapper2D::LocalStorage::m_ShadowOutlineActor
vtkSmartPointer< vtkActor > m_ShadowOutlineActor
Actor of the shadowimage in a 2D render window.
Definition: mitkImageVtkMapper2D.h:150
mitk::ImageVtkMapper2D::LocalStorage::m_Plane
vtkSmartPointer< vtkPlaneSource > m_Plane
Plane on which the slice is rendered as texture.
Definition: mitkImageVtkMapper2D.h:175
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
itk::SmartPointer< Self >
mitk::ImageVtkMapper2D::LocalStorage::m_mmPerPixel
mitk::ScalarType * m_mmPerPixel
mmPerPixel relation between pixel and mm. (World spacing).
Definition: mitkImageVtkMapper2D.h:195
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::LocalStorageHandler< LocalStorage >
mitk::ImageVtkMapper2D::LocalStorage::m_Texture
vtkSmartPointer< vtkTexture > m_Texture
The texture which is used to render the current slice.
Definition: mitkImageVtkMapper2D.h:177
mitk::ImageVtkMapper2D
Mapper to resample and display 2D slices of a 3D image.
Definition: mitkImageVtkMapper2D.h:116
mitk::ImageVtkMapper2D::LocalStorage::m_TSFilter
vtkSmartPointer< vtkMitkThickSlicesFilter > m_TSFilter
Filter for thick slices.
Definition: mitkImageVtkMapper2D.h:185
mitk::ImageVtkMapper2D::LocalStorage::m_ImageActor
vtkSmartPointer< vtkActor > m_ImageActor
Actor of the image in a 2D render window.
Definition: mitkImageVtkMapper2D.h:148
mitk::ImageVtkMapper2D::LocalStorage::m_Reslicer
mitk::ExtractSliceFilter::Pointer m_Reslicer
The actual reslicer (one per renderer)
Definition: mitkImageVtkMapper2D.h:183
mitk::ImageVtkMapper2D::LocalStorage::m_EmptyActors
vtkSmartPointer< vtkPropAssembly > m_EmptyActors
Definition: mitkImageVtkMapper2D.h:157
mitk::VtkMapper
Base class of all Vtk Mappers in order to display primitives by exploiting Vtk functionality.
Definition: mitkVtkMapper.h:47
mitk::ImageVtkMapper2D::LocalStorage::m_ReslicedImage
vtkSmartPointer< vtkImageData > m_ReslicedImage
Current slice of a 2D render window.
Definition: mitkImageVtkMapper2D.h:165
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
mitk::ImageVtkMapper2D::LocalStorage::m_LastUpdateTime
itk::TimeStamp m_LastUpdateTime
Timestamp of last update of stored data.
Definition: mitkImageVtkMapper2D.h:192
mitk::ImageVtkMapper2D::LocalStorage::m_VectorComponentExtractor
vtkSmartPointer< vtkImageExtractComponents > m_VectorComponentExtractor
Definition: mitkImageVtkMapper2D.h:163
mitkVtkMapper.h
mitk::SlicedGeometry3D
Describes the geometry of a data object consisting of slices.
Definition: mitkSlicedGeometry3D.h:62
mitk::ImageVtkMapper2D::LocalStorage::m_OutlinePolyData
vtkSmartPointer< vtkPolyData > m_OutlinePolyData
PolyData object containing all lines/points needed for outlining the contour. This container is used ...
Definition: mitkImageVtkMapper2D.h:189
mitk::ImageVtkMapper2D::LocalStorage::m_DefaultLookupTable
vtkSmartPointer< vtkLookupTable > m_DefaultLookupTable
The lookuptables for colors and level window.
Definition: mitkImageVtkMapper2D.h:179
mitk::ImageVtkMapper2D::LocalStorage
Internal class holding the mapper, actor, etc. for each of the 3 2D render windows.
Definition: mitkImageVtkMapper2D.h:144
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitkExtractSliceFilter.h
mitk::BaseRenderer
Definition: mitkBaseRenderer.h:56
mitk::ImageVtkMapper2D::LocalStorage::m_LevelWindowFilter
vtkSmartPointer< vtkMitkLevelWindowFilter > m_LevelWindowFilter
This filter is used to apply the level window to Grayvalue and RBG(A) images.
Definition: mitkImageVtkMapper2D.h:198
mitk::ImageVtkMapper2D::m_LSH
mitk::LocalStorageHandler< LocalStorage > m_LSH
The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows.
Definition: mitkImageVtkMapper2D.h:219
mitk::ImageVtkMapper2D::LocalStorage::m_ColorLookupTable
vtkSmartPointer< vtkLookupTable > m_ColorLookupTable
Definition: mitkImageVtkMapper2D.h:181
mitkBaseRenderer.h
mitk::ImageVtkMapper2D::LocalStorage::m_Mapper
vtkSmartPointer< vtkPolyDataMapper > m_Mapper
Mapper of a 2D render window.
Definition: mitkImageVtkMapper2D.h:162
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
mitk::ImageVtkMapper2D::LocalStorage::m_EmptyPolyData
vtkSmartPointer< vtkPolyData > m_EmptyPolyData
Empty vtkPolyData that is set when rendering geometry does not intersect the image geometry.
Definition: mitkImageVtkMapper2D.h:173
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
mitk::ImageVtkMapper2D::LocalStorage::m_BinaryLookupTable
vtkSmartPointer< vtkLookupTable > m_BinaryLookupTable
Definition: mitkImageVtkMapper2D.h:180
mitk::ROIMapperHelper::SetDefaultProperties
void SetDefaultProperties(DataNode *node, BaseRenderer *renderer, bool override)
Set common default properties for both 2-d and 3-d ROI mappers.
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20
mitk::ImageVtkMapper2D::LocalStorage::m_Actors
vtkSmartPointer< vtkPropAssembly > m_Actors
Definition: mitkImageVtkMapper2D.h:153