Medical Imaging Interaction Toolkit  2016.11.0
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,
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 MITK_REG_EVALUATION_MAPPER_2D_H
18 #define MITK_REG_EVALUATION_MAPPER_2D_H
19 
20 //MatchPoint
21 #include <mapRegistration.h>
23 
24 //MITK
25 #include <mitkCommon.h>
26 
27 //MITK Rendering
28 #include "mitkBaseRenderer.h"
29 #include "mitkVtkMapper.h"
30 #include "mitkExtractSliceFilter.h"
31 
32 //VTK
33 #include <vtkSmartPointer.h>
34 #include <vtkPropAssembly.h>
35 
36 //MITK
38 
39 class vtkActor;
40 class vtkPolyDataMapper;
41 class vtkPlaneSource;
42 class vtkImageData;
43 class vtkLookupTable;
44 class vtkImageExtractComponents;
45 class vtkImageReslice;
46 class vtkImageChangeInformation;
47 class vtkPoints;
49 class vtkPolyData;
50 class vtkMitkApplyLevelWindowToRGBFilter;
52 
53 namespace mitk {
54 
59 {
60 
61 public:
64 
66  itkFactorylessNewMacro(Self)
67  itkCloneMacro(Self)
68 
69  const mitk::DataNode* GetTargetNode(void);
70  const mitk::DataNode* GetMovingNode(void);
72  const mitk::Image *GetTargetImage(void);
74  const mitk::Image *GetMovingImage(void);
76  const mitk::MAPRegistrationWrapper *GetRegistration(void);
77 
80  virtual void Update(mitk::BaseRenderer * renderer);
81 
82  //### methods of MITK-VTK rendering pipeline
83  virtual vtkProp* GetVtkProp(mitk::BaseRenderer* renderer);
84  //### end of methods of MITK-VTK rendering pipeline
85 
94  {
95  public:
97  vtkSmartPointer<vtkActor> m_Actor;
98 
99  vtkSmartPointer<vtkPropAssembly> m_Actors;
101  vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
103  vtkSmartPointer<vtkImageData> m_EvaluationImage;
104 
112  vtkSmartPointer<vtkPolyData> m_EmptyPolyData;
114  vtkSmartPointer<vtkPlaneSource> m_Plane;
116  vtkSmartPointer<vtkTexture> m_Texture;
118  vtkSmartPointer<vtkLookupTable> m_ColorLookupTable;
119  vtkSmartPointer<vtkLookupTable> m_DefaultLookupTable;
122 
128 
130  itk::TimeStamp m_LastUpdateTime;
131 
134 
136  vtkSmartPointer<vtkMitkLevelWindowFilter> m_TargetLevelWindowFilter;
137 
139  vtkSmartPointer<vtkMitkLevelWindowFilter> m_MappedLevelWindowFilter;
140 
141  vtkSmartPointer<vtkImageExtractComponents> m_TargetExtractFilter;
142  vtkSmartPointer<vtkImageExtractComponents> m_MappedExtractFilter;
143 
145  LocalStorage();
147  ~LocalStorage();
148  };
149 
152 
154  LocalStorage* GetLocalStorage(mitk::BaseRenderer* renderer);
155 
157  static void SetDefaultProperties(mitk::DataNode* node, mitk::BaseRenderer* renderer = NULL, bool overwrite = false);
158 
159 protected:
163  void TransformActor(mitk::BaseRenderer* renderer);
164 
180  void GeneratePlane(mitk::BaseRenderer* renderer, double planeBounds[6]);
181 
185  virtual ~RegEvaluationMapper2D();
186 
199  virtual void GenerateDataForRenderer(mitk::BaseRenderer *renderer);
200 
201  void PrepareContour( mitk::DataNode* datanode, LocalStorage * localStorage );
202 
203  void PrepareDifference( LocalStorage * localStorage );
204 
205  void PrepareWipe(mitk::DataNode* datanode, LocalStorage * localStorage, const Point2D& currentIndex2D);
206 
207  void PrepareCheckerBoard( mitk::DataNode* datanode, LocalStorage * localStorage );
208 
209  void PrepareColorBlend( LocalStorage * localStorage );
210 
211  void PrepareBlend( mitk::DataNode* datanode, LocalStorage * localStorage );
212 
216  float CalculateLayerDepth(mitk::BaseRenderer* renderer);
217 
222  void ApplyLookuptable(mitk::BaseRenderer* renderer, const mitk::DataNode* dataNode, vtkMitkLevelWindowFilter* levelFilter);
223 
229  void ApplyLevelWindow(mitk::BaseRenderer *renderer, const mitk::DataNode* dataNode, vtkMitkLevelWindowFilter* levelFilter);
230 
232  void ApplyOpacity( mitk::BaseRenderer* renderer );
233 
244  bool RenderingGeometryIntersectsImage( const Geometry2D* renderingGeometry, SlicedGeometry3D* imageGeometry );
245 };
246 
247 } // namespace mitk
248 
249 #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:200
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.
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:35
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:53
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:54
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:44
vtkSmartPointer< vtkActor > m_Actor
Actor of a 2D render window.
Image class for storing images.
Definition: mitkImage.h:76
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:66