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 __itkImageToVTKImageFilter_h
\r
15 #define __itkImageToVTKImageFilter_h
\r
17 #include "itkVTKImageExport.h"
\r
18 #include "vtkImageImport.h"
\r
19 #include "vtkImageData.h"
\r
24 /** \class ImageToVTKImageFilter
\r
25 * \brief Converts an ITK image into a VTK image and plugs a
\r
26 * itk data pipeline to a VTK datapipeline.
\r
28 * This class puts together an itkVTKImageExporter and a vtkImageImporter.
\r
29 * It takes care of the details related to the connection of ITK and VTK
\r
30 * pipelines. The User will perceive this filter as an adaptor to which
\r
31 * an itk::Image can be plugged as input and a vtkImage is produced as
\r
34 * \ingroup ImageFilters
\r
36 template <class TInputImage >
\r
37 class ITK_EXPORT ImageToVTKImageFilter : public ProcessObject
\r
40 /** Standard class typedefs. */
\r
41 typedef ImageToVTKImageFilter Self;
\r
42 typedef ProcessObject Superclass;
\r
43 typedef SmartPointer<Self> Pointer;
\r
44 typedef SmartPointer<const Self> ConstPointer;
\r
46 /** Method for creation through the object factory. */
\r
49 /** Run-time type information (and related methods). */
\r
50 itkTypeMacro(ImageToVTKImageFilter, ProcessObject);
\r
52 /** Some typedefs. */
\r
53 typedef TInputImage InputImageType;
\r
54 typedef typename InputImageType::ConstPointer InputImagePointer;
\r
55 typedef VTKImageExport< InputImageType> ExporterFilterType;
\r
56 typedef typename ExporterFilterType::Pointer ExporterFilterPointer;
\r
58 /** Get the output in the form of a vtkImage.
\r
59 This call is delegated to the internal vtkImageImporter filter */
\r
60 vtkImageData * GetOutput() const;
\r
62 /** Set the input in the form of an itk::Image */
\r
63 void SetInput( const InputImageType * );
\r
65 /** Return the internal VTK image importer filter.
\r
66 This is intended to facilitate users the access
\r
67 to methods in the importer */
\r
68 vtkImageImport * GetImporter() const;
\r
70 /** Return the internal ITK image exporter filter.
\r
71 This is intended to facilitate users the access
\r
72 to methods in the exporter */
\r
73 ExporterFilterType * GetExporter() const;
\r
75 /** This call delegate the update to the importer */
\r
79 ImageToVTKImageFilter();
\r
80 virtual ~ImageToVTKImageFilter();
\r
83 ImageToVTKImageFilter(const Self&); //purposely not implemented
\r
84 void operator=(const Self&); //purposely not implemented
\r
86 ExporterFilterPointer m_Exporter;
\r
87 vtkImageImport * m_Importer;
\r
91 } // end namespace itk
\r
93 #ifndef ITK_MANUAL_INSTANTIATION
\r
94 #include "itkImageToVTKImageFilter.txx"
\r