NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkImageToVTKImageFilter.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 __itkImageToVTKImageFilter_h
19 #define __itkImageToVTKImageFilter_h
20 
21 #include "itkVTKImageExport.h"
22 #include "vtkImageImport.h"
23 #include "vtkImageData.h"
24 
25 namespace itk
26 {
27 
45 template <typename TInputImage >
46 class ImageToVTKImageFilter : public ProcessObject
47 {
48 public:
51  typedef ProcessObject Superclass;
52  typedef SmartPointer<Self> Pointer;
53  typedef SmartPointer<const Self> ConstPointer;
54 
56  itkNewMacro(Self);
57 
59  itkTypeMacro(ImageToVTKImageFilter, ProcessObject);
60 
62  typedef TInputImage InputImageType;
63  typedef typename InputImageType::ConstPointer InputImagePointer;
64 
65  typedef VTKImageExport< InputImageType> ExporterFilterType;
66  typedef typename ExporterFilterType::Pointer ExporterFilterPointer;
67 
70  vtkImageData * GetOutput() const;
71 
73  using Superclass::SetInput;
74  void SetInput( const InputImageType * );
75  InputImageType * GetInput();
76 
80  vtkImageImport * GetImporter() const;
81 
85  ExporterFilterType * GetExporter() const;
86 
88  void Update() override;
89 
90 protected:
92  virtual ~ImageToVTKImageFilter();
93 
94 private:
95  ImageToVTKImageFilter(const Self&); //purposely not implemented
96  void operator=(const Self&); //purposely not implemented
97 
98  ExporterFilterPointer m_Exporter;
99  vtkImageImport * m_Importer;
100 };
101 
102 } // end namespace itk
103 
104 #ifndef ITK_MANUAL_INSTANTIATION
105 #include "itkImageToVTKImageFilter.hxx"
106 #endif
107 
108 #endif
VTKImageExport< InputImageType > ExporterFilterType
Definition: itkImageToVTKImageFilter.h:65
void SetInput(const InputImageType *)
InputImageType::ConstPointer InputImagePointer
Definition: itkImageToVTKImageFilter.h:63
InputImageType * GetInput()
Definition: niftkITKAffineResampleImage.cxx:74
vtkImageData * GetOutput() const
SmartPointer< const Self > ConstPointer
Definition: itkImageToVTKImageFilter.h:53
ExporterFilterType * GetExporter() const
ImageToVTKImageFilter Self
Definition: itkImageToVTKImageFilter.h:50
ProcessObject Superclass
Definition: itkImageToVTKImageFilter.h:51
SmartPointer< Self > Pointer
Definition: itkImageToVTKImageFilter.h:52
ExporterFilterType::Pointer ExporterFilterPointer
Definition: itkImageToVTKImageFilter.h:66
Converts an ITK image into a VTK image and plugs a itk data pipeline to a VTK datapipeline.
Definition: itkImageToVTKImageFilter.h:46
vtkImageImport * GetImporter() const
TInputImage InputImageType
Definition: itkImageToVTKImageFilter.h:59