1 #include <cpPlugins/DataObjects/Image.h>
2 #include <cpPlugins/DataObjects/Image.hxx>
4 // -------------------------------------------------------------------------
5 void cpPlugins::DataObjects::Image::
6 SetITK( itk::LightObject* o )
8 this->Superclass::SetITK( o );
9 cpPlugins_Demangle_ImageVisualDims( o, _ITK_2_VTK_0 );
10 else cpPlugins_Demangle_ImageDiffusionTensors3D( o, _ITK_2_VTK_1 );
14 this->m_ITKvVTK = NULL;
20 // -------------------------------------------------------------------------
21 void cpPlugins::DataObjects::Image::
22 SetVTK( vtkObjectBase* o )
24 vtkImageData* img = dynamic_cast< vtkImageData* >( img );
25 this->Superclass::SetVTK( img );
29 this->m_ITKvVTK = NULL;
35 // Connect both worlds
36 this->_VTK_2_ITK_0< unsigned char >( img );
38 switch( img->GetScalarType( ) )
40 case VTK_CHAR: this->_VTK_2_ITK_0< char >( img ); break;
41 case VTK_SHORT: this->_VTK_2_ITK_0< short >( img ); break;
42 case VTK_INT: this->_VTK_2_ITK_0< int >( img ); break;
43 case VTK_LONG: this->_VTK_2_ITK_0< long >( img ); break;
44 case VTK_UNSIGNED_CHAR: this->_VTK_2_ITK_0< unsigned char >( img ); break;
45 case VTK_UNSIGNED_SHORT: this->_VTK_2_ITK_0< unsigned short >( img ); break;
46 case VTK_UNSIGNED_INT: this->_VTK_2_ITK_0< unsigned int >( img ); break;
47 case VTK_UNSIGNED_LONG: this->_VTK_2_ITK_0< unsigned long >( img ); break;
48 case VTK_FLOAT: this->_VTK_2_ITK_0< float >( img ); break;
49 case VTK_DOUBLE: this->_VTK_2_ITK_0< double >( img ); break;
53 this->m_ITKvVTK = NULL;
61 // -------------------------------------------------------------------------
62 cpPlugins::DataObjects::Image::
68 // -------------------------------------------------------------------------
69 cpPlugins::DataObjects::Image::