]> Creatis software - clitk.git/blob - itk/itkImageToVTKImageFilter.h
changes in license header
[clitk.git] / itk / itkImageToVTKImageFilter.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://www.centreleonberard.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 __itkImageToVTKImageFilter_h\r
19 #define __itkImageToVTKImageFilter_h\r
20 #include "itkVTKImageExport.h"\r
21 #include "vtkImageImport.h"\r
22 #include "vtkImageData.h"\r
23 \r
24 namespace itk\r
25 {\r
26 \r
27 /** \class ImageToVTKImageFilter\r
28  * \brief Converts an ITK image into a VTK image and plugs a\r
29  *  itk data pipeline to a VTK datapipeline.\r
30  *\r
31  *  This class puts together an itkVTKImageExporter and a vtkImageImporter.\r
32  *  It takes care of the details related to the connection of ITK and VTK\r
33  *  pipelines. The User will perceive this filter as an adaptor to which\r
34  *  an itk::Image can be plugged as input and a vtkImage is produced as\r
35  *  output.\r
36  *\r
37  * \ingroup   ImageFilters\r
38  */\r
39 template <class TInputImage >\r
40 class ITK_EXPORT ImageToVTKImageFilter : public ProcessObject\r
41 {\r
42 public:\r
43     /** Standard class typedefs. */\r
44     typedef ImageToVTKImageFilter       Self;\r
45     typedef ProcessObject             Superclass;\r
46     typedef SmartPointer<Self>        Pointer;\r
47     typedef SmartPointer<const Self>  ConstPointer;\r
48 \r
49     /** Method for creation through the object factory. */\r
50     itkNewMacro(Self);\r
51 \r
52     /** Run-time type information (and related methods). */\r
53     itkTypeMacro(ImageToVTKImageFilter, ProcessObject);\r
54 \r
55     /** Some typedefs. */\r
56     typedef TInputImage InputImageType;\r
57     typedef typename    InputImageType::ConstPointer    InputImagePointer;\r
58     typedef VTKImageExport< InputImageType>            ExporterFilterType;\r
59     typedef typename ExporterFilterType::Pointer        ExporterFilterPointer;\r
60 \r
61     /** Get the output in the form of a vtkImage.\r
62         This call is delegated to the internal vtkImageImporter filter  */\r
63     vtkImageData *  GetOutput() const;\r
64 \r
65     /** Set the input in the form of an itk::Image */\r
66     void SetInput( const InputImageType * );\r
67 \r
68     /** Return the internal VTK image importer filter.\r
69         This is intended to facilitate users the access\r
70         to methods in the importer */\r
71     vtkImageImport * GetImporter() const;\r
72 \r
73     /** Return the internal ITK image exporter filter.\r
74         This is intended to facilitate users the access\r
75         to methods in the exporter */\r
76     ExporterFilterType * GetExporter() const;\r
77 \r
78     /** This call delegate the update to the importer */\r
79     void Update();\r
80 \r
81 protected:\r
82     ImageToVTKImageFilter();\r
83     virtual ~ImageToVTKImageFilter();\r
84 \r
85 private:\r
86     ImageToVTKImageFilter(const Self&); //purposely not implemented\r
87     void operator=(const Self&); //purposely not implemented\r
88 \r
89     ExporterFilterPointer       m_Exporter;\r
90     vtkImageImport            * m_Importer;\r
91 \r
92 };\r
93 \r
94 } // end namespace itk\r
95 \r
96 #ifndef ITK_MANUAL_INSTANTIATION\r
97 #include "itkImageToVTKImageFilter.txx"\r
98 #endif\r
99 \r
100 #endif\r
101 \r
102 \r
103 \r