#include <vtkAlgorithmOutput.h>
#include <vtkImageData.h>
+#include <vtkOutlineSource.h>
+#include <vtkProperty.h>
#include <vtkRenderer.h>
#include <vtkRendererCollection.h>
#include <vtkRenderWindow.h>
this->Slices[ i ][ j ]->AddInputConnection(
( ( imap != NULL )? imap->GetOutputPort( ): aout ), j
);
+
+ // Create bounding box
+ vtkImageData* new_image = dynamic_cast< vtkImageData* >(
+ aout->GetProducer( )->GetOutputDataObject( aout->GetIndex( ) )
+ );
+
+ // Create 3D outline
+ double bb[ 6 ];
+ new_image->GetBounds( bb );
+
+ vtkSmartPointer< vtkOutlineSource > img_ol =
+ vtkSmartPointer< vtkOutlineSource >::New( );
+ img_ol->SetBounds( bb );
+
+ vtkSmartPointer< vtkPolyDataMapper > img_ol_mapper =
+ vtkSmartPointer< vtkPolyDataMapper >::New( );
+ img_ol_mapper->SetInputConnection( img_ol->GetOutputPort( ) );
+ this->ImageOutlineActor->SetMapper( img_ol_mapper );
+ this->ImageOutlineActor->GetProperty( )->SetColor( 1, 1, 1 );
+ this->ImageOutlineActor->GetProperty( )->SetLineWidth( 1 );
+
+ this->AddItem( this->ImageOutlineActor );
}
else
{
this->Slices[ i ][ j ]->AddInputData( new_image, j );
} // fi
+
+ // Create 3D outline
+ double bb[ 6 ];
+ new_image->GetBounds( bb );
+
+ vtkSmartPointer< vtkOutlineSource > img_ol =
+ vtkSmartPointer< vtkOutlineSource >::New( );
+ img_ol->SetBounds( bb );
+
+ vtkSmartPointer< vtkPolyDataMapper > img_ol_mapper =
+ vtkSmartPointer< vtkPolyDataMapper >::New( );
+ img_ol_mapper->SetInputConnection( img_ol->GetOutputPort( ) );
+ this->ImageOutlineActor->SetMapper( img_ol_mapper );
+ this->ImageOutlineActor->GetProperty( )->SetColor( 1, 1, 1 );
+ this->ImageOutlineActor->GetProperty( )->SetLineWidth( 1 );
+
+ this->AddItem( this->ImageOutlineActor );
}
else
{