Shapeworks Studio  2.1
Shape analysis software suite
itkImageToVTKImageFilter.h
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 
40 template <class TInputImage >
41 class ImageToVTKImageFilter : public ProcessObject
42 {
43 public:
46  typedef ProcessObject Superclass;
47  typedef SmartPointer<Self> Pointer;
48  typedef SmartPointer<const Self> ConstPointer;
49 
51  itkNewMacro(Self);
52 
54  itkTypeMacro(ImageToVTKImageFilter, ProcessObject);
55 
57  typedef TInputImage InputImageType;
58  typedef typename InputImageType::ConstPointer InputImagePointer;
59 
60  typedef VTKImageExport< InputImageType> ExporterFilterType;
61  typedef typename ExporterFilterType::Pointer ExporterFilterPointer;
62 
65  vtkImageData * GetOutput() const;
66 
68  void SetInput( const InputImageType * );
69 
73  vtkImageImport * GetImporter() const;
74 
78  ExporterFilterType * GetExporter() const;
79 
81  void Update();
82 
83 protected:
85  virtual ~ImageToVTKImageFilter();
86 
87 private:
88  ImageToVTKImageFilter(const Self&); //purposely not implemented
89  void operator=(const Self&); //purposely not implemented
90 
91  ExporterFilterPointer m_Exporter;
92  vtkImageImport * m_Importer;
93 };
94 
95 } // end namespace itk
96 
97 //#ifndef ITK_MANUAL_INSTANTIATION
98 #include "itkImageToVTKImageFilter.hxx"
99 //#endif
100 
101 #endif
ExporterFilterType * GetExporter() const
void SetInput(const InputImageType *)
Converts an ITK image into a VTK image and plugs a itk data pipeline to a VTK datapipeline.
itkTypeMacro(ImageToVTKImageFilter, ProcessObject)
vtkImageImport * GetImporter() const