Computer Assisted Medical Intervention Tool Kit  version 5.2
itkVTKImageToImageFilter.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2024 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, TIMC, 38000 Grenoble, France
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 #ifndef __itkVTKImageToImageFilter_h
26 #define __itkVTKImageToImageFilter_h
27 
28 // -- itk stuff
29 #include <itkVTKImageImport.h>
30 
31 // -- vtk stuff
32 #include <vtkImageExport.h>
33 #include <vtkImageData.h>
34 #include <vtkSmartPointer.h>
35 
36 #ifndef vtkFloatingPointType
37 #define vtkFloatingPointType float
38 #endif
39 
40 namespace itk {
41 
57 template <class TOutputImage >
58 class ITK_EXPORT VTKImageToImageFilter : public ProcessObject {
59 public:
62  typedef ProcessObject Superclass;
63  typedef SmartPointer<Self> Pointer;
64  typedef SmartPointer<const Self> ConstPointer;
65 
68 
71 
73  typedef TOutputImage OutputImageType;
74  typedef typename OutputImageType::ConstPointer OutputImagePointer;
75  typedef VTKImageImport< OutputImageType > ImporterFilterType;
76  typedef typename ImporterFilterType::Pointer ImporterFilterPointer;
77 
80  const OutputImageType* GetOutput() const;
81 
83  void SetInput(vtkSmartPointer<vtkImageData>);
84 
88  vtkSmartPointer<vtkImageExport> GetExporter() const;
89 
94 
96  void Update();
97 
98 protected:
101 
102 private:
103  VTKImageToImageFilter(const Self&); //purposely not implemented
104  void operator=(const Self&); //purposely not implemented
105 
106  ImporterFilterPointer m_Importer;
107  vtkSmartPointer<vtkImageExport> m_Exporter;
108 
109 };
110 
111 } // end namespace itk
112 
113 #ifndef ITK_MANUAL_INSTANTIATION
114 #include "itkVTKImageToImageFilter.txx"
115 #endif
116 
117 #endif
118 
119 
120 
Converts a VTK image into an ITK image and plugs a vtk data pipeline to an ITK datapipeline.
Definition: itkVTKImageToImageFilter.h:58
OutputImageType::ConstPointer OutputImagePointer
Definition: itkVTKImageToImageFilter.h:74
ImporterFilterType * GetImporter() const
Return the internal ITK image importer filter.
ProcessObject Superclass
Definition: itkVTKImageToImageFilter.h:62
itkNewMacro(Self)
Method for creation through the object factory.
ImporterFilterType::Pointer ImporterFilterPointer
Definition: itkVTKImageToImageFilter.h:76
VTKImageImport< OutputImageType > ImporterFilterType
Definition: itkVTKImageToImageFilter.h:75
TOutputImage OutputImageType
Some typedefs.
Definition: itkVTKImageToImageFilter.h:73
SmartPointer< const Self > ConstPointer
Definition: itkVTKImageToImageFilter.h:64
itkTypeMacro(VTKImageToImageFilter, ProcessObject)
Run-time type information (and related methods).
SmartPointer< Self > Pointer
Definition: itkVTKImageToImageFilter.h:63
vtkSmartPointer< vtkImageExport > GetExporter() const
Return the internal VTK image exporter filter.
VTKImageToImageFilter Self
Standard class typedefs.
Definition: itkVTKImageToImageFilter.h:61
void SetInput(vtkSmartPointer< vtkImageData >)
Set the input in the form of a vtkImageData.
void Update()
This call delegate the update to the importer.
const OutputImageType * GetOutput() const
Get the output in the form of a vtkImage.
Definition: itkImageToVTKImageFilter.h:39