#include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image.hxx>
// -------------------------------------------------------------------------
void cpPlugins::DataObjects::Image::
void cpPlugins::DataObjects::Image::
SetVTK( vtkObjectBase* o )
{
- this->Superclass::SetVTK( o );
- std::cerr << "Image: TODO this!!!!" << std::endl;
- std::exit( 1 );
+ vtkImageData* img = dynamic_cast< vtkImageData* >( img );
+ this->Superclass::SetVTK( img );
+ if( img == NULL )
+ {
+ this->m_ITK = NULL;
+ this->m_ITKvVTK = NULL;
+ this->Modified( );
+ return;
+
+ } // fi
+
+ // Connect both worlds
+ this->_VTK_2_ITK_0< unsigned char >( img );
+ /* TODO
+ switch( img->GetScalarType( ) )
+ {
+ case VTK_CHAR: this->_VTK_2_ITK_0< char >( img ); break;
+ case VTK_SHORT: this->_VTK_2_ITK_0< short >( img ); break;
+ case VTK_INT: this->_VTK_2_ITK_0< int >( img ); break;
+ case VTK_LONG: this->_VTK_2_ITK_0< long >( img ); break;
+ case VTK_UNSIGNED_CHAR: this->_VTK_2_ITK_0< unsigned char >( img ); break;
+ case VTK_UNSIGNED_SHORT: this->_VTK_2_ITK_0< unsigned short >( img ); break;
+ case VTK_UNSIGNED_INT: this->_VTK_2_ITK_0< unsigned int >( img ); break;
+ case VTK_UNSIGNED_LONG: this->_VTK_2_ITK_0< unsigned long >( img ); break;
+ case VTK_FLOAT: this->_VTK_2_ITK_0< float >( img ); break;
+ case VTK_DOUBLE: this->_VTK_2_ITK_0< double >( img ); break;
+ default:
+ {
+ this->m_ITK = NULL;
+ this->m_ITKvVTK = NULL;
+
+ }
+ } // hctiws
+ */
+ this->Modified( );
}
// -------------------------------------------------------------------------