1 #include <cpPlugins/Image.h>
3 #include <vtkImageActor.h>
4 #include <vtkImageProperty.h>
5 #include <vtkImageSliceMapper.h>
7 // -------------------------------------------------------------------------
8 void cpPlugins::Image::
9 SetITK( itk::LightObject* o )
11 this->Superclass::SetITK( o );
12 bool s = this->_ITK_2_VTK_0_Scalar< 2 >( o );
13 if( !s ) s = this->_ITK_2_VTK_0_Scalar< 3 >( o );
14 if( !s ) s = this->_ITK_2_VTK_0_Color< 2 >( o );
15 if( !s ) s = this->_ITK_2_VTK_0_Color< 3 >( o );
18 this->m_VTKObject = NULL;
19 this->m_ITKvVTK = NULL;
25 // -------------------------------------------------------------------------
26 void cpPlugins::Image::
27 SetVTK( vtkObjectBase* o )
29 this->Superclass::SetVTK( o );
30 std::cerr << "Image: TODO this!!!!" << std::endl;
34 // -------------------------------------------------------------------------
41 // -------------------------------------------------------------------------
47 // -------------------------------------------------------------------------
48 void cpPlugins::Image::
49 _CreateVTKActor( ) const
52 const_cast< vtkImageData* >( this->GetVTK< vtkImageData >( ) );
55 vtkImageSliceMapper* mapper = vtkImageSliceMapper::New( );
56 vtkImageActor* actor = vtkImageActor::New( );
57 mapper->SetInputData( image );
58 actor->SetMapper( mapper );
59 actor->GetProperty( )->SetInterpolationTypeToNearest( );
60 this->m_Actor = actor;