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