Tool_Histo::Set

 

Associate a "propagate" function to the tool. 

 

 

Syntax

 

int  Set(

          unsigned short nb,

          ...

) ;

 

 

Parameters

 

nb, ...

                    This method use a variable number of arguments.  It must have nb*3 + 1 arguments, where nb is the number of histogram "ranges" we want to display.  The maximum value for nb is 32. Each "range" need 3 arguments:

 

tag

                    This argument is an unsigned short. It give the TAG value associated with the "range"

 

start

                    This argument is a 64 bit floating point (double) value.  It give the starting GLI value of the range.

 

stop

          This argument is a 64 bit floating point (double) value.  It give the stoping GLI value of the range.

 

 

Return value

 

The method returns 0 if an error occurs, 1 otherwise.

 

 

Remarks

 

This method is usually called in Ctrl_Update().

 

 

Requirements

 

Header:

          TomoVision_Util.hpp

          TomoVision_Tools.hpp

          Tool_work.hpp

 

Library:

          TomoVision_Util.lib

          TomoVision_Tools.lib

          SliceO_Tools.lib

 

 

Example

 

In tthreshold_ctrl.cpp.

 

 

// --- in threshold_var.cpp ---

extern float          *Segment_GLI ; // The GLI value associated with each threshold

extern unsigned short          *Segment_TAG ; // The TAG number associated with each threshold

 

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

int          Ctrl_Update( UInt64 flag )

{

          ...

 

          // --- One of the threshold values has been changed ---

          if ( flag & UPDATE_THRESHOLD ) {

 

              // --- Get the min/max range of the GLI values ---

              float *Select_GLI_Max = (float *) Fct_Variable_Get( "$SELECT_GLI_MAX" ) ;

              if ( ! Select_GLI_Max )

                    return( 0 ) ;

 

              // --- keep the 4 bands on the histogram up-to-date ---

              tool_histo.Set( 4,

                    Segment_TAG[0], Segment_GLI[0], Segment_GLI[1],

                    Segment_TAG[1], Segment_GLI[1], Segment_GLI[2],

                    Segment_TAG[2], Segment_GLI[2], Segment_GLI[3],

                    Segment_TAG[3], Segment_GLI[3], *Select_GLI_Max ) ;

 

              tool_histo.Update( flag ) ;

          }

 

          ...

 

          return( 1 ) ;

}

 

See also