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://oncora1.lyon.fnclcc.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 __itkVTKImageToImageFilter_h
19 #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 */
68 OutputImageType * GetOutput() const;
70 /** Set the input in the form of a vtkImageData */
71 void SetInput( vtkImageData * );
73 /** Return the internal VTK image exporter filter.
74 This is intended to facilitate users the access
75 to methods in the exporter */
76 vtkImageExport * GetExporter() const;
78 /** Return the internal ITK image importer filter.
79 This is intended to facilitate users the access
80 to methods in the importer */
81 ImporterFilterType * GetImporter() const;
83 /** This call delegate the update to the importer */
87 VTKImageToImageFilter();
88 virtual ~VTKImageToImageFilter();
91 VTKImageToImageFilter(const Self&); //purposely not implemented
92 void operator=(const Self&); //purposely not implemented
94 ImporterFilterPointer m_Importer;
95 vtkImageExport * m_Exporter;
99 } // end namespace itk
101 #ifndef ITK_MANUAL_INSTANTIATION
102 #include "itkVTKImageToImageFilter.txx"