+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+ResetCursor( )
+{
+ vtkPoints* points = this->Cursor->GetPoints( );
+ points->SetPoint( 0, 0, 0, 0 );
+ points->SetPoint( 1, 0, 0, 0 );
+ points->SetPoint( 2, 0, 0, 0 );
+ points->SetPoint( 3, 0, 0, 0 );
+ points->SetPoint( 4, 0, 0, 0 );
+ points->SetPoint( 5, 0, 0, 0 );
+ points->SetPoint( 6, 0, 0, 0 );
+ points->SetPoint( 7, 0, 0, 0 );
+ this->Cursor->Modified( );
+ this->CursorMapper->Modified( );
+ this->CursorActor->Modified( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+SetCursor( double pos[ 3 ] )
+{
+ if( this->SliceMappers.size( ) == 0 )
+ return;
+
+ // Get ordered axes
+ int a0 = this->GetAxis( );
+ int a1 = ( a0 + 1 ) % 3;
+ int a2 = ( a0 + 2 ) % 3;
+ int ma0 = a0 << 1;
+ int ma1 = a1 << 1;
+ int ma2 = a2 << 1;
+
+ double bounds[ 6 ];
+ this->SliceMappers[ 0 ]->GetInput( )->GetBounds( bounds );
+
+ double
+ p0[ 3 ], p1[ 3 ], p2[ 3 ], p3[ 3 ],
+ p4[ 3 ], p5[ 3 ], p6[ 3 ], p7[ 3 ];
+
+ p0[ a2 ] = p1[ a2 ] = p4[ a2 ] = p5[ a2 ] = pos[ a2 ];
+ p2[ a1 ] = p3[ a1 ] = p6[ a1 ] = p7[ a1 ] = pos[ a1 ];
+ p0[ a0 ] = p1[ a0 ] = p2[ a0 ] = p3[ a0 ] = bounds[ ma0 ];
+ p4[ a0 ] = p5[ a0 ] = p6[ a0 ] = p7[ a0 ] = bounds[ ma0 + 1 ];
+ p0[ a1 ] = p4[ a1 ] = bounds[ ma1 ];
+ p1[ a1 ] = p5[ a1 ] = bounds[ ma1 + 1 ];
+ p2[ a2 ] = p6[ a2 ] = bounds[ ma2 ];
+ p3[ a2 ] = p7[ a2 ] = bounds[ ma2 + 1 ];
+
+ vtkPoints* points = this->Cursor->GetPoints( );
+ points->SetPoint( 0, p0 );
+ points->SetPoint( 1, p1 );
+ points->SetPoint( 2, p2 );
+ points->SetPoint( 3, p3 );
+ points->SetPoint( 4, p4 );
+ points->SetPoint( 5, p5 );
+ points->SetPoint( 6, p6 );
+ points->SetPoint( 7, p7 );
+ this->Cursor->Modified( );
+ this->CursorMapper->Modified( );
+ this->CursorActor->Modified( );
+}
+
+// -------------------------------------------------------------------------
+vtkImageMapToColors* cpExtensions::Visualization::ImageSliceActors::
+GetImageMap( unsigned int id )
+{
+ if( id < this->ImageMaps.size( ) )
+ return( this->ImageMaps[ id ].GetPointer( ) );
+ else
+ return( NULL );
+}
+
+// -------------------------------------------------------------------------
+const vtkImageMapToColors* cpExtensions::Visualization::ImageSliceActors::
+GetImageMap( unsigned int id ) const
+{
+ if( id < this->ImageMaps.size( ) )
+ return( this->ImageMaps[ id ].GetPointer( ) );
+ else
+ return( NULL );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::ImageSliceActors::
+GetWindow( unsigned int id ) const
+{
+ if( this->ImageMaps[ id ].GetPointer( ) != NULL )
+ {
+ vtkWindowLevelLookupTable* lut =
+ dynamic_cast< vtkWindowLevelLookupTable* >(
+ this->ImageMaps[ id ]->GetLookupTable( )
+ );
+ if( lut != NULL )
+ return( lut->GetWindow( ) );
+ else
+ return( double( 0 ) );
+ }
+ else
+ return( double( 0 ) );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::Visualization::ImageSliceActors::
+GetLevel( unsigned int id ) const
+{
+ if( this->ImageMaps[ id ].GetPointer( ) != NULL )
+ {
+ vtkWindowLevelLookupTable* lut =
+ dynamic_cast< vtkWindowLevelLookupTable* >(
+ this->ImageMaps[ id ]->GetLookupTable( )
+ );
+ if( lut != NULL )
+ return( lut->GetLevel( ) );
+ else
+ return( double( 0 ) );
+ }
+ else
+ return( double( 0 ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+SetWindow( unsigned int id, double w )
+{
+ if( this->ImageMaps[ id ].GetPointer( ) != NULL )
+ {
+ vtkWindowLevelLookupTable* lut =
+ dynamic_cast< vtkWindowLevelLookupTable* >(
+ this->ImageMaps[ id ]->GetLookupTable( )
+ );
+ if( lut != NULL )
+ {
+ lut->SetWindow( w );
+ lut->Build( );
+ this->ImageMaps[ id ]->Modified( );
+ this->Modified( );
+
+ } // fi
+
+ } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+SetLevel( unsigned int id, double l )
+{
+ if( this->ImageMaps[ id ].GetPointer( ) != NULL )
+ {
+ vtkWindowLevelLookupTable* lut =
+ dynamic_cast< vtkWindowLevelLookupTable* >(
+ this->ImageMaps[ id ]->GetLookupTable( )
+ );
+ if( lut != NULL )
+ {
+ lut->SetLevel( l );
+ lut->Build( );
+ this->ImageMaps[ id ]->Modified( );
+ this->Modified( );
+
+ } // fi
+
+ } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+SetWindowLevel( unsigned int id, double w, double l )
+{
+ if( this->ImageMaps[ id ].GetPointer( ) != NULL )
+ {
+ vtkWindowLevelLookupTable* lut =
+ dynamic_cast< vtkWindowLevelLookupTable* >(
+ this->ImageMaps[ id ]->GetLookupTable( )
+ );
+ if( lut != NULL )
+ {
+ lut->SetWindow( w );
+ lut->SetLevel( l );
+ lut->Build( );
+ this->ImageMaps[ id ]->Modified( );
+ this->UpdateText( w, l );
+ this->Modified( );
+
+ } // fi
+
+ } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+ResetWindowLevel( unsigned int id )
+{
+}
+