ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkVTKVisualizeImageLevelSetIsoValues.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 #ifndef itkVTKVisualizeImageLevelSetIsoValues_h
19 #define itkVTKVisualizeImageLevelSetIsoValues_h
20 
22 
23 #include "itkConceptChecking.h"
26 
27 #include "vtkImageData.h"
28 #include "vtkLookupTable.h"
29 #include "vtkMarchingSquares.h"
30 #include "vtkMarchingCubes.h"
31 #include "vtkPolyDataMapper.h"
32 #include "vtkActor.h"
33 #include "vtkScalarBarActor.h"
34 #include "vtkProperty.h"
35 #include "vtkRenderWindowInteractor.h"
36 
37 namespace itk
38 {
47 template< typename TImage, typename TLevelSet >
48 class ITK_TEMPLATE_EXPORT VTKVisualizeImageLevelSetIsoValues
49 {};
50 
56 template< typename TInputPixel, typename TLevelSet >
57 class ITK_TEMPLATE_EXPORT VTKVisualizeImageLevelSetIsoValues< Image< TInputPixel, 2 >, TLevelSet >
59  Image< TInputPixel, 2 >,
60  ImageToVTKImageFilter< Image< TInputPixel, 2 > > >
61 {
62 public:
68 
70  itkNewMacro(Self);
71 
74 
76 
77  typedef TLevelSet LevelSetType;
78 
79  void SetLevelSet( LevelSetType * levelSet );
80 
82  void SetNumberOfLevels( const SizeValueType numLevels );
83  SizeValueType GetNumberOfLevels() const;
85 
88  void SetLevelLimit( double iLimit );
89  double GetLevelLimit() const;
91 
92 #ifdef ITK_USE_CONCEPT_CHECKING
93  itkConceptMacro( Is2Dimensional,
95 #endif
96 
97 protected:
100 
102  virtual void PrepareVTKPipeline();
103 
104 private:
105  ITK_DISALLOW_COPY_AND_ASSIGN(VTKVisualizeImageLevelSetIsoValues);
106 
108  typedef typename LevelSetConverterType::Pointer LevelSetConverterPointer;
109 
111 
112  vtkSmartPointer< vtkMarchingSquares > m_MarchingSquare;
113  vtkSmartPointer< vtkPolyDataMapper > m_ContourMapper;
114  vtkSmartPointer< vtkActor > m_ContourActor;
115  vtkSmartPointer< vtkScalarBarActor > m_ScalarBar;
116  vtkSmartPointer< vtkLookupTable > m_Lut;
117 
120  double m_LevelLimit;
121 };
122 
123 
129 template< typename TInputPixel, typename TLevelSet >
130 class ITK_TEMPLATE_EXPORT VTKVisualizeImageLevelSetIsoValues< Image< TInputPixel, 3 >, TLevelSet >
131  : public VTKVisualizeImageLevelSet<
132  Image< TInputPixel, 3 >,
133  ImageToVTKImageFilter< Image< TInputPixel, 3 > > >
134 {
135 public:
141 
143  itkNewMacro(Self);
144 
147 
149 
150  typedef TLevelSet LevelSetType;
151 
152  virtual void SetInputImage( const InputImageType * iImage );
153  void SetLevelSet( LevelSetType * levelSet );
154 
156  void SetNumberOfLevels( const SizeValueType numLevels );
157  SizeValueType GetNumberOfLevels() const;
159 
162  void SetLevelLimit( double iLimit );
163  double GetLevelLimit() const;
165 
166 #ifdef ITK_USE_CONCEPT_CHECKING
167  itkConceptMacro( Is3Dimensional,
169 #endif
170 
171 protected:
174 
176  virtual void PrepareVTKPipeline();
177 
178 private:
179  ITK_DISALLOW_COPY_AND_ASSIGN(VTKVisualizeImageLevelSetIsoValues);
180 
182  typedef typename LevelSetConverterType::Pointer LevelSetConverterPointer;
183 
185 
186  vtkSmartPointer< vtkMarchingCubes > m_MarchingCubes;
187  vtkSmartPointer< vtkPolyDataMapper > m_ContourMapper;
188  vtkSmartPointer< vtkActor > m_ContourActor;
189  vtkSmartPointer< vtkScalarBarActor > m_ScalarBar;
190  vtkSmartPointer< vtkLookupTable > m_Lut;
191 
194  double m_LevelLimit;
195 };
196 } // end namespace itk
197 
198 #ifndef ITK_MANUAL_INSTANTIATION
199 #include "itkVTKVisualizeImageLevelSetIsoValues.hxx"
200 #endif
201 
202 #endif
Light weight base class for most itk classes.
VTKVisualizeImageLevelSet< Image< TInputPixel, 3 >, ImageToVTKImageFilter< Image< TInputPixel, 3 > > > Superclass
unsigned long SizeValueType
Definition: itkIntTypes.h:143
SizeValueType IdentifierType
Definition: itkIntTypes.h:147
Converts an ITK image into a VTK image and plugs a itk data pipeline to a VTK datapipeline.
VTKVisualizeImageLevelSet< Image< TInputPixel, 2 >, ImageToVTKImageFilter< Image< TInputPixel, 2 > > > Superclass
Base class for visualizing level sets defined on an image with VTK.
#define itkConceptMacro(name, concept)
Templated n-dimensional image class.
Definition: itkImage.h:75