- } // fi
- return( N );
-}
-
-// -------------------------------------------------------------------------
-int cpExtensions::Visualization::MPRActors::
-AddInputData( vtkImageData* image, ImageSliceActors::LUTType lut )
-{
- int N = this->Slices[ 0 ][ 0 ]->GetNumberOfImageActors( );
- if( N == 0 )
- {
- this->Slices[ 0 ][ 0 ]->AddInputData( image, 0, lut );
- vtkImageMapToColors* imap = this->Slices[ 0 ][ 0 ]->GetImageMap( 0 );
- for( unsigned int i = 0; i < 2; ++i )
- for( unsigned int j = 0; j < 3; ++j )
- if( i != 0 || j != 0 )
- {
- if( imap != NULL )
- this->Slices[ i ][ j ]->AddInputConnection(
- imap->GetOutputPort( ), j,
- ImageSliceActors::LUTType_None
- );
- else
- this->Slices[ i ][ j ]->AddInputData(
- image, j,
- ImageSliceActors::LUTType_None
- );
- } // fi
- }
- else
- {
- } // fi
- return( N );
- /*
- int N = this->ImageMaps.size( );
- if( N == 0 )
- {
- this->ImageMaps.push_back(
- vtkSmartPointer< vtkImageMapToColors >::New( )
- );
- this->ImageMaps[ 0 ]->SetInputData( image );
- this->SetLookupTableToWindowLevel( 0 );
- this->_Update( 0 );
- this->ResetWindowLevel( 0 );
- return( 0 );
- }
- else
- {
- // Check if the image share the same space
- vtkImageData* ref_image = this->_Image( 0 );
- vtkImageData* new_image = image;
- 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->ImageMaps.push_back(
- vtkSmartPointer< vtkImageMapToColors >::New( )
- );
- this->ImageMaps[ N ]->SetInputData( image );
- this->SetLookupTableToColor(
- N, double( 1 ), double( 0 ), double( 0 )
- );
- this->_Update( N );
- return( N );
- }
- else
- return( -1 );