SliceO_Frame::Frm_2_Org

 

This method enable you to convert coordinates in "Frm" space to coordinates in 3D "Org" space.

 

 

Syntax

 

Point_3D  Frm_2_Org(

          Point_2D pos_frm

) ;

 

Point_3D  Frm_2_Org(

          float x,

          float y,

          float z=0

) ;

 

Region_3D  Frm_2_Org(

          Region_2D reg_frm

) ;

 

 

Parameters

 

pos_frm

          2D point to convert from "Frm" space to "Org" space.

 

x, y, z

Coordinates in "Frm" space to convert in "Org" space.  By default, z=0 and the point defined by x,y is in the plane of the frame.

 

reg_frm

2D region to convert from "Frm" space to "Org" space. The thickness of the created region  is the thickness of the frame.

 

 

Return value

 

This method return either a transformed 3D point or a 3D region depending on its arguments.

 

 

Remarks

 

The transformation is computed by transforming the 2D coordinates with the m_mat_2D_3D matrix.

 

Requirements

 

Header:

          sliceO_include.hpp

 

Library:

          sliceO_Structures.lib

 

 

Example

Computing 3D cursor coordinates for "Pixel Info" tool.

// ----------------------------------------------------------------------------

//

//          Tool_Pixel_Update_Coord

//

//          Param:          (void)

//

//          Return:          (void)

//

// ----------------------------------------------------------------------------

void          Tool_Pixel_Update_Coord( char *str, SliceO_Frame *frame, Point_2D *pos )

{

 

          if ( ! frame ) {

              sprintf( str, "Coord. x: ---.--  y: ---.--  z: ---.--" ) ;

          } else {

              Point_3D pos_3D = frame->Frm_2_Org( pos->x, pos->y ) ;

 

              char x[20], y[20], z[20], units[20] ;

              strcpy( x, Fct_Float_2_Dist( pos_3D.x ) ) ;

              strcpy( y, Fct_Float_2_Dist( pos_3D.y ) ) ;

              strcpy( z, Fct_Float_2_Dist( pos_3D.z, units ) ) ;

 

              sprintf( str, "Coord. (%s) x:%s y:%s z:%s", units, x, y, z ) ;

          }

 

}

 

See also

 

The Coordinate Systems