ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkVTKVisualize2DLevelSetAsElevationMap.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef itkVTKVisualize2DLevelSetAsElevationMap_h
20 #define itkVTKVisualize2DLevelSetAsElevationMap_h
21 
23 
25 #include "itkConceptChecking.h"
26 
27 #include "vtkPolyData.h"
28 #include "vtkPolyDataMapper.h"
29 #include "vtkActor.h"
30 #include "vtkScalarBarActor.h"
31 
32 namespace itk
33 {
34 
35 template< typename TInputImage, typename TLevelSet >
36 class ITK_TEMPLATE_EXPORT VTKVisualize2DLevelSetAsElevationMap :
37  public VTKVisualizeImageLevelSet< TInputImage, ImageToVTKImageFilter< TInputImage > >
38 {
39 public:
44 
45  itkNewMacro( Self );
46 
48  itkTypeMacro(itkVTKVisualize2DLevelSetAsElevationMap, VTKVisualizeImageLevelSet);
49 
50  typedef typename Superclass::InputImageType InputImageType;
53 
54  typedef TLevelSet LevelSetType;
55  typedef typename LevelSetType::Pointer LevelSetPointer;
56 
57  void SetLevelSet( LevelSetType * levelSet );
58 
59 #ifdef ITK_USE_CONCEPT_CHECKING
60  itkConceptMacro( Is2Dimensional,
62 #endif
63 
64  /* Set the height scaling for visualization */
65  void SetHeightScaling( const double c )
66  {
67  m_HeightScaling = c;
68  }
69 
70  /* Get the height scaling for visualization */
71  double GetHeightScaling() const
72  {
73  return m_HeightScaling;
74  }
75 
76  /* Get the surface mesh*/
77  vtkPolyData* GetElevationMapMesh() const
78  {
79  return m_Mesh;
80  }
81 
82 protected:
85 
86  virtual void PrepareVTKPipeline();
87 
88  void GenerateElevationMap();
89 
90 private:
91  ITK_DISALLOW_COPY_AND_ASSIGN(VTKVisualize2DLevelSetAsElevationMap);
92 
94 
95  vtkSmartPointer< vtkPolyData > m_Mesh;
96  vtkSmartPointer< vtkScalarBarActor > m_ScalarBarActor;
97  vtkSmartPointer< vtkPolyDataMapper > m_MeshMapper;
98  vtkSmartPointer< vtkActor > m_SurfaceActor;
99 
101 
103  double m_MinValue;
104  double m_MaxValue;
105 
107 
108 };
109 
110 } // end namespace itk
111 
112 #ifndef ITK_MANUAL_INSTANTIATION
113 #include "itkVTKVisualize2DLevelSetAsElevationMap.hxx"
114 #endif
115 
116 #endif // itkVTKVisualize2DLevelSetAsElevationMap_H
Light weight base class for most itk classes.
unsigned long SizeValueType
Definition: itkIntTypes.h:143
VTKVisualizeImageLevelSet< TInputImage, ImageToVTKImageFilter< TInputImage > > Superclass
Base class for visualizing level sets defined on an image with VTK.
#define itkConceptMacro(name, concept)