]> Creatis software - clitk.git/blob - itk/itkVTKImageToImageFilter.h
Merge branch 'master' into PacsConnection
[clitk.git] / itk / itkVTKImageToImageFilter.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
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
8
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.
12
13   It is distributed under dual licence
14
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"
23
24 #ifndef vtkFloatingPointType
25 #define vtkFloatingPointType float
26 #endif
27
28 namespace itk
29 {
30
31 /** \class VTKImageToImageFilter
32  * \brief Converts a VTK image into an ITK image and plugs a
33  *  vtk data pipeline to an ITK datapipeline.
34  *
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
39  *  output.
40  *
41  * \ingroup   ImageFilters
42  */
43 template <class TOutputImage >
44 class ITK_EXPORT VTKImageToImageFilter : public ProcessObject
45 {
46 public:
47     /** Standard class typedefs. */
48     typedef VTKImageToImageFilter       Self;
49     typedef ProcessObject             Superclass;
50     typedef SmartPointer<Self>        Pointer;
51     typedef SmartPointer<const Self>  ConstPointer;
52
53     /** Method for creation through the object factory. */
54     itkNewMacro(Self);
55
56     /** Run-time type information (and related methods). */
57     itkTypeMacro(VTKImageToImageFilter, ProcessObject);
58
59     /** Some typedefs. */
60     typedef TOutputImage OutputImageType;
61     typedef typename    OutputImageType::ConstPointer    OutputImagePointer;
62     typedef VTKImageImport< OutputImageType >   ImporterFilterType;
63     typedef typename ImporterFilterType::Pointer         ImporterFilterPointer;
64
65     /** Get the output in the form of a vtkImage.
66         This call is delegated to the internal vtkImageImporter filter  */
67     //    const 
68     OutputImageType *  GetOutput() const;
69
70     /** Set the input in the form of a vtkImageData */
71     void SetInput( vtkImageData * );
72
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;
77
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;
82
83     /** This call delegate the update to the importer */
84     void Update();
85
86 protected:
87     VTKImageToImageFilter();
88     virtual ~VTKImageToImageFilter();
89
90 private:
91     VTKImageToImageFilter(const Self&); //purposely not implemented
92     void operator=(const Self&); //purposely not implemented
93
94     ImporterFilterPointer       m_Importer;
95     vtkImageExport            * m_Exporter;
96
97 };
98
99 } // end namespace itk
100
101 #ifndef ITK_MANUAL_INSTANTIATION
102 #include "itkVTKImageToImageFilter.txx"
103 #endif
104
105 #endif
106
107
108