Frame Callback

 

Some callbacks are specific to the SliceO_Frame class.

 

Callbacks to modify the displayed image:

 

Fct_Update_GLI_Disp[ ]

 

These functions are used to update the display buffer.  The display buffer is a copy of the frame as it is displayed on the screen.

An example of this is, in mode Region Growing, we want to have a preview of the segmentation.  This preview modify the display buffer directly using the Fct_Update_TAG_Disp() callback..

 

Fct_Update_TAG_Disp[ ]

 

 

Callbacks to get associated pixel values:

 

Fct_Pixel_Get_Filter

 

Some operation need a filtered pixel value instead of the direct GLI value,  Also, some operation need to know the gradient of the GLI values at a pixel location. 

 

SliceOmatic provide default functions for these, but if you want you can change these default functions.

 

Fct_Pixel_Get_Gradient_Amp

 

 

Fct_Pixel_Get_Gradient_Dir

 

 

 

From: sliceO_class_2D.hpp

 

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

//

//          SliceO_Frame

//

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

class          SLICEO_DB SliceO_Frame:public SliceO_Class  {

 

          ...

 

          // ====================================================================

          // --- we also have callbacks for updating the display buffers ---

          // --- default value is at "0", but first we try all the other ones. if

          // --- a callback is present and it return=2, we do not call default.

          int          (*Fct_Update_GLI_Disp[CALLBACK_NB_DISPLAY])( SliceO_Class *pt ) ;

          int          (*Fct_Update_TAG_Disp[CALLBACK_NB_DISPLAY])( SliceO_Class *pt ) ;

          // ====================================================================

 

          // ====================================================================

          // --- Callback for mean and gradient values ---

          int          (*Fct_Pixel_Get_Filter)(       SliceO_Frame *pt, void *ima, Vect pos ) ;

          int          (*Fct_Pixel_Get_Gradient_Amp)( SliceO_Frame *pt, void *ima, Vect pos ) ;

          Vect          (*Fct_Pixel_Get_Gradient_Dir)( SliceO_Frame *pt, void *ima, Vect pos ) ;

          // ====================================================================

 

} ;

 

 

Warning:

 

Changing the default "Filter", "Gradient_Amp" or "Gradient_Dir"  functions will affect the Morpho and the Snake modes.