#include <cpPlugins/Extensions/Visualization/MPRActors.h>
#include <vtkImageData.h>
+#include <vtkLookupTable.h>
#include <vtkOutlineSource.h>
#include <vtkPolyDataMapper.h>
#include <vtkProperty.h>
for( int i = 0; i < 3; ++i )
{
- Slices[ i ]->SetInputConnection(
+ this->Slices[ i ]->SetInputConnection(
this->ImageToWindowLevel->GetOutputPort( ), i
);
- Slices[ i ]->UpdateText( this->GetWindow( ), this->GetLevel( ) );
+ this->Slices[ i ]->UpdateText( this->GetWindow( ), this->GetLevel( ) );
} // rof
void cpPlugins::Extensions::Visualization::MPRActors::
SetSegmentationData( vtkImageData* segmentation )
{
+ double range[ 2 ];
+ this->Segmentation = segmentation;
+ this->Segmentation->GetScalarRange( range );
+
+ vtkSmartPointer< vtkLookupTable > lut =
+ vtkSmartPointer< vtkLookupTable >::New( );
+ lut->SetNumberOfTableValues( 2 );
+ lut->SetTableRange( range );
+ lut->SetTableValue( 0, 0, 0, 0, 0 );
+ lut->SetTableValue( 1, 1, 0, 0, 0.4 );
+
+ this->SegmentationToColors->SetInputData( this->Segmentation );
+ this->SegmentationToColors->SetLookupTable( lut );
+ this->SegmentationToColors->Update( );
+
+ for( int i = 0; i < 3; ++i )
+ this->Slices[ i ]->SetSegmentationConnection(
+ this->SegmentationToColors->GetOutputPort( )
+ );
}
// -------------------------------------------------------------------------