Class Footprint¶
Defined in File Footprint.h
Inheritance Relationships¶
Base Types¶
public lsst::afw::table::io::PersistableFacade< lsst::afw::detection::Footprint >
(Template Class PersistableFacade)public lsst::afw::table::io::Persistable
(Class Persistable)
Derived Type¶
public lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >
(Template Class HeavyFootprint)
Class Documentation¶
-
class
Footprint
: public lsst::afw::table::io::PersistableFacade<lsst::afw::detection::Footprint>, public lsst::afw::table::io::Persistable¶ Class to describe the properties of a detected object from an image
A Footprint is designed to be constructed with information about a detected object in an image. Internally a Footprint holds a SpanSet which is used to describe the location of the object in the image (the x, y pixel locations which are considered part of the object). In addition a Footprint contains a PeakCatalog which is used to store the location and intensity of peaks in the detection.
Subclassed by lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >
Public Functions
Constructor for Footprint object.
Constructor for the Footprint object.
-
~Footprint
()¶
-
virtual bool
isHeavy
() const¶ Indicates if this object is a HeavyFootprint
Sets the shared pointer to the SpanSet in the Footprint
- Parameters
otherSpanSet
: Shared pointer to a SpanSet
-
PeakCatalog &
getPeaks
()¶ Return the Peaks contained in this Footprint
The peaks should be ordered by decreasing pixel intensity at the peak position (so the most negative peak appears last). Users that add new Peaks manually are responsible for maintaining this sorting.
-
const PeakCatalog &
getPeaks
() const¶
-
std::shared_ptr<PeakRecord>
addPeak
(float fx, float fy, float value)¶ Convenience function to add a peak
- Parameters
fx
: Float containing the x position of a peakfy
: Float containing the y position of a peakvalue
: The intensity value of the peak
-
void
sortPeaks
(afw::table::Key<float> const &key = afw::table::Key<float>())¶ Sort Peaks from most positive value to most negative.
If the key passed is invalid (the default) PeakTable::getPeakValueKey() will be used.
- Parameters
key
: A key corresponding to the field in the Schema the PeakCatalog is to be sorted by.
-
void
setPeakSchema
(afw::table::Schema const &peakSchema)¶ Set the Schema used by the PeakCatalog (will throw if PeakCatalog is not empty).
- Parameters
peakSchema
: The schema to use in the PeakCatalog
- Exceptions
pex::exceptions::LogicError
: Thrown if if the PeakCatalog is not empty
-
void
setPeakCatalog
(PeakCatalog const &otherPeaks)¶ Set the peakCatalog to a copy of the supplied catalog
PeakCatalog will be copied into the Footprint, but a PeakCatalog is a shallow copy, so records will not be duplicated. This function will throw an error if the PeakCatalog of *this is not empty.
- Parameters
otherPeaks
: The PeakCatalog to copy
-
std::size_t
getArea
() const¶ Return the number of pixels in this Footprint
This function returns the real number of pixels, not the area of the bbox.
-
lsst::geom::Point2D
getCentroid
() const¶ Return the Footprint’s centroid
The centroid is calculated as the mean of the pixel centers
-
geom::ellipses::Quadrupole
getShape
() const¶ Return the Footprint’s shape (interpreted as an ellipse)
The shape is determined by measuring the moments of the pixel centers about its centroid (cf. getCentroid)
-
void
shift
(int dx, int dy)¶ Shift a Footprint by
(dx, dy)
- Parameters
dx
: How much to move Footprint in column directiondy
: How much to move in row direction
-
void
shift
(lsst::geom::ExtentI const &d)¶ Shift a Footprint by a given extent
- Parameters
d
: ExtentI object which gives the dimensions the Footprint should be shifted
-
void
setRegion
(lsst::geom::Box2I const ®ion)¶ Set the corners of the MaskedImage wherein the footprints dwell
- Parameters
region
: A box describing the corners of the Image the Footprint derives from
-
void
clipTo
(lsst::geom::Box2I const &bbox)¶ Clip the Footprint such that all values lie inside the supplied Bounding Box
- Parameters
bbox
: Integer box object that defines the boundaries the footprint should be clipped to.
-
bool
contains
(lsst::geom::Point2I const &pix) const¶ Tests if a pixel postion falls inside the Footprint
- Parameters
pix
: Integer point object defining the position of a pixel to test
Transform the footprint from one WCS to another
- Parameters
source
: Wcs that defines the coordinate system of the input footprint.target
: Wcs that defines that desired coordinate system of the returned footprint.region
: Used to set the “region” box of the returned footprint; note that this is NOT the same as the footprint’s bounding box.doClip
: If true, clip the new footprint to the region bbox before returning it.
-
std::shared_ptr<Footprint>
transform
(lsst::geom::LinearTransform const &t, lsst::geom::Box2I const ®ion, bool doClip = true) const¶ Return a new Footprint whose pixels are the product of applying the specified transformation
- Parameters
t
: A linear transform object which will be used to map the pixelsregion
: Used to set the “region” box of the returned footprint; note that this is NOT the same as the footprint’s bounding box.doClip
: If true, clip the new footprint to the region bbox before returning it.
-
std::shared_ptr<Footprint>
transform
(lsst::geom::AffineTransform const &t, lsst::geom::Box2I const ®ion, bool doClip = true) const¶ Return a new Footprint whose pixels are the product of applying the specified transformation
- Parameters
t
: An affine transform object which will be used to map the pixelsregion
: Used to set the “region” box of the returned footprint; note that this is NOT the same as the footprint’s bounding box.doClip
: If true, clip the new footprint to the region bbox before returning it.
-
std::shared_ptr<Footprint>
transform
(geom::TransformPoint2ToPoint2 const &t, lsst::geom::Box2I const ®ion, bool doClip = true) const¶ Return a new Footprint whose pixels are the product of applying the specified transformation
- Parameters
t
: A 2-D transform which will be used to map the pixelsregion
: Used to set the “region” box of the returned footprint; note that this is NOT the same as the footprint’s bounding box.doClip
: If true, clip the new footprint to the region bbox before returning it.
-
bool
isPersistable
() const¶ Report if this object is persistable
-
void
dilate
(int r, geom::Stencil s = geom::Stencil::CIRCLE)¶ Dilate the Footprint with a defined kernel
This function enlarges the SpanSet which defines the area of the Footprint by an amount governed by in input kernel
- Parameters
r
: The radius of the stencil object used to create a dilation kernels
: The stencil object used to create the dilation kernel
-
void
dilate
(geom::SpanSet const &other)¶ Dilate the Footprint with a defined kernel
This function enlarges the SpanSet which defines the area of the Footprint by an amount governed by the input kernel
- Parameters
other
: SpanSet to use as the kernel in dilation
-
void
erode
(int r, geom::Stencil s = geom::Stencil::CIRCLE)¶ Erode the Footprint with a defined kernel
This function reduces the size of the SpanSet which defines the area of the Footprint by an amount governed by the input kernel
- Parameters
r
: The radius of the stencil object used to create a erosion kernels
: The stencil object used to create the erosion kernel
-
void
erode
(geom::SpanSet const &other)¶ Erode the Footprint with a defined kernel
This function reduces the size of the SpanSet which defines the area of the Footprint by an amount governed by the input kernel
- Parameters
other
: SpanSet to use as the kernel in erosion
-
void
removeOrphanPeaks
()¶ Remove peaks from the PeakCatalog that fall outside the area of the Footprint
Protected Functions
-
std::string
getPersistenceName
() const¶ Return the name correspoinging ot the persistence type
-
std::string
getPythonModule
() const¶ Return the python module the object will live in
Protected Static Functions
-
static std::unique_ptr<Footprint>
readSpanSet
(afw::table::BaseCatalog const&, afw::table::io::InputArchive const&)¶ Static method used to unpersist the SpanSet member of the Footprint class
Friends
-
friend
lsst::afw::detection::Footprint::FootprintFactory