+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::ImageSliceStyle::
+_CorrectPosition( double pos[ 3 ], int ijk[ 3 ] )
+{
+ if( this->m_WLActor.GetPointer( ) == NULL )
+ return;
+ auto image = this->m_WLActor->GetImage( );
+ if( image == NULL )
+ return;
+
+ // Approximate image index
+ double pcoords[ 3 ];
+ image->ComputeStructuredCoordinates( pos, ijk, pcoords );
+
+ // Manually correct index
+ int ext[ 6 ];
+ image->GetExtent( ext );
+ for( int i = 0; i < 3; ++i )
+ {
+ if( ijk[ i ] < ext[ i << 1 ] )
+ ijk[ i ] = ext[ i << 1 ];
+ if( ext[ ( i << 1 ) + 1 ] < ijk[ i ] )
+ ijk[ i ] = ext[ ( i << 1 ) + 1 ];
+
+ } // rof
+
+ // Get real coordinates
+ int o = this->m_WLActor->GetOrientation( );
+ ijk[ o ] = this->m_WLActor->GetSliceNumber( );
+ image->GetPoint( image->ComputePointId( ijk ), pos );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Interaction::ImageSliceStyle::
+_ShowText( double pos[ 3 ] )
+{
+ if( this->m_WLActor.GetPointer( ) == NULL )
+ return;
+ auto image = this->m_WLActor->GetImage( );
+ if( image == NULL )
+ return;
+
+ int ijk[ 3 ];
+ this->_CorrectPosition( pos, ijk );
+ int o = this->m_WLActor->GetOrientation( );
+
+ std::stringstream buffer;
+ buffer << "Axis: " << char( 'X' + char( o ) ) << std::endl;
+ int nScl = image->GetNumberOfScalarComponents( );
+ buffer
+ << "Pixel: [" << ijk[ 0 ]
+ << "," << ijk[ 1 ]
+ << "," << ijk[ 2 ] << "] = < "
+ << image->GetScalarComponentAsFloat( ijk[ 0 ], ijk[ 1 ], ijk[ 2 ], 0 );
+ for( int n = 1; n < nScl; ++n )
+ buffer
+ << " : "
+ << image->GetScalarComponentAsFloat( ijk[ 0 ], ijk[ 1 ], ijk[ 2 ], n );
+ buffer << " >" << std::endl;
+ buffer
+ << "Point: ("
+ << pos[ 0 ] << ", " << pos[ 1 ] << ", " << pos[ 2 ]
+ << ")";
+ cpExtensions_SPRINTF( this->m_TextBuffer, 1024, buffer.str( ).c_str( ) );
+ this->m_Text->SetInput( this->m_TextBuffer );
+ this->m_Text->VisibilityOn( );
+ this->m_Text->Modified( );
+}
+