LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
lsst::afw::detection::Peak Class Reference

A peak in an image. More...

#include <Peak.h>

Inheritance diagram for lsst::afw::detection::Peak:
lsst::daf::base::Citizen

Public Types

typedef boost::shared_ptr< PeakPtr
 
- Public Types inherited from lsst::daf::base::Citizen
enum  { magicSentinel = 0xdeadbeef }
 
typedef unsigned long memId
 Type of the block's ID. More...
 
typedef memId(* memNewCallback )(const memId cid)
 A function used to register a callback. More...
 
typedef memId(* memCallback )(const Citizen *ptr)
 

Public Member Functions

 Peak (int ix, int iy, float peakValue=std::numeric_limits< float >::quiet_NaN())
 A peak at the pixel (ix, iy) More...
 
 Peak (float fx=std::numeric_limits< float >::quiet_NaN(), float fy=std::numeric_limits< float >::quiet_NaN(), float peakValue=std::numeric_limits< float >::quiet_NaN())
 A peak at the floating-point position (fx, fy) More...
 
 Peak (Peak const &other)
 
Peakoperator= (Peak const &other)
 
 ~Peak ()
 
bool operator== (Peak const &rhs) const
 
bool operator!= (Peak const &rhs) const
 
int getId () const
 Return the Peak's unique ID. More...
 
int getIx () const
 Return the column pixel position. More...
 
int getIy () const
 
lsst::afw::geom::Point2I getI () const
 Return the coordinates of the highest pixel. More...
 
lsst::afw::geom::Point2I getCentroid (bool) const
 Return the coordinates of the highest pixel. More...
 
float getFx () const
 Return the column centroid. More...
 
float getFy () const
 
lsst::afw::geom::Point2D getF () const
 Return the peak's centroid. More...
 
lsst::afw::geom::Point2D getCentroid () const
 Return the peak's centroid. More...
 
void setFx (float fx)
 Set the column centroid. More...
 
void setFy (float fy)
 Set the row centroid. More...
 
void setPeakValue (float peakValue)
 Set the value of the image at the peak. More...
 
float getPeakValue () const
 Return the value of the image at the peak. More...
 
std::string toString ()
 
- Public Member Functions inherited from lsst::daf::base::Citizen
 Citizen (const std::type_info &)
 
 Citizen (Citizen const &)
 
 ~Citizen ()
 
Citizenoperator= (Citizen const &)
 
std::string repr () const
 Return a string representation of a Citizen. More...
 
void markPersistent (void)
 Mark a Citizen as persistent and not destroyed until process end. More...
 
memId getId () const
 Return the Citizen's ID. More...
 

Private Member Functions

template<typename Archive >
void serialize (Archive &ar, unsigned int const version)
 

Private Attributes

int _id
 unique ID for this peak More...
 
int _ix
 column-position of peak pixel More...
 
int _iy
 row-position of peak pixel More...
 
float _fx
 column-position of peak More...
 
float _fy
 row-position of peak More...
 
float _peakValue
 value of image at peak position More...
 

Static Private Attributes

static int id = 0
 Counter for Peak IDs. More...
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Static Public Member Functions inherited from lsst::daf::base::Citizen
static bool hasBeenCorrupted ()
 Check all allocated blocks for corruption. More...
 
static memId getNextMemId ()
 Return the memId of the next object to be allocated. More...
 
static int init ()
 Called once when the memory system is being initialised. More...
 
static int census (int, memId startingMemId=0)
 How many active Citizens are there? More...
 
static void census (std::ostream &stream, memId startingMemId=0)
 Print a list of all active Citizens to stream, sorted by ID. More...
 
static const std::vector
< const Citizen * > * 
census ()
 Return a (newly allocated) std::vector of active Citizens sorted by ID. More...
 
static memId setNewCallbackId (memId id)
 Call the NewCallback when block is allocated. More...
 
static memId setDeleteCallbackId (memId id)
 Call the current DeleteCallback when block is deleted. More...
 
static memNewCallback setNewCallback (memNewCallback func)
 Set the NewCallback function. More...
 
static memCallback setDeleteCallback (memCallback func)
 Set the DeleteCallback function. More...
 
static memCallback setCorruptionCallback (memCallback func)
 Set the CorruptionCallback function. More...
 

Detailed Description

A peak in an image.

Definition at line 51 of file Peak.h.

Member Typedef Documentation

typedef boost::shared_ptr<Peak> lsst::afw::detection::Peak::Ptr

Definition at line 53 of file Peak.h.

Constructor & Destructor Documentation

lsst::afw::detection::Peak::Peak ( int  ix,
int  iy,
float  peakValue = std::numeric_limits<float>::quiet_NaN() 
)
inlineexplicit

A peak at the pixel (ix, iy)

Parameters
ixcolumn pixel
iyrow pixel
peakValuevalue of image at peak

Definition at line 55 of file Peak.h.

58  : lsst::daf::base::Citizen(typeid(this)),
59  _id(++id),
60  _ix(ix), _iy(iy), _fx(ix), _fy(iy), _peakValue(peakValue) {};
float _peakValue
value of image at peak position
Definition: Peak.h:133
int _ix
column-position of peak pixel
Definition: Peak.h:129
int _id
unique ID for this peak
Definition: Peak.h:128
int _iy
row-position of peak pixel
Definition: Peak.h:130
float _fy
row-position of peak
Definition: Peak.h:132
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
float _fx
column-position of peak
Definition: Peak.h:131
lsst::afw::detection::Peak::Peak ( float  fx = std::numeric_limits<float>::quiet_NaN(),
float  fy = std::numeric_limits<float>::quiet_NaN(),
float  peakValue = std::numeric_limits<float>::quiet_NaN() 
)
inlineexplicit

A peak at the floating-point position (fx, fy)

Parameters
fxcolumn centre
fyrow centre
peakValuevalue of image at peak

Definition at line 62 of file Peak.h.

65  : lsst::daf::base::Citizen(typeid(this)),
66  _id(++id),
67  _ix(fx > 0 ? static_cast<int>(fx) : -static_cast<int>(-fx) - 1),
68  _iy(fy > 0 ? static_cast<int>(fy) : -static_cast<int>(-fy) - 1),
69  _fx(fx), _fy(fy), _peakValue(peakValue) {};
float _peakValue
value of image at peak position
Definition: Peak.h:133
int _ix
column-position of peak pixel
Definition: Peak.h:129
int _id
unique ID for this peak
Definition: Peak.h:128
int _iy
row-position of peak pixel
Definition: Peak.h:130
float _fy
row-position of peak
Definition: Peak.h:132
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
float _fx
column-position of peak
Definition: Peak.h:131
lsst::afw::detection::Peak::Peak ( Peak const &  other)
inline

Definition at line 70 of file Peak.h.

71  : lsst::daf::base::Citizen(typeid(this)),
72  _id(++id),
73  _ix(other._ix), _iy(other._iy),
74  _fx(other._fx), _fy(other._fy), _peakValue(other._peakValue)
75  { }
float _peakValue
value of image at peak position
Definition: Peak.h:133
int _ix
column-position of peak pixel
Definition: Peak.h:129
int _id
unique ID for this peak
Definition: Peak.h:128
int _iy
row-position of peak pixel
Definition: Peak.h:130
float _fy
row-position of peak
Definition: Peak.h:132
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
float _fx
column-position of peak
Definition: Peak.h:131
lsst::afw::detection::Peak::~Peak ( )
inline

Definition at line 87 of file Peak.h.

87 {};

Member Function Documentation

lsst::afw::geom::Point2I lsst::afw::detection::Peak::getCentroid ( bool  ) const
inline

Return the coordinates of the highest pixel.

Definition at line 103 of file Peak.h.

103 { return lsst::afw::geom::Point2I(_ix, _iy); }
Point< int, 2 > Point2I
Definition: Point.h:274
int _ix
column-position of peak pixel
Definition: Peak.h:129
int _iy
row-position of peak pixel
Definition: Peak.h:130
lsst::afw::geom::Point2D lsst::afw::detection::Peak::getCentroid ( ) const
inline

Return the peak's centroid.

Definition at line 109 of file Peak.h.

109 { return lsst::afw::geom::Point2D(_fx, _fy); }
Point< double, 2 > Point2D
Definition: Point.h:277
float _fy
row-position of peak
Definition: Peak.h:132
float _fx
column-position of peak
Definition: Peak.h:131
lsst::afw::geom::Point2D lsst::afw::detection::Peak::getF ( ) const
inline

Return the peak's centroid.

Definition at line 107 of file Peak.h.

107 { return getCentroid(); }
lsst::afw::geom::Point2D getCentroid() const
Return the peak&#39;s centroid.
Definition: Peak.h:109
float lsst::afw::detection::Peak::getFx ( ) const
inline

Return the column centroid.

Definition at line 104 of file Peak.h.

float lsst::afw::detection::Peak::getFy ( ) const
inline

Return the row centroid

Definition at line 105 of file Peak.h.

lsst::afw::geom::Point2I lsst::afw::detection::Peak::getI ( ) const
inline

Return the coordinates of the highest pixel.

Definition at line 101 of file Peak.h.

101 { return getCentroid(true); }
lsst::afw::geom::Point2D getCentroid() const
Return the peak&#39;s centroid.
Definition: Peak.h:109
int lsst::afw::detection::Peak::getId ( ) const
inline

Return the Peak's unique ID.

Definition at line 96 of file Peak.h.

int lsst::afw::detection::Peak::getIx ( ) const
inline

Return the column pixel position.

Definition at line 98 of file Peak.h.

int lsst::afw::detection::Peak::getIy ( ) const
inline

Return the row pixel position

Definition at line 99 of file Peak.h.

float lsst::afw::detection::Peak::getPeakValue ( ) const
inline

Return the value of the image at the peak.

Definition at line 114 of file Peak.h.

bool lsst::afw::detection::Peak::operator!= ( Peak const &  rhs) const
inline

Definition at line 92 of file Peak.h.

92  {
93  return !(*this == rhs);
94  }
Peak& lsst::afw::detection::Peak::operator= ( Peak const &  other)
inline

Definition at line 76 of file Peak.h.

77  {
78  if (this != &other) {
79  _id = ++id;
80  _ix = other._ix; _iy = other._iy;
81  _fx = other._fx; _fy = other._fy;
82  _peakValue = other._peakValue;
83  }
84  return *this;
85  }
float _peakValue
value of image at peak position
Definition: Peak.h:133
int _ix
column-position of peak pixel
Definition: Peak.h:129
int _id
unique ID for this peak
Definition: Peak.h:128
int _iy
row-position of peak pixel
Definition: Peak.h:130
static int id
Counter for Peak IDs.
Definition: Peak.h:127
float _fy
row-position of peak
Definition: Peak.h:132
float _fx
column-position of peak
Definition: Peak.h:131
bool lsst::afw::detection::Peak::operator== ( Peak const &  rhs) const
inline

Definition at line 89 of file Peak.h.

89  {
90  return _id == rhs._id;
91  }
int _id
unique ID for this peak
Definition: Peak.h:128
template<typename Archive >
void lsst::afw::detection::Peak::serialize ( Archive &  ar,
unsigned int const  version 
)
inlineprivate

Definition at line 120 of file Peak.h.

120  {
121  ar & make_nvp("id", _id);
122  ar & make_nvp("ix", _ix) & make_nvp("iy", _iy);
123  ar & make_nvp("fx", _fx) & make_nvp("fy", _fy);
124  ar & make_nvp("peakValue", _peakValue);
125  }
float _peakValue
value of image at peak position
Definition: Peak.h:133
int _ix
column-position of peak pixel
Definition: Peak.h:129
int _id
unique ID for this peak
Definition: Peak.h:128
int _iy
row-position of peak pixel
Definition: Peak.h:130
float _fy
row-position of peak
Definition: Peak.h:132
float _fx
column-position of peak
Definition: Peak.h:131
void lsst::afw::detection::Peak::setFx ( float  fx)
inline

Set the column centroid.

Definition at line 110 of file Peak.h.

void lsst::afw::detection::Peak::setFy ( float  fy)
inline

Set the row centroid.

Definition at line 111 of file Peak.h.

void lsst::afw::detection::Peak::setPeakValue ( float  peakValue)
inline

Set the value of the image at the peak.

Definition at line 113 of file Peak.h.

std::string lsst::afw::detection::Peak::toString ( void  )

Return a string-representation of a Peak

Definition at line 44 of file Peak.cc.

44  {
45  return (boost::format("%d: (%d,%d) (%.3f, %.3f)") % _id % _ix % _iy % _fx % _fy).str();
46 }
int _ix
column-position of peak pixel
Definition: Peak.h:129
int _id
unique ID for this peak
Definition: Peak.h:128
int _iy
row-position of peak pixel
Definition: Peak.h:130
float _fy
row-position of peak
Definition: Peak.h:132
float _fx
column-position of peak
Definition: Peak.h:131

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 118 of file Peak.h.

Member Data Documentation

float lsst::afw::detection::Peak::_fx
private

column-position of peak

Definition at line 131 of file Peak.h.

float lsst::afw::detection::Peak::_fy
private

row-position of peak

Definition at line 132 of file Peak.h.

int lsst::afw::detection::Peak::_id
mutableprivate

unique ID for this peak

Definition at line 128 of file Peak.h.

int lsst::afw::detection::Peak::_ix
private

column-position of peak pixel

Definition at line 129 of file Peak.h.

int lsst::afw::detection::Peak::_iy
private

row-position of peak pixel

Definition at line 130 of file Peak.h.

float lsst::afw::detection::Peak::_peakValue
private

value of image at peak position

Definition at line 133 of file Peak.h.

int lsst::afw::detection::Peak::id = 0
staticprivate

Counter for Peak IDs.

Definition at line 127 of file Peak.h.


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