ITK  4.6.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 >
37  public VTKVisualizeImageLevelSet< TInputImage, ImageToVTKImageFilter< TInputImage > >
38 {
39 public:
44 
45  itkNewMacro( Self );
46 
48  itkTypeMacro(itkVTKVisualize2DLevelSetAsElevationMap, VTKVisualizeImageLevelSet);
49 
51  typedef typename InputImageType::SizeType InputImageSizeType;
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  VTKVisualize2DLevelSetAsElevationMap( const Self & ); // purposely not implemented
92  void operator=( const VTKVisualize2DLevelSetAsElevationMap & ); // purposely not implemented
93 
95 
96  vtkSmartPointer< vtkPolyData > m_Mesh;
97  vtkSmartPointer< vtkScalarBarActor > m_ScalarBarActor;
98  vtkSmartPointer< vtkPolyDataMapper > m_MeshMapper;
99  vtkSmartPointer< vtkActor > m_SurfaceActor;
100 
102 
104  double m_MinValue;
105  double m_MaxValue;
106 
108 
109 };
110 
111 } // end namespace itk
112 
113 #ifndef ITK_MANUAL_INSTANTIATION
114 #include "itkVTKVisualize2DLevelSetAsElevationMap.hxx"
115 #endif
116 
117 #endif // itkVTKVisualize2DLevelSetAsElevationMap_H
Light weight base class for most itk classes.
void operator=(const VTKVisualize2DLevelSetAsElevationMap &)
unsigned long SizeValueType
Definition: itkIntTypes.h:143
void SetLevelSet(LevelSetType *levelSet)
VTKVisualizeImageLevelSet< TInputImage, ImageToVTKImageFilter< TInputImage > > Superclass
Base class for visualizing level sets defined on an image with VTK.
#define itkConceptMacro(name, concept)