1 /*=========================================================================
\r
3 Program: Insight Segmentation & Registration Toolkit
\r
6 Copyright (c) 2002 Insight Consortium. All rights reserved.
\r
7 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
\r
9 This software is distributed WITHOUT ANY WARRANTY; without even
\r
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
\r
11 PURPOSE. See the above copyright notices for more information.
\r
13 =========================================================================*/
\r
14 #ifndef __itkVTKImageToImageFilter_h
\r
15 #define __itkVTKImageToImageFilter_h
\r
17 #include "itkVTKImageImport.h"
\r
18 #include "vtkImageExport.h"
\r
19 #include "vtkImageData.h"
\r
21 #ifndef vtkFloatingPointType
\r
22 #define vtkFloatingPointType float
\r
28 /** \class VTKImageToImageFilter
\r
29 * \brief Converts a VTK image into an ITK image and plugs a
\r
30 * vtk data pipeline to an ITK datapipeline.
\r
32 * This class puts together an itkVTKImageImporter and a vtkImageExporter.
\r
33 * It takes care of the details related to the connection of ITK and VTK
\r
34 * pipelines. The User will perceive this filter as an adaptor to which
\r
35 * a vtkImage can be plugged as input and an itk::Image is produced as
\r
38 * \ingroup ImageFilters
\r
40 template <class TOutputImage >
\r
41 class ITK_EXPORT VTKImageToImageFilter : public ProcessObject
\r
44 /** Standard class typedefs. */
\r
45 typedef VTKImageToImageFilter Self;
\r
46 typedef ProcessObject Superclass;
\r
47 typedef SmartPointer<Self> Pointer;
\r
48 typedef SmartPointer<const Self> ConstPointer;
\r
50 /** Method for creation through the object factory. */
\r
53 /** Run-time type information (and related methods). */
\r
54 itkTypeMacro(VTKImageToImageFilter, ProcessObject);
\r
56 /** Some typedefs. */
\r
57 typedef TOutputImage OutputImageType;
\r
58 typedef typename OutputImageType::ConstPointer OutputImagePointer;
\r
59 typedef VTKImageImport< OutputImageType > ImporterFilterType;
\r
60 typedef typename ImporterFilterType::Pointer ImporterFilterPointer;
\r
62 /** Get the output in the form of a vtkImage.
\r
63 This call is delegated to the internal vtkImageImporter filter */
\r
64 const OutputImageType * GetOutput() const;
\r
66 /** Set the input in the form of a vtkImageData */
\r
67 void SetInput( vtkImageData * );
\r
69 /** Return the internal VTK image exporter filter.
\r
70 This is intended to facilitate users the access
\r
71 to methods in the exporter */
\r
72 vtkImageExport * GetExporter() const;
\r
74 /** Return the internal ITK image importer filter.
\r
75 This is intended to facilitate users the access
\r
76 to methods in the importer */
\r
77 ImporterFilterType * GetImporter() const;
\r
79 /** This call delegate the update to the importer */
\r
83 VTKImageToImageFilter();
\r
84 virtual ~VTKImageToImageFilter();
\r
87 VTKImageToImageFilter(const Self&); //purposely not implemented
\r
88 void operator=(const Self&); //purposely not implemented
\r
90 ImporterFilterPointer m_Importer;
\r
91 vtkImageExport * m_Exporter;
\r
95 } // end namespace itk
\r
97 #ifndef ITK_MANUAL_INSTANTIATION
\r
98 #include "itkVTKImageToImageFilter.txx"
\r