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