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< 2 >( o );
13 if( !s ) s = this->_ITK_2_VTK_0< 3 >( o );
16 this->m_VTKObject = NULL;
17 this->m_ITKvVTK = NULL;
23 // -------------------------------------------------------------------------
24 void cpPlugins::Image::
25 SetVTK( vtkObjectBase* o )
27 this->Superclass::SetVTK( o );
28 std::cerr << "Image: TODO this!!!!" << std::endl;
32 // -------------------------------------------------------------------------
39 // -------------------------------------------------------------------------
45 // -------------------------------------------------------------------------
46 void cpPlugins::Image::
47 _CreateVTKActor( ) const
50 const_cast< vtkImageData* >( this->GetVTK< vtkImageData >( ) );
53 vtkImageSliceMapper* mapper = vtkImageSliceMapper::New( );
54 vtkImageActor* actor = vtkImageActor::New( );
55 mapper->SetInputData( image );
56 actor->SetMapper( mapper );
57 actor->GetProperty( )->SetInterpolationTypeToNearest( );
58 this->m_Actor = actor;