1 #ifndef __itkVTKImageToImageFilter_h
\r
2 #define __itkVTKImageToImageFilter_h
\r
3 #include "itkVTKImageImport.h"
\r
4 #include "vtkImageExport.h"
\r
5 #include "vtkImageData.h"
\r
7 #ifndef vtkFloatingPointType
\r
8 #define vtkFloatingPointType float
\r
14 /** \class VTKImageToImageFilter
\r
15 * \brief Converts a VTK image into an ITK image and plugs a
\r
16 * vtk data pipeline to an ITK datapipeline.
\r
18 * This class puts together an itkVTKImageImporter and a vtkImageExporter.
\r
19 * It takes care of the details related to the connection of ITK and VTK
\r
20 * pipelines. The User will perceive this filter as an adaptor to which
\r
21 * a vtkImage can be plugged as input and an itk::Image is produced as
\r
24 * \ingroup ImageFilters
\r
26 template <class TOutputImage >
\r
27 class ITK_EXPORT VTKImageToImageFilter : public ProcessObject
\r
30 /** Standard class typedefs. */
\r
31 typedef VTKImageToImageFilter Self;
\r
32 typedef ProcessObject Superclass;
\r
33 typedef SmartPointer<Self> Pointer;
\r
34 typedef SmartPointer<const Self> ConstPointer;
\r
36 /** Method for creation through the object factory. */
\r
39 /** Run-time type information (and related methods). */
\r
40 itkTypeMacro(VTKImageToImageFilter, ProcessObject);
\r
42 /** Some typedefs. */
\r
43 typedef TOutputImage OutputImageType;
\r
44 typedef typename OutputImageType::ConstPointer OutputImagePointer;
\r
45 typedef VTKImageImport< OutputImageType > ImporterFilterType;
\r
46 typedef typename ImporterFilterType::Pointer ImporterFilterPointer;
\r
48 /** Get the output in the form of a vtkImage.
\r
49 This call is delegated to the internal vtkImageImporter filter */
\r
50 const OutputImageType * GetOutput() const;
\r
52 /** Set the input in the form of a vtkImageData */
\r
53 void SetInput( vtkImageData * );
\r
55 /** Return the internal VTK image exporter filter.
\r
56 This is intended to facilitate users the access
\r
57 to methods in the exporter */
\r
58 vtkImageExport * GetExporter() const;
\r
60 /** Return the internal ITK image importer filter.
\r
61 This is intended to facilitate users the access
\r
62 to methods in the importer */
\r
63 ImporterFilterType * GetImporter() const;
\r
65 /** This call delegate the update to the importer */
\r
69 VTKImageToImageFilter();
\r
70 virtual ~VTKImageToImageFilter();
\r
73 VTKImageToImageFilter(const Self&); //purposely not implemented
\r
74 void operator=(const Self&); //purposely not implemented
\r
76 ImporterFilterPointer m_Importer;
\r
77 vtkImageExport * m_Exporter;
\r
81 } // end namespace itk
\r
83 #ifndef ITK_MANUAL_INSTANTIATION
\r
84 #include "itkVTKImageToImageFilter.txx"
\r