Medical Imaging Interaction Toolkit  2022.04.99-01b95b17
Medical Imaging Interaction Toolkit
mitkRegEvaluationMapper2D.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 MITK_REG_EVALUATION_MAPPER_2D_H
14 #define MITK_REG_EVALUATION_MAPPER_2D_H
15 
16 //MatchPoint
17 #include <mapRegistration.h>
19 
20 //MITK
21 #include <mitkCommon.h>
22 
23 //MITK Rendering
24 #include "mitkBaseRenderer.h"
25 #include "mitkVtkMapper.h"
26 #include "mitkExtractSliceFilter.h"
27 
28 //VTK
29 #include <vtkSmartPointer.h>
30 #include <vtkPropAssembly.h>
31 
32 //MITK
34 
35 class vtkActor;
36 class vtkPolyDataMapper;
37 class vtkPlaneSource;
38 class vtkImageData;
39 class vtkLookupTable;
40 class vtkImageExtractComponents;
41 class vtkImageReslice;
42 class vtkImageChangeInformation;
43 class vtkPoints;
45 class vtkPolyData;
46 class vtkMitkApplyLevelWindowToRGBFilter;
48 
49 namespace mitk {
50 
55 {
56 
57 public:
60 
62  itkFactorylessNewMacro(Self);
63  itkCloneMacro(Self);
64 
65  const mitk::DataNode* GetTargetNode(void);
66  const mitk::DataNode* GetMovingNode(void);
68  const mitk::Image *GetTargetImage(void);
70  const mitk::Image *GetMovingImage(void);
72  const mitk::MAPRegistrationWrapper *GetRegistration(void);
73 
76  void Update(mitk::BaseRenderer * renderer) override;
77 
78  //### methods of MITK-VTK rendering pipeline
79  vtkProp* GetVtkProp(mitk::BaseRenderer* renderer) override;
80  //### end of methods of MITK-VTK rendering pipeline
81 
90  {
91  public:
93  vtkSmartPointer<vtkActor> m_Actor;
94 
95  vtkSmartPointer<vtkPropAssembly> m_Actors;
97  vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
99  vtkSmartPointer<vtkImageData> m_EvaluationImage;
100 
108  vtkSmartPointer<vtkPolyData> m_EmptyPolyData;
110  vtkSmartPointer<vtkPlaneSource> m_Plane;
112  vtkSmartPointer<vtkTexture> m_Texture;
114  vtkSmartPointer<vtkLookupTable> m_ColorLookupTable;
115  vtkSmartPointer<vtkLookupTable> m_DefaultLookupTable;
118 
124 
126  itk::TimeStamp m_LastUpdateTime;
127 
130 
132  vtkSmartPointer<vtkMitkLevelWindowFilter> m_TargetLevelWindowFilter;
133 
135  vtkSmartPointer<vtkMitkLevelWindowFilter> m_MappedLevelWindowFilter;
136 
137  vtkSmartPointer<vtkImageExtractComponents> m_TargetExtractFilter;
138  vtkSmartPointer<vtkImageExtractComponents> m_MappedExtractFilter;
139 
141  LocalStorage();
143  ~LocalStorage() override;
144  };
145 
148 
150  LocalStorage* GetLocalStorage(mitk::BaseRenderer* renderer);
151 
153  static void SetDefaultProperties(mitk::DataNode* node, mitk::BaseRenderer* renderer = nullptr, bool overwrite = false);
154 
155 protected:
159  void TransformActor(mitk::BaseRenderer* renderer);
160 
174  void GeneratePlane(mitk::BaseRenderer* renderer, double planeBounds[6]);
175 
179  ~RegEvaluationMapper2D() override;
180 
193  void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
194 
195  void PrepareContour( mitk::DataNode* datanode, LocalStorage * localStorage );
196 
197  void PrepareDifference( LocalStorage * localStorage );
198 
199  void PrepareWipe(mitk::DataNode* datanode, LocalStorage * localStorage, const Point2D& currentIndex2D);
200 
201  void PrepareCheckerBoard( mitk::DataNode* datanode, LocalStorage * localStorage );
202 
203  void PrepareColorBlend( LocalStorage * localStorage );
204 
205  void PrepareBlend( mitk::DataNode* datanode, LocalStorage * localStorage );
206 
210  float CalculateLayerDepth(mitk::BaseRenderer* renderer);
211 
216  void ApplyLookuptable(mitk::BaseRenderer* renderer, const mitk::DataNode* dataNode, vtkMitkLevelWindowFilter* levelFilter);
217 
225  void ApplyLevelWindow(mitk::BaseRenderer *renderer, const mitk::DataNode* dataNode, vtkMitkLevelWindowFilter* levelFilter);
226 
228  void ApplyOpacity( mitk::BaseRenderer* renderer );
229 
243  bool RenderingGeometryIntersectsImage( const PlaneGeometry* renderingGeometry, SlicedGeometry3D* imageGeometry );
244 };
245 
246 } // namespace mitk
247 
248 #endif /* MITKRegEvaluationMapper2D_H_HEADER_INCLUDED_C10E906E */
vtkSmartPointer< vtkMitkLevelWindowFilter > m_MappedLevelWindowFilter
This filter is used to apply the level window to moving image.
vtkSmartPointer< vtkImageData > m_EvaluationImage
Current slice of a 2D render window.
mitk::ScalarType * m_mmPerPixel
mmPerPixel relation between pixel and mm. (World spacing).
Base class for mapper specific rendering ressources.
Definition: mitkMapper.h:190
vtkSmartPointer< vtkMitkLevelWindowFilter > m_TargetLevelWindowFilter
This filter is used to apply the level window to target image.
vtkSmartPointer< vtkPlaneSource > m_Plane
Plane on which the slice is rendered as texture.
double ScalarType
mitk::LocalStorageHandler< LocalStorage > m_LSH
The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows.
vtkSmartPointer< vtkImageExtractComponents > m_MappedExtractFilter
Organizes the rendering process.
DataCollection - Class to facilitate loading/accessing structured data.
MAPRegistrationWrapper Wrapper class to allow the handling of MatchPoint registration objects as mitk...
Base class of all Vtk Mappers in order to display primitives by exploiting Vtk functionality.
Definition: mitkVtkMapper.h:48
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:46
mitk::ExtractSliceFilter::Pointer m_Reslicer
The actual reslicer (one per renderer)
vtkSmartPointer< vtkPolyDataMapper > m_Mapper
Mapper of a 2D render window.
Internal class holding the mapper, actor, etc. for each of the 3 2D render windows.
#define MITKMATCHPOINTREGISTRATION_EXPORT
itk::TimeStamp m_LastUpdateTime
Timestamp of last update of stored data.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
vtkSmartPointer< vtkActor > m_Actor
Actor of a 2D render window.
Image class for storing images.
Definition: mitkImage.h:69
vtkSmartPointer< vtkLookupTable > m_DefaultLookupTable
vtkSmartPointer< vtkTexture > m_Texture
The texture which is used to render the current slice.
vtkSmartPointer< vtkImageExtractComponents > m_TargetExtractFilter
Applies the grayvalue or color/opacity level window to scalar or RGB(A) images.
Describes the geometry of a data object consisting of slices.
vtkSmartPointer< vtkLookupTable > m_ColorLookupTable
The lookuptables for colors and level window.
Describes a two-dimensional, rectangular plane.
vtkSmartPointer< vtkPropAssembly > m_Actors
Mapper to resample and display 2D slices of registration evaluation visualization.
vtkSmartPointer< vtkPolyData > m_EmptyPolyData
Empty vtkPolyData that is set when rendering geometry does not intersect the image geometry...
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63