fw4spl
vtk.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWVTKIO_VTK_HPP__
8 #define __FWVTKIO_VTK_HPP__
9 
10 #include "fwVtkIO/config.hpp"
11 
12 #include <fwData/Image.hpp>
13 #include <fwData/TransformationMatrix3D.hpp>
14 
15 #include <vtkSmartPointer.h>
16 
17 // forward declaration
18 class vtkPolyData;
19 class vtkImageData;
20 class vtkImageImport;
21 class vtkMatrix4x4;
22 class vtkLookupTable;
23 
24 namespace fwVtkIO
25 {
26 
28 {
29 
30  typedef std::map< ::fwTools::Type, int> fwToolsToVtkMap;
31  typedef std::map< int, ::fwTools::Type> VtkTofwToolsMap;
32 
33  FWVTKIO_API static fwToolsToVtkMap::mapped_type translate( const fwToolsToVtkMap::key_type& key );
34  FWVTKIO_API static VtkTofwToolsMap::mapped_type translate( const VtkTofwToolsMap::key_type& key );
35 
36  static const fwToolsToVtkMap s_toVtk;
37  static const VtkTofwToolsMap s_fromVtk;
38 };
39 
47 FWVTKIO_API int getVtkScalarType(::fwData::Image::sptr image);
48 
59 FWVTKIO_API void toVTKImage( ::fwData::Image::csptr _data, vtkImageData* dst);
60 
69 FWVTKIO_API void fromVTKImage( vtkImageData* _source, ::fwData::Image::sptr _destination );
70 
77 FWVTKIO_API void configureVTKImageImport( ::vtkImageImport* _pImageImport, ::fwData::Image::csptr _pDataImage );
78 
85 FWVTKIO_API vtkSmartPointer<vtkMatrix4x4> toVTKMatrix( ::fwData::TransformationMatrix3D::csptr _transfoMatrix );
86 
96 FWVTKIO_API bool fromVTKMatrix( vtkMatrix4x4* _matrix, ::fwData::TransformationMatrix3D::sptr _transfoMatrix);
97 
98 }
99 
100 #endif // __FWVTKIO_VTK_HPP__