]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface/Image.h
...
[cpPlugins.git] / lib / cpPlugins / Interface / Image.h
1 #ifndef __CPPLUGINS__INTERFACE__IMAGE__H__
2 #define __CPPLUGINS__INTERFACE__IMAGE__H__
3
4 #include <map>
5 #include <string>
6 #include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
7 #include <cpPlugins/Interface/DataObject.h>
8
9 #define ITK_MANUAL_INSTANTIATION
10 #include <itkProcessObject.h>
11
12 class vtkImageData;
13
14 // -------------------------------------------------------------------------
15 #define cpPlugins_Image_Demangle( p, d, o, f, r )               \
16   if( dynamic_cast< itk::Image< p, d >* >( o ) != NULL )        \
17     r = this->f< itk::Image< p, d > >( o )
18
19 // -------------------------------------------------------------------------
20 #define cpPlugins_Image_Array_Demangle( a, p, da, di, o, f, r )    \
21   if( dynamic_cast< itk::Image< a< p, da >, di >* >( o ) != NULL ) \
22     r = this->f< itk::Image< a< p, da >, di > >( o )
23
24 // -------------------------------------------------------------------------
25 namespace cpPlugins
26 {
27   namespace Interface
28   {
29     /**
30      */
31     class cpPlugins_Interface_EXPORT Image
32       : public DataObject
33     {
34     public:
35       typedef Image                           Self;
36       typedef DataObject                      Superclass;
37       typedef itk::SmartPointer< Self >       Pointer;
38       typedef itk::SmartPointer< const Self > ConstPointer;
39
40     public:
41       itkNewMacro( Self );
42       itkTypeMacro( Image, DataObject );
43
44     public:
45       virtual void SetITKDataObject( itk::DataObject* o );
46       virtual void SetVTKDataObject( vtkDataObject* o );
47
48       virtual vtkImageData* GetVTKImageData( );
49       virtual const vtkImageData* GetVTKImageData( ) const;
50
51     protected:
52       Image( );
53       virtual ~Image( );
54
55       template< unsigned int D >
56         bool _Dim( itk::DataObject* o );
57
58       template< class I >
59         bool _Type( itk::DataObject* o );
60
61     private:
62       // Purposely not implemented
63       Image( const Self& );
64       Self& operator=( const Self& );
65
66     protected:
67       itk::ProcessObject::Pointer m_ITKvVTKConnection;
68     };
69
70   } // ecapseman
71
72 } // ecapseman
73
74 #endif // __CPPLUGINS__INTERFACE__IMAGE__H__
75
76 // eof - $RCSfile$