LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
lsst::afw::detection::FootprintSet Class Reference

A set of Footprints, associated with a MaskedImage. More...

#include <FootprintSet.h>

Public Types

using FootprintList = std::vector<std::shared_ptr<Footprint>>
 The FootprintSet's set of Footprints.
 

Public Member Functions

template<typename ImagePixelT >
 FootprintSet (image::Image< ImagePixelT > const &img, Threshold const &threshold, int const npixMin=1, bool const setPeaks=true, table::Schema const &peakSchema=PeakTable::makeMinimalSchema())
 Find a FootprintSet given an Image and a threshold.
 
template<typename MaskPixelT >
 FootprintSet (image::Mask< MaskPixelT > const &img, Threshold const &threshold, int const npixMin=1)
 Find a FootprintSet given a Mask and a threshold.
 
template<typename ImagePixelT , typename MaskPixelT >
 FootprintSet (image::MaskedImage< ImagePixelT, MaskPixelT > const &img, Threshold const &threshold, std::string const &planeName="", int const npixMin=1, bool const setPeaks=true)
 Find a FootprintSet given a MaskedImage and a threshold.
 
 FootprintSet (lsst::geom::Box2I region)
 Construct an empty FootprintSet given a region that its footprints would have lived in.
 
 FootprintSet (FootprintSet const &rhs)
 Copy constructor.
 
 FootprintSet (FootprintSet const &set, int rGrow, FootprintControl const &ctrl)
 
 FootprintSet (FootprintSet &&rhs)
 
 ~FootprintSet ()
 
 FootprintSet (FootprintSet const &set, int rGrow, bool isotropic=true)
 Grow all the Footprints in the input FootprintSet, returning a new FootprintSet.
 
 FootprintSet (FootprintSet const &footprints1, FootprintSet const &footprints2, bool const includePeaks)
 Return the FootprintSet corresponding to the merge of two input FootprintSets.
 
FootprintSetoperator= (FootprintSet const &rhs)
 Assignment operator.
 
FootprintSetoperator= (FootprintSet &&rhs)
 
void swap (FootprintSet &rhs) noexcept
 
void swapFootprintList (FootprintList &rhs) noexcept
 
std::shared_ptr< FootprintListgetFootprints ()
 : Return the Footprints of detected objects
 
void setFootprints (std::shared_ptr< FootprintList > footprints)
 : Set the Footprints of detected objects
 
std::shared_ptr< FootprintList const > const getFootprints () const
 Retun the Footprints of detected objects.
 
void makeSources (afw::table::SourceCatalog &catalog) const
 Add a new record corresponding to each footprint to a SourceCatalog.
 
void setRegion (lsst::geom::Box2I const &region)
 Set the corners of the FootprintSet's MaskedImage to region.
 
lsst::geom::Box2I const getRegion () const
 Return the corners of the MaskedImage.
 
std::shared_ptr< image::Image< FootprintIdPixel > > insertIntoImage () const
 Return an Image with pixels set to the Footprints in the FootprintSet.
 
template<typename MaskPixelT >
void setMask (image::Mask< MaskPixelT > *mask, std::string const &planeName)
 
template<typename MaskPixelT >
void setMask (std::shared_ptr< image::Mask< MaskPixelT > > mask, std::string const &planeName)
 
void merge (FootprintSet const &rhs, int tGrow=0, int rGrow=0, bool isotropic=true)
 Merge a FootprintSet into *this.
 
template<typename ImagePixelT , typename MaskPixelT >
void makeHeavy (image::MaskedImage< ImagePixelT, MaskPixelT > const &mimg, HeavyFootprintCtrl const *ctrl=nullptr)
 Convert all the Footprints in the FootprintSet to be HeavyFootprints.
 

Detailed Description

A set of Footprints, associated with a MaskedImage.

Definition at line 55 of file FootprintSet.h.

Member Typedef Documentation

◆ FootprintList

The FootprintSet's set of Footprints.

Definition at line 58 of file FootprintSet.h.

Constructor & Destructor Documentation

◆ FootprintSet() [1/9]

template<typename ImagePixelT >
lsst::afw::detection::FootprintSet::FootprintSet ( image::Image< ImagePixelT > const & img,
Threshold const & threshold,
int const npixMin = 1,
bool const setPeaks = true,
table::Schema const & peakSchema = PeakTable::makeMinimalSchema() )

Find a FootprintSet given an Image and a threshold.

peakSchema is used to preserving the input peak schema when merging FootprintSets.

Parameters
imgImage to search for objects
thresholdthreshold to find objects
npixMinminimum number of pixels in an object
setPeaksshould I set the Peaks list?
peakSchemaSchema for peak records, even if we don't measure them here.

◆ FootprintSet() [2/9]

template<typename MaskPixelT >
lsst::afw::detection::FootprintSet::FootprintSet ( image::Mask< MaskPixelT > const & img,
Threshold const & threshold,
int const npixMin = 1 )

Find a FootprintSet given a Mask and a threshold.

Parameters
imgImage to search for objects
thresholdthreshold to find objects
npixMinminimum number of pixels in an object

◆ FootprintSet() [3/9]

template<typename ImagePixelT , typename MaskPixelT >
lsst::afw::detection::FootprintSet::FootprintSet ( image::MaskedImage< ImagePixelT, MaskPixelT > const & img,
Threshold const & threshold,
std::string const & planeName = "",
int const npixMin = 1,
bool const setPeaks = true )

Find a FootprintSet given a MaskedImage and a threshold.

Go through an image, finding sets of connected pixels above threshold and assembling them into Footprints; the resulting set of objects is returned

If threshold.getPolarity() is true, pixels above the Threshold are assembled into Footprints; if it's false, then pixels below Threshold are processed (Threshold will probably have to be below the background level for this to make sense, e.g. for difference imaging)

Parameters
imgMaskedImage to search for objects
thresholdthreshold for footprints (controls size)
planeNamemask plane to set (if != "")
npixMinminimum number of pixels in an object
setPeaksshould I set the Peaks list?

◆ FootprintSet() [4/9]

lsst::afw::detection::FootprintSet::FootprintSet ( lsst::geom::Box2I region)

Construct an empty FootprintSet given a region that its footprints would have lived in.

Parameters
regionthe desired region

◆ FootprintSet() [5/9]

lsst::afw::detection::FootprintSet::FootprintSet ( FootprintSet const & rhs)

Copy constructor.

Parameters
rhsthe input FootprintSet

◆ FootprintSet() [6/9]

lsst::afw::detection::FootprintSet::FootprintSet ( FootprintSet const & set,
int rGrow,
FootprintControl const & ctrl )

◆ FootprintSet() [7/9]

lsst::afw::detection::FootprintSet::FootprintSet ( FootprintSet && rhs)

◆ ~FootprintSet()

lsst::afw::detection::FootprintSet::~FootprintSet ( )

◆ FootprintSet() [8/9]

lsst::afw::detection::FootprintSet::FootprintSet ( FootprintSet const & set,
int rGrow,
bool isotropic = true )

Grow all the Footprints in the input FootprintSet, returning a new FootprintSet.

The output FootprintSet may contain fewer Footprints, as some may well have been merged

Parameters
setthe input FootprintSet
rGrowGrow Footprints by r pixels
isotropicGrow isotropically (as opposed to a Manhattan metric)
Note
Isotropic grows are significantly slower

◆ FootprintSet() [9/9]

lsst::afw::detection::FootprintSet::FootprintSet ( FootprintSet const & footprints1,
FootprintSet const & footprints2,
bool const includePeaks )

Return the FootprintSet corresponding to the merge of two input FootprintSets.

Todo
Implement this. There's RHL Pan-STARRS code to do it, but it isn't yet converted to LSST C++

Member Function Documentation

◆ getFootprints() [1/2]

std::shared_ptr< FootprintList > lsst::afw::detection::FootprintSet::getFootprints ( )
inline

: Return the Footprints of detected objects

Definition at line 162 of file FootprintSet.h.

162{ return _footprints; }

◆ getFootprints() [2/2]

std::shared_ptr< FootprintList const > const lsst::afw::detection::FootprintSet::getFootprints ( ) const
inline

Retun the Footprints of detected objects.

Definition at line 172 of file FootprintSet.h.

172{ return _footprints; }

◆ getRegion()

lsst::geom::Box2I const lsst::afw::detection::FootprintSet::getRegion ( ) const
inline

Return the corners of the MaskedImage.

Definition at line 196 of file FootprintSet.h.

196{ return _region; }

◆ insertIntoImage()

std::shared_ptr< image::Image< FootprintIdPixel > > lsst::afw::detection::FootprintSet::insertIntoImage ( ) const

Return an Image with pixels set to the Footprints in the FootprintSet.

Returns
an std::shared_ptr<image::Image>

◆ makeHeavy()

template<typename ImagePixelT , typename MaskPixelT >
void lsst::afw::detection::FootprintSet::makeHeavy ( image::MaskedImage< ImagePixelT, MaskPixelT > const & mimg,
HeavyFootprintCtrl const * ctrl = nullptr )

Convert all the Footprints in the FootprintSet to be HeavyFootprints.

Parameters
mimgthe image providing pixel values
ctrlControl how we manipulate HeavyFootprints

◆ makeSources()

void lsst::afw::detection::FootprintSet::makeSources ( afw::table::SourceCatalog & catalog) const

Add a new record corresponding to each footprint to a SourceCatalog.

Parameters
[in,out]catalogCatalog to append new sources to.

The new sources will have their footprints set to point to the footprints in the footprint set; they will not be deep-copied.

◆ merge()

void lsst::afw::detection::FootprintSet::merge ( FootprintSet const & rhs,
int tGrow = 0,
int rGrow = 0,
bool isotropic = true )

Merge a FootprintSet into *this.

Parameters
rhsthe Footprints to merge
tGrowNo. of pixels to grow this Footprints
rGrowNo. of pixels to grow rhs Footprints
isotropicGrow isotropically (as opposed to a Manhattan metric)

◆ operator=() [1/2]

FootprintSet & lsst::afw::detection::FootprintSet::operator= ( FootprintSet && rhs)

◆ operator=() [2/2]

FootprintSet & lsst::afw::detection::FootprintSet::operator= ( FootprintSet const & rhs)

Assignment operator.

◆ setFootprints()

void lsst::afw::detection::FootprintSet::setFootprints ( std::shared_ptr< FootprintList > footprints)
inline

: Set the Footprints of detected objects

Definition at line 167 of file FootprintSet.h.

167{ _footprints = footprints; }

◆ setMask() [1/2]

template<typename MaskPixelT >
void lsst::afw::detection::FootprintSet::setMask ( image::Mask< MaskPixelT > * mask,
std::string const & planeName )
inline
Parameters
maskSet bits in the mask
planeNameHere's the name of the mask plane to fit

Definition at line 206 of file FootprintSet.h.

208 {
209 for (auto const& foot : *_footprints) {
210 foot->getSpans()->setMask(*mask, image::Mask<MaskPixelT>::getPlaneBitMask(planeName));
211 }
212 }
afw::table::Key< afw::table::Array< MaskPixelT > > mask
Represent a 2-dimensional array of bitmask pixels.
Definition Mask.h:81

◆ setMask() [2/2]

template<typename MaskPixelT >
void lsst::afw::detection::FootprintSet::setMask ( std::shared_ptr< image::Mask< MaskPixelT > > mask,
std::string const & planeName )
inline
Parameters
maskSet bits in the mask
planeNameHere's the name of the mask plane to fit

Definition at line 215 of file FootprintSet.h.

217 {
218 setMask(mask.get(), planeName);
219 }
void setMask(image::Mask< MaskPixelT > *mask, std::string const &planeName)

◆ setRegion()

void lsst::afw::detection::FootprintSet::setRegion ( lsst::geom::Box2I const & region)

Set the corners of the FootprintSet's MaskedImage to region.

Parameters
regiondesired region
Note
updates all the Footprints' regions too

◆ swap()

void lsst::afw::detection::FootprintSet::swap ( FootprintSet & rhs)
inlinenoexcept

Definition at line 146 of file FootprintSet.h.

146 {
147 using std::swap; // See Meyers, Effective C++, Item 25
148 swap(*_footprints, *rhs.getFootprints());
149 lsst::geom::Box2I rhsRegion = rhs.getRegion();
150 rhs.setRegion(getRegion());
151 setRegion(rhsRegion);
152 }
void swap(FootprintSet &rhs) noexcept
lsst::geom::Box2I const getRegion() const
Return the corners of the MaskedImage.
void setRegion(lsst::geom::Box2I const &region)
Set the corners of the FootprintSet's MaskedImage to region.
An integer coordinate rectangle.
Definition Box.h:55
T swap(T... args)

◆ swapFootprintList()

void lsst::afw::detection::FootprintSet::swapFootprintList ( FootprintList & rhs)
inlinenoexcept

Definition at line 154 of file FootprintSet.h.

154 {
155 using std::swap;
156 swap(*_footprints, rhs);
157 }

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