ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkVTKVisualizeImageLevelSet.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 itkVTKVisualizeImageLevelSet_h
19 #define itkVTKVisualizeImageLevelSet_h
20 
21 #include "itkLightObject.h"
22 #include "itkIntTypes.h"
23 
24 #include "vtkRenderer.h"
25 #include "vtkRenderWindow.h"
26 #include "vtkSmartPointer.h"
27 #include "vtkImageShiftScale.h"
28 #include "vtkImageActor.h"
29 #include "vtkCornerAnnotation.h"
30 
31 namespace itk
32 {
33 
43 template< typename TInputImage, typename TInputImageConverter >
44 class ITK_TEMPLATE_EXPORT VTKVisualizeImageLevelSet: public LightObject
45 {
46 public:
47  ITK_DISALLOW_COPY_AND_ASSIGN(VTKVisualizeImageLevelSet);
48 
53 
55  itkTypeMacro( VTKVisualizeImageLevelSet, LightObject );
56 
58  using InputImageType = TInputImage;
59 
61  using InputImageConverterType = TInputImageConverter;
62 
64  virtual void SetInputImage( const InputImageType * inputImage );
65 
67  void SetScreenCapture( const bool iCapture );
68  bool GetScreenCapture() const;
70 
73  virtual void Update();
74 
76  vtkRenderer * GetRenderer();
77 
79  vtkRenderWindow * GetRenderWindow();
80  void SetRenderWindow( vtkRenderWindow * renderWindow );
82 
85  void SetCurrentIteration( const IdentifierType iteration );
86  IdentifierType GetCurrentIteration() const;
88 
90  void SetScreenCapturePrefix( const char * prefix );
91 
92 protected:
94  ~VTKVisualizeImageLevelSet() override;
95 
97  virtual void PrepareVTKPipeline() = 0;
98 
99  typename InputImageConverterType::Pointer m_InputImageConverter;
100 
101  vtkSmartPointer< vtkRenderer > m_Renderer;
102 
103 private:
107 
108  vtkSmartPointer< vtkRenderWindow > m_RenderWindow;
109  vtkSmartPointer< vtkCornerAnnotation > m_Annotation;
110 };
111 
112 } // end namespace itk
113 
114 #ifndef ITK_MANUAL_INSTANTIATION
115 #include "itkVTKVisualizeImageLevelSet.hxx"
116 #endif
117 
118 #endif
Light weight base class for most itk classes.
vtkSmartPointer< vtkRenderWindow > m_RenderWindow
InputImageConverterType::Pointer m_InputImageConverter
SizeValueType IdentifierType
Definition: itkIntTypes.h:87
Converts an ITK image into a VTK image and plugs a itk data pipeline to a VTK datapipeline.
vtkSmartPointer< vtkRenderer > m_Renderer
vtkSmartPointer< vtkCornerAnnotation > m_Annotation
Base class for visualizing level sets defined on an image with VTK.