WPOCT Software Developer's Kit (SDK)
SDK For using Wasatch Photonics OCT Spectrometers
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Background Class Reference
Collaboration diagram for Background:
Collaboration graph
[legend]

Public Member Functions

 Background (ScanProcessor *scanProcessor)
 
bool GetUseBackgroundSubtract () const
 
bool GetUseAverageBG () const
 
bool GetUseAutoDC () const
 
bool GetAutoSaveBG () const
 
void SetUseBackgroundSubtract (bool value)
 
void SetUseAverageBG (bool value)
 
void SetUseAutoDC (bool value)
 
void SetAutoSaveBG (bool value)
 
bool GetBackgroundImage (float *buffer, int size)
 Gets the one A-scan wide background image and places it in the buffer.
 
bool UpdateImage (float *buffer=nullptr, int size=0)
 Update the background image. More...
 
void AdjustForBackground (const U16 *raw, SGL *&inputData)
 
template<typename T , typename F >
void BackgroundAverageAutoDCMethod (const T *raw, F *&inputData)
 Pre-processing methods to move raw data to input data. More...
 
template<typename T , typename F >
void BackgroundAverageMethod (const T *raw, F *&inputData)
 For the averaged background, create a single a-scan by averaging the background image. More...
 
template<typename T , typename F >
void BackgroundImageMethod (const T *raw, F *&inputData)
 Use the entire background image frame and do a line by line subtraction with raw to get inputData. More...
 
template<typename T , typename F >
void NoImageMethod (const T *raw, F *&inputData)
 Just copy raw to indata. More...
 
virtual void InitGPUMethods (int programIndex)
 
virtual void OnWidthHeightChanged (int width, int height)
 
virtual int Subtract (const unsigned short *raw)
 

Protected Member Functions

void ComputeAveragedBackground ()
 this takes into account the apodization regardless - 4/24/2015 for apodization only need maxbg
 
void SetBackgroundImagePtr (const U16 *sourceptr)
 
virtual void InitStorage ()
 
virtual void ReleaseStorage ()
 
virtual void UpdateBackgroundArray (float *Background, float maxgb)
 

Protected Attributes

bool _initialized
 
bool _updateImage
 
bool _useAveragedImage
 
ScanProcessor_scanProcessor
 

Static Protected Attributes

static std::vector< SGL > _bgImage
 
static std::vector< SGL > _avgBgImage
 
static std::vector< SGL > _avgBgLine
 
static int _numObjects = 0
 Reference counter to keep track of number of background objects.
 
static float _maxIntensity = 0
 
static float _averageSum = 0
 
static float _maxBG = 0
 
static bool _useBackgroundSubtract = false
 
static bool _useAverageBG = true
 
static bool _useAutoDC = false
 
static bool _autoSaveBG = true
 
static std::mutex _mutexSubtract
 

Member Function Documentation

◆ BackgroundAverageAutoDCMethod()

template<typename T , typename F >
void Background::BackgroundAverageAutoDCMethod ( const T *  raw,
F *&  inputData 
)
inline

Pre-processing methods to move raw data to input data.

Goal is to eliminate any DC component that remains after the background subtraction.

  1. subtract averaged background buffer from rawBuffer, save to inData
  2. subtract background buffer from rawBuffer, save to inData
  3. copy rawBuffer to inData
Parameters
rawraw data
[out]inputDatabackground subtracted raw data for use in processing
Returns
none

◆ BackgroundAverageMethod()

template<typename T , typename F >
void Background::BackgroundAverageMethod ( const T *  raw,
F *&  inputData 
)
inline

For the averaged background, create a single a-scan by averaging the background image.

Apply this averaged background line for each line in frame.
If using apodization,

  • use raw to create the background : rawBg
  • use: indata = _maxIntensity * (raw - rawBg) / rawBg
  • otherwise, use: indata = raw-bg
Parameters
rawraw data
[out]inputDatabackground subtracted raw data for use in processing
Returns
none

◆ BackgroundImageMethod()

template<typename T , typename F >
void Background::BackgroundImageMethod ( const T *  raw,
F *&  inputData 
)
inline

Use the entire background image frame and do a line by line subtraction with raw to get inputData.

Parameters
rawraw data
[out]inputDatabackground subtracted raw data afor use in processing
Returns
none

◆ NoImageMethod()

template<typename T , typename F >
void Background::NoImageMethod ( const T *  raw,
F *&  inputData 
)
inline

Just copy raw to indata.

Parameters
rawraw data
[out]inputDatais raw data
Returns
none

◆ UpdateImage()

bool Background::UpdateImage ( float *  buffer = nullptr,
int  size = 0 
)

Update the background image.

If buffer is NULL, then use the averaged background.
Otherwise, use the array supplied.


The documentation for this class was generated from the following files: