lsst.afw  14.0-38-g278b05818
Public Types | Public Member Functions | Static Public Member Functions | List of all members
lsst::afw::detection::Threshold Class Reference

A Threshold is used to pass a threshold value to detection algorithms. More...

#include <Threshold.h>

Public Types

enum  ThresholdType {
  VALUE, BITMASK, STDEV, VARIANCE,
  PIXEL_STDEV
}
 Types of threshold: More...
 

Public Member Functions

 Threshold (double const value, ThresholdType const type=VALUE, bool const polarity=true, double const includeMultiplier=1.0)
 Threshold constructor. More...
 
ThresholdType getType () const
 return type of threshold More...
 
double getValue (const double param=-1) const
 return value of threshold, to be interpreted via type More...
 
template<typename ImageT >
double getValue (ImageT const &image) const
 return value of threshold by interrogating the image, if required More...
 
bool getPolarity () const
 return Threshold's polarity More...
 
void setPolarity (bool const polarity)
 set Threshold's polarity More...
 
double getIncludeMultiplier () const
 return includeMultiplier More...
 
void setIncludeMultiplier (double const includeMultiplier)
 set includeMultiplier More...
 

Static Public Member Functions

static ThresholdType parseTypeString (std::string const &typeStr)
 
static std::string getTypeString (ThresholdType const &type)
 

Detailed Description

A Threshold is used to pass a threshold value to detection algorithms.

The threshold may be a simple value (type == VALUE), or in units of the image standard deviation. Alternatively you may specify that you'll provide the standard deviation (type == STDEV) or variance (type == VARIANCE)

Note that the constructor is not declared explicit, so you may pass a bare threshold, and it'll be interpreted as a VALUE.

Definition at line 43 of file Threshold.h.

Member Enumeration Documentation

◆ ThresholdType

Types of threshold:

Enumerator
VALUE 

Use pixel value.

BITMASK 

Use (pixels & (given mask))

STDEV 

Use number of sigma given s.d.

VARIANCE 

Use number of sigma given variance.

PIXEL_STDEV 

Use number of sigma given per-pixel s.d.

Definition at line 46 of file Threshold.h.

Constructor & Destructor Documentation

◆ Threshold()

lsst::afw::detection::Threshold::Threshold ( double const  value,
ThresholdType const  type = VALUE,
bool const  polarity = true,
double const  includeMultiplier = 1.0 
)
inline

Threshold constructor.

Parameters
valuedesired threshold value
typeinterpretation of type
polaritysearch pixel above threshold? (useful for -ve thresholds)
includeMultiplierthreshold multiplier for inclusion in FootprintSet

Definition at line 57 of file Threshold.h.

Member Function Documentation

◆ getIncludeMultiplier()

double lsst::afw::detection::Threshold::getIncludeMultiplier ( ) const
inline

return includeMultiplier

Definition at line 94 of file Threshold.h.

◆ getPolarity()

bool lsst::afw::detection::Threshold::getPolarity ( ) const
inline

return Threshold's polarity

Definition at line 86 of file Threshold.h.

◆ getType()

ThresholdType lsst::afw::detection::Threshold::getType ( ) const
inline

return type of threshold

Definition at line 65 of file Threshold.h.

◆ getTypeString()

std::string lsst::afw::detection::Threshold::getTypeString ( ThresholdType const &  type)
static

Definition at line 54 of file Threshold.cc.

◆ getValue() [1/2]

double lsst::afw::detection::Threshold::getValue ( const double  param = -1) const

return value of threshold, to be interpreted via type

Parameters
paramvalue of variance/stdev if needed
Returns
value of threshold

Definition at line 67 of file Threshold.cc.

◆ getValue() [2/2]

template<typename ImageT >
double lsst::afw::detection::Threshold::getValue ( ImageT const &  image) const

return value of threshold by interrogating the image, if required

Parameters
imageImage to interrogate, if threshold type demands
Returns
value of threshold

Definition at line 92 of file Threshold.cc.

◆ parseTypeString()

Threshold::ThresholdType lsst::afw::detection::Threshold::parseTypeString ( std::string const &  typeStr)
static

Definition at line 37 of file Threshold.cc.

◆ setIncludeMultiplier()

void lsst::afw::detection::Threshold::setIncludeMultiplier ( double const  includeMultiplier)
inline

set includeMultiplier

Parameters
includeMultiplierdesired multiplier

Definition at line 96 of file Threshold.h.

◆ setPolarity()

void lsst::afw::detection::Threshold::setPolarity ( bool const  polarity)
inline

set Threshold's polarity

Parameters
polaritydesired polarity

Definition at line 88 of file Threshold.h.


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