ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkVTKVisualize2DSparseLevelSetLayersBase.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 itkVTKVisualize2DSparseLevelSetLayersBase_h
20 #define itkVTKVisualize2DSparseLevelSetLayersBase_h
21 
23 
24 #include "itkConceptChecking.h"
25 
27 
28 #include "vtkCornerAnnotation.h"
29 #include "vtkImageData.h"
30 #include "vtkLookupTable.h"
31 #include "vtkMarchingSquares.h"
32 #include "vtkPolyDataMapper.h"
33 #include "vtkActor.h"
34 #include "vtkImageActor.h"
35 #include "vtkScalarBarActor.h"
36 #include "vtkProperty.h"
37 #include "vtkRenderer.h"
38 #include "vtkRenderWindowInteractor.h"
39 #include "vtkRenderWindow.h"
40 #include "vtkImageShiftScale.h"
41 
42 #include "vtkCaptureScreen.h"
43 #include "vtkPNGWriter.h"
44 
45 namespace itk
46 {
53 template< typename TInputImage, typename TLevelSet >
54 class ITK_TEMPLATE_EXPORT VTKVisualize2DSparseLevelSetLayersBase :
55  public VTKVisualizeImageLevelSet< TInputImage, ImageToRGBVTKImageFilter< TInputImage > >
56 {
57 public:
58  ITK_DISALLOW_COPY_AND_ASSIGN(VTKVisualize2DSparseLevelSetLayersBase);
59 
62 
67 
70 
71  using InputImageType = TInputImage;
72  using InputPixelType = typename InputImageType::PixelType;
73 
74  using LevelSetType = TLevelSet;
76 
77  void SetInputImage( const InputImageType* image ) override;
78  void SetLevelSet( LevelSetType * levelSet );
79 
80 #ifdef ITK_USE_CONCEPT_CHECKING
81  itkConceptMacro( Is2Dimensional,
83 #endif
84 
85 protected:
88 
90  vtkSmartPointer< vtkImageData > m_VTKImage;
91  vtkSmartPointer< vtkImageActor > m_VTKImageActor;
92 
93  void PrepareVTKPipeline() override;
94 
95  virtual std::string GetLevelSetRepresentationName() const = 0;
96 
97  virtual void AddLayers() = 0;
98 };
99 }
100 
101 #ifndef ITK_MANUAL_INSTANTIATION
102 #include "itkVTKVisualize2DSparseLevelSetLayersBase.hxx"
103 #endif
104 #endif
Light weight base class for most itk classes.
Derived class for the shi representation of level-set function.
Converts an ITK image into a VTK image.
Base class for visualizing level sets defined on an image with VTK.
#define itkConceptMacro(name, concept)