Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
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 mitkRegEvaluationMapper2D_h
14 #define mitkRegEvaluationMapper2D_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:
94 
100 
118 
124 
126  itk::TimeStamp m_LastUpdateTime;
127 
130 
133 
136 
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
mitkRegEvaluationObject.h
mitk::PlaneGeometry
Describes a two-dimensional, rectangular plane.
Definition: mitkPlaneGeometry.h:78
mitk::RegEvaluationMapper2D::LocalStorage::m_slicedMappedImage
mitk::Image::Pointer m_slicedMappedImage
Definition: mitkRegEvaluationMapper2D.h:123
vtkSmartPointer< vtkActor >
mitk::RegEvaluationMapper2D::LocalStorage::m_slicedTargetImage
mitk::Image::Pointer m_slicedTargetImage
Definition: mitkRegEvaluationMapper2D.h:120
mitk::RegEvaluationMapper2D::LocalStorage::m_TargetExtractFilter
vtkSmartPointer< vtkImageExtractComponents > m_TargetExtractFilter
Definition: mitkRegEvaluationMapper2D.h:137
mitk::RegEvaluationMapper2D::LocalStorage::m_Texture
vtkSmartPointer< vtkTexture > m_Texture
The texture which is used to render the current slice.
Definition: mitkRegEvaluationMapper2D.h:112
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
mitk::RegEvaluationMapper2D::LocalStorage::m_Actors
vtkSmartPointer< vtkPropAssembly > m_Actors
Definition: mitkRegEvaluationMapper2D.h:95
itk::SmartPointer< Self >
mitk::RegEvaluationMapper2D::LocalStorage::m_Actor
vtkSmartPointer< vtkActor > m_Actor
Actor of a 2D render window.
Definition: mitkRegEvaluationMapper2D.h:93
MitkMatchPointRegistrationExports.h
mitk::RegEvaluationMapper2D::m_LSH
mitk::LocalStorageHandler< LocalStorage > m_LSH
The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows.
Definition: mitkRegEvaluationMapper2D.h:147
mitk::RegEvaluationMapper2D::LocalStorage::m_mmPerPixel
mitk::ScalarType * m_mmPerPixel
mmPerPixel relation between pixel and mm. (World spacing).
Definition: mitkRegEvaluationMapper2D.h:129
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::RegEvaluationMapper2D::LocalStorage::m_TargetLevelWindowFilter
vtkSmartPointer< vtkMitkLevelWindowFilter > m_TargetLevelWindowFilter
This filter is used to apply the level window to target image.
Definition: mitkRegEvaluationMapper2D.h:132
mitk::LocalStorageHandler< LocalStorage >
mitk::RegEvaluationMapper2D::LocalStorage::m_ColorLookupTable
vtkSmartPointer< vtkLookupTable > m_ColorLookupTable
The lookuptables for colors and level window.
Definition: mitkRegEvaluationMapper2D.h:114
mitk::RegEvaluationMapper2D::LocalStorage::m_Plane
vtkSmartPointer< vtkPlaneSource > m_Plane
Plane on which the slice is rendered as texture.
Definition: mitkRegEvaluationMapper2D.h:110
mitk::Mapper
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:46
mitk::Point< ScalarType, 2 >
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
mitk::RegEvaluationMapper2D::LocalStorage::m_EmptyPolyData
vtkSmartPointer< vtkPolyData > m_EmptyPolyData
Empty vtkPolyData that is set when rendering geometry does not intersect the image geometry.
Definition: mitkRegEvaluationMapper2D.h:108
mitkVtkMapper.h
mitk::RegEvaluationMapper2D::LocalStorage::m_EvaluationImage
vtkSmartPointer< vtkImageData > m_EvaluationImage
Current slice of a 2D render window.
Definition: mitkRegEvaluationMapper2D.h:99
mitk::SlicedGeometry3D
Describes the geometry of a data object consisting of slices.
Definition: mitkSlicedGeometry3D.h:62
mitk::RegEvaluationMapper2D::LocalStorage::m_MappedLevelWindowFilter
vtkSmartPointer< vtkMitkLevelWindowFilter > m_MappedLevelWindowFilter
This filter is used to apply the level window to moving image.
Definition: mitkRegEvaluationMapper2D.h:135
mitk::RegEvaluationMapper2D::LocalStorage::m_LastUpdateTime
itk::TimeStamp m_LastUpdateTime
Timestamp of last update of stored data.
Definition: mitkRegEvaluationMapper2D.h:126
mitk::RegEvaluationMapper2D::LocalStorage::m_Mapper
vtkSmartPointer< vtkPolyDataMapper > m_Mapper
Mapper of a 2D render window.
Definition: mitkRegEvaluationMapper2D.h:97
mitk::RegEvaluationMapper2D::LocalStorage
Internal class holding the mapper, actor, etc. for each of the 3 2D render windows.
Definition: mitkRegEvaluationMapper2D.h:89
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitkExtractSliceFilter.h
mitk::BaseRenderer
Definition: mitkBaseRenderer.h:56
mitk::MAPRegistrationWrapper
MAPRegistrationWrapper Wrapper class to allow the handling of MatchPoint registration objects as mitk...
Definition: mitkMAPRegistrationWrapper.h:36
mitk::RegEvaluationMapper2D::LocalStorage::m_MappedExtractFilter
vtkSmartPointer< vtkImageExtractComponents > m_MappedExtractFilter
Definition: mitkRegEvaluationMapper2D.h:138
MITKMATCHPOINTREGISTRATION_EXPORT
#define MITKMATCHPOINTREGISTRATION_EXPORT
Definition: MitkMatchPointRegistrationExports.h:15
mitk::RegEvaluationMapper2D::LocalStorage::m_DefaultLookupTable
vtkSmartPointer< vtkLookupTable > m_DefaultLookupTable
Definition: mitkRegEvaluationMapper2D.h:115
mitk::RegEvaluationMapper2D
Mapper to resample and display 2D slices of registration evaluation visualization.
Definition: mitkRegEvaluationMapper2D.h:54
mitkBaseRenderer.h
mitk::RegEvaluationMapper2D::LocalStorage::m_Reslicer
mitk::ExtractSliceFilter::Pointer m_Reslicer
The actual reslicer (one per renderer)
Definition: mitkRegEvaluationMapper2D.h:117
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.
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20