- this->AddItem( this->ImageOutlineActor );
- }
- else
- {
- // Check if the image share the same space
- vtkImageData* new_image = dynamic_cast< vtkImageData* >(
- aout->GetProducer( )->GetOutputDataObject( aout->GetIndex( ) )
- );
- if( new_image != NULL )
- {
- vtkAlgorithmOutput* ref_aout =
- this->Slices[ 0 ][ 0 ]->GetImageMap( 0 )->GetOutputPort( );
- vtkImageData* ref_image = dynamic_cast< vtkImageData* >(
- ref_aout->GetProducer( )->GetOutputDataObject( ref_aout->GetIndex( ) )
- );
- if( ref_image != NULL )
- {
- int ref_ext[ 6 ], new_ext[ 6 ];
- ref_image->GetExtent( ref_ext );
- new_image->GetExtent( new_ext );
- if(
- ref_ext[ 0 ] == new_ext[ 0 ] && ref_ext[ 1 ] == new_ext[ 1 ] &&
- ref_ext[ 2 ] == new_ext[ 2 ] && ref_ext[ 3 ] == new_ext[ 3 ] &&
- ref_ext[ 4 ] == new_ext[ 4 ] && ref_ext[ 5 ] == new_ext[ 5 ]
- )
- {
- this->Slices[ 0 ][ 0 ]->AddInputConnection( aout, 0 );
- vtkImageMapToColors* imap = this->Slices[ 0 ][ 0 ]->GetImageMap( N );
- for( unsigned int i = 0; i < 2; ++i )
- for( unsigned int j = 0; j < 3; ++j )
- if( i != 0 || j != 0 )
- this->Slices[ i ][ j ]->AddInputConnection(
- ( ( imap != NULL )? imap->GetOutputPort( ): aout ), j
- );
- }
- else
- N = -1;
- }
- else
- N = -1;
- }
- else
- N = -1;
-
- } // fi
- return( N );