CustusX  2021.11.29-dev+develop.644e4
An IGT application
itkVTKImageToImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkVTKImageToImageFilter.h,v $
5  Language: C++
6  Date: $Date: 2006-10-18 13:55:58 $
7  Version: $Revision: 1.3 $
8 
9  Copyright (c) 2002 Insight Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkVTKImageToImageFilter_h
18 #define __itkVTKImageToImageFilter_h
19 
20 #include "itkVTKImageImport.h"
21 #include "vtkImageExport.h"
22 #include "vtkImageData.h"
23 
24 #ifndef vtkFloatingPointType
25 #define vtkFloatingPointType float
26 #endif
27 
28 namespace itk
29 {
30 
43 template <class TOutputImage >
44 class ITK_EXPORT VTKImageToImageFilter : public ProcessObject
45 {
46 public:
49  typedef ProcessObject Superclass;
50  typedef SmartPointer<Self> Pointer;
51  typedef SmartPointer<const Self> ConstPointer;
52 
54  itkNewMacro(Self);
55 
57  itkTypeMacro(VTKImageToImageFilter, ProcessObject);
58 
60  typedef TOutputImage OutputImageType;
61  typedef typename OutputImageType::ConstPointer OutputImagePointer;
62  typedef VTKImageImport< OutputImageType > ImporterFilterType;
63  typedef typename ImporterFilterType::Pointer ImporterFilterPointer;
64 
67  const OutputImageType * GetOutput() const;
68 
70  void SetInput( vtkImageData * );
71 
75  vtkImageExport * GetExporter() const;
76 
80  ImporterFilterType * GetImporter() const;
81 
83  void Update();
84 
85 protected:
87  virtual ~VTKImageToImageFilter();
88 
89 private:
90  VTKImageToImageFilter(const Self&); //purposely not implemented
91  void operator=(const Self&); //purposely not implemented
92 
93  ImporterFilterPointer m_Importer;
94  vtkImageExport * m_Exporter;
95 
96 };
97 
98 } // end namespace itk
99 
100 #ifndef ITK_MANUAL_INSTANTIATION
101 #include "itkVTKImageToImageFilter.txx"
102 #endif
103 
104 #endif
105 
106 
107 
ImporterFilterType::Pointer ImporterFilterPointer
SmartPointer< const Self > ConstPointer
VTKImageImport< OutputImageType > ImporterFilterType
OutputImageType::ConstPointer OutputImagePointer
Converts a VTK image into an ITK image and plugs a vtk data pipeline to an ITK datapipeline.