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