]> 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 <cpPlugins/Interface/cpPlugins_Interface_Export.h>
5 #include <cpPlugins/Interface/DataObject.h>
6
7 #define ITK_MANUAL_INSTANTIATION
8 #include <itkProcessObject.h>
9
10 class vtkImageData;
11
12 // -------------------------------------------------------------------------
13 /* TODO
14    #define cpPlugins_Image_Demangle( p, d, o, f, r )            \
15    if( dynamic_cast< itk::Image< p, d >* >( o ) != NULL )       \
16    r = this->f< itk::Image< p, d > >( o )
17
18    // -------------------------------------------------------------------------
19    #define cpPlugins_Image_Array_Demangle( a, p, da, di, o, f, r ) \
20    if( dynamic_cast< itk::Image< a< p, da >, di >* >( o ) != NULL )     \
21    r = this->f< itk::Image< a< p, da >, di > >( o )
22 */
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       /*
46         virtual void SetITKDataObject( itk::DataObject* o );
47         virtual void SetVTKDataObject( vtkDataObject* o );
48       */
49
50       template< class I >
51         inline void SetITKImage( itk::DataObject* object );
52
53       template< class I >
54         inline I* GetITKImage( );
55
56       template< class I >
57         inline const I* GetITKImage( ) const;
58
59       virtual void SetVTKImageData( vtkImageData* image );
60       virtual vtkImageData* GetVTKImageData( );
61       virtual const vtkImageData* GetVTKImageData( ) const;
62
63     protected:
64       Image( );
65       virtual ~Image( );
66
67       /* TODO
68          template< unsigned int D >
69          bool _Dim( itk::DataObject* o );
70
71          template< class I >
72          bool _Type( itk::DataObject* o );
73       */
74
75     private:
76       // Purposely not implemented
77       Image( const Self& );
78       Self& operator=( const Self& );
79
80     protected:
81       itk::ProcessObject::Pointer m_ITKvVTKConnection;
82     };
83
84   } // ecapseman
85
86 } // ecapseman
87
88 #include <cpPlugins/Interface/Image.hxx>
89
90 #endif // __CPPLUGINS__INTERFACE__IMAGE__H__
91
92 // eof - $RCSfile$