1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://www.centreleonberard.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef __itkImageToVTKImageFilter_h
19 #define __itkImageToVTKImageFilter_h
20 #include "itkVTKImageExport.h"
21 #include "vtkImageImport.h"
22 #include "vtkImageData.h"
27 /** \class ImageToVTKImageFilter
28 * \brief Converts an ITK image into a VTK image and plugs a
29 * itk data pipeline to a VTK datapipeline.
31 * This class puts together an itkVTKImageExporter and a vtkImageImporter.
32 * It takes care of the details related to the connection of ITK and VTK
33 * pipelines. The User will perceive this filter as an adaptor to which
34 * an itk::Image can be plugged as input and a vtkImage is produced as
37 * \ingroup ImageFilters
39 template <class TInputImage >
40 class ITK_EXPORT ImageToVTKImageFilter : public ProcessObject
43 /** Standard class typedefs. */
44 typedef ImageToVTKImageFilter Self;
45 typedef ProcessObject Superclass;
46 typedef SmartPointer<Self> Pointer;
47 typedef SmartPointer<const Self> ConstPointer;
49 /** Method for creation through the object factory. */
52 /** Run-time type information (and related methods). */
53 itkTypeMacro(ImageToVTKImageFilter, ProcessObject);
56 typedef TInputImage InputImageType;
57 typedef typename InputImageType::ConstPointer InputImagePointer;
58 typedef VTKImageExport< InputImageType> ExporterFilterType;
59 typedef typename ExporterFilterType::Pointer ExporterFilterPointer;
61 /** Get the output in the form of a vtkImage.
62 This call is delegated to the internal vtkImageImporter filter */
63 vtkImageData * GetOutput() const;
65 /** Set the input in the form of an itk::Image */
66 void SetInput( const InputImageType * );
68 /** Return the internal VTK image importer filter.
69 This is intended to facilitate users the access
70 to methods in the importer */
71 vtkImageImport * GetImporter() const;
73 /** Return the internal ITK image exporter filter.
74 This is intended to facilitate users the access
75 to methods in the exporter */
76 ExporterFilterType * GetExporter() const;
78 /** This call delegate the update to the importer */
82 ImageToVTKImageFilter();
83 virtual ~ImageToVTKImageFilter();
86 ImageToVTKImageFilter(const Self&); //purposely not implemented
87 void operator=(const Self&); //purposely not implemented
89 ExporterFilterPointer m_Exporter;
90 vtkImageImport * m_Importer;
94 } // end namespace itk
96 #ifndef ITK_MANUAL_INSTANTIATION
97 #include "itkImageToVTKImageFilter.txx"