1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: itkImageToVTKImageFilter.h,v $
6 Date: $Date: 2012/11/15 12:45:28 $
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 __itkImageToVTKImageFilter_h
18 #define __itkImageToVTKImageFilter_h
20 #include "itkVTKImageExport.h"
21 #include "vtkImageImport.h"
22 #include "vtkImageData.h"
28 /** \class ImageToVTKImageFilter
29 * \brief Converts an ITK image into a VTK image and plugs a
30 * itk data pipeline to a VTK datapipeline.
32 * This class puts together an itkVTKImageExporter and a vtkImageImporter.
33 * It takes care of the details related to the connection of ITK and VTK
34 * pipelines. The User will perceive this filter as an adaptor to which
35 * an itk::Image can be plugged as input and a vtkImage is produced as
38 * \ingroup ImageFilters
40 template <class TInputImage >
41 class ITK_EXPORT ImageToVTKImageFilter : public ProcessObject
44 /** Standard class typedefs. */
45 typedef ImageToVTKImageFilter Self;
46 typedef ProcessObject Superclass;
47 typedef SmartPointer<Self> Pointer;
48 typedef SmartPointer<const Self> ConstPointer;
50 /** Method for creation through the object factory. */
53 /** Run-time type information (and related methods). */
54 itkTypeMacro(ImageToVTKImageFilter, ProcessObject);
57 typedef TInputImage InputImageType;
58 typedef typename InputImageType::ConstPointer InputImagePointer;
59 typedef VTKImageExport< InputImageType> ExporterFilterType;
60 typedef typename ExporterFilterType::Pointer ExporterFilterPointer;
62 /** Get the output in the form of a vtkImage.
63 This call is delegated to the internal vtkImageImporter filter */
64 vtkImageData * GetOutput() const;
66 /** Set the input in the form of an itk::Image */
67 void SetInput( const InputImageType * );
69 /** Return the internal VTK image importer filter.
70 This is intended to facilitate users the access
71 to methods in the importer */
72 vtkImageImport * GetImporter() const;
74 /** Return the internal ITK image exporter filter.
75 This is intended to facilitate users the access
76 to methods in the exporter */
77 ExporterFilterType * GetExporter() const;
79 /** This call delegate the update to the importer */
86 ImageToVTKImageFilter();
87 virtual ~ImageToVTKImageFilter();
90 ImageToVTKImageFilter(const Self&); //purposely not implemented
91 void operator=(const Self&); //purposely not implemented
93 ExporterFilterPointer m_Exporter;
94 vtkImageImport * m_Importer;
95 std::vector<double> m_vtest;
98 } // end namespace itk
100 #ifndef ITK_MANUAL_INSTANTIATION
101 #include "itkImageToVTKImageFilter.txx"