void cpExtensions::Visualization::LUTImageActor::
SetLUTColor( unsigned int id, double r, double g, double b, double a )
{
- if( id >= this->m_LUT->GetNumberOfTableValues( ) )
+ if( id >= ( unsigned int )( this->m_LUT->GetNumberOfTableValues( ) ) )
this->m_LUT->SetNumberOfTableValues( id + 1 );
this->m_LUT->SetTableValue( id, r, g, b, a );
this->m_LUT->Modified( );
this->SetLUTColor( this->GetImageId( image ), r, g, b, a );
}
+// TODO: !!!!!
+#include <vtkImageCast.h>
+
// -------------------------------------------------------------------------
unsigned int cpExtensions::Visualization::LUTImageActor::
AddImage( vtkImageData* image, double r, double g, double b, double a )
{
+ static vtkSmartPointer< vtkImageCast > cast;
+ cast = vtkSmartPointer< vtkImageCast >::New( );
+
if( image != NULL )
{
+ cast->SetOutputScalarTypeToUnsignedChar( );
+ cast->SetInputData( image );
+ cast->Update( );
+
this->m_Images.push_back( image );
this->SetLUTColor( this->m_Images.size( ), r, g, b, a );
- this->m_Blender->AddInputData( image );
+ this->m_Blender->AddInputData( cast->GetOutput( ) );
+ this->m_Blender->Update( );
if( this->m_Images.size( ) == 1 )
{
SetInputConnection( this->m_ImageMap->GetOutputPort( ) );
} // fi
- this->m_Blender->Modified( );
- this->m_ImageMap->Modified( );
this->Modified( );
this->GetProperty( )->SetInterpolationTypeToNearest( );