|
lsst.afw
14.0-23-g38c323faa+1
|
Class to describe the properties of a detected object from an image. More...
#include <Footprint.h>
Public Types | |
| typedef unsigned long | memId |
| typedef memId(* | memNewCallback) (const memId cid) |
| typedef memId(* | memCallback) (const Citizen *ptr) |
Public Member Functions | |
| Footprint (std::shared_ptr< geom::SpanSet > inputSpans, geom::Box2I const ®ion=geom::Box2I()) | |
| Constructor for Footprint object. More... | |
| Footprint (std::shared_ptr< geom::SpanSet > inputSpans, afw::table::Schema const &peakSchema, geom::Box2I const ®ion=geom::Box2I()) | |
| Constructor for the Footprint object. More... | |
| Footprint () | |
| Constructor of a empty Footprint object. More... | |
| Footprint (Footprint const &other)=default | |
| Footprint (Footprint &&)=default | |
| Footprint & | operator= (Footprint const &other)=default |
| Footprint & | operator= (Footprint &&)=default |
| virtual | ~Footprint () |
| virtual bool | isHeavy () const |
| Indicates if this object is a HeavyFootprint. More... | |
| std::shared_ptr< geom::SpanSet > | getSpans () const |
| Return a shared pointer to the SpanSet. More... | |
| void | setSpans (std::shared_ptr< geom::SpanSet > otherSpanSet) |
| Sets the shared pointer to the SpanSet in the Footprint. More... | |
| PeakCatalog & | getPeaks () |
| Return the Peaks contained in this Footprint. More... | |
| const PeakCatalog & | getPeaks () const |
| std::shared_ptr< PeakRecord > | addPeak (float fx, float fy, float value) |
| Convenience function to add a peak. More... | |
| void | sortPeaks (afw::table::Key< float > const &key=afw::table::Key< float >()) |
| Sort Peaks from most positive value to most negative. More... | |
| void | setPeakSchema (afw::table::Schema const &peakSchema) |
| Set the Schema used by the PeakCatalog (will throw if PeakCatalog is not empty). More... | |
| void | setPeakCatalog (PeakCatalog const &otherPeaks) |
| Set the peakCatalog to a copy of the supplied catalog. More... | |
| std::size_t | getArea () const |
| Return the number of pixels in this Footprint. More... | |
| geom::Point2D | getCentroid () const |
| Return the Footprint's centroid. More... | |
| geom::ellipses::Quadrupole | getShape () const |
| Return the Footprint's shape (interpreted as an ellipse) More... | |
| void | shift (int dx, int dy) |
Shift a Footprint by (dx, dy) More... | |
| void | shift (geom::ExtentI const &d) |
| Shift a Footprint by a given extent. More... | |
| geom::Box2I | getBBox () const |
| Return the Footprint's bounding box. More... | |
| geom::Box2I | getRegion () const |
| Return the corners of the MaskedImage the footprints live in. More... | |
| void | setRegion (geom::Box2I const ®ion) |
| Set the corners of the MaskedImage wherein the footprints dwell. More... | |
| void | clipTo (geom::Box2I const &bbox) |
| Clip the Footprint such that all values lie inside the supplied Bounding Box. More... | |
| bool | contains (geom::Point2I const &pix) const |
| Tests if a pixel postion falls inside the Footprint. More... | |
| std::shared_ptr< Footprint > | transform (std::shared_ptr< image::Wcs > source, std::shared_ptr< image::Wcs > target, geom::Box2I const ®ion, bool doClip=true) const |
| Transform the footprint from one WCS to another. More... | |
| std::shared_ptr< Footprint > | transform (geom::LinearTransform const &t, geom::Box2I const ®ion, bool doClip=true) const |
| Return a new Footprint who's pixels are the product of applying the specified transformation. More... | |
| std::shared_ptr< Footprint > | transform (geom::AffineTransform const &t, geom::Box2I const ®ion, bool doClip=true) const |
| Return a new Footprint who's pixels are the product of applying the specified transformation. More... | |
| std::shared_ptr< Footprint > | transform (geom::XYTransform const &t, geom::Box2I const ®ion, bool doClip=true) const |
| Return a new Footprint who's pixels are the product of applying the specified transformation. More... | |
| bool | isPersistable () const override |
| Report if this object is persistable. More... | |
| void | dilate (int r, geom::Stencil s=geom::Stencil::CIRCLE) |
| Dilate the Footprint with a defined kernel. More... | |
| void | dilate (geom::SpanSet const &other) |
| Dilate the Footprint with a defined kernel. More... | |
| void | erode (int r, geom::Stencil s=geom::Stencil::CIRCLE) |
| Erode the Footprint with a defined kernel. More... | |
| void | erode (geom::SpanSet const &other) |
| Erode the Footprint with a defined kernel. More... | |
| void | removeOrphanPeaks () |
| Remove peaks from the PeakCatalog that fall outside the area of the Footprint. More... | |
| bool | isContiguous () const |
| Reports if the Footprint is simply connected or has multiple components. More... | |
| std::vector< std::shared_ptr< Footprint > > | split () const |
| Split a multi-component Footprint into a vector of contiguous Footprints. More... | |
| bool | operator== (Footprint const &other) const |
| equality operator More... | |
| std::string | repr () const |
| void | markPersistent (void) |
| memId | getId () const |
| void | writeFits (std::string const &fileName, std::string const &mode="w") const |
| Write the object to a regular FITS file. More... | |
| void | writeFits (fits::MemFileManager &manager, std::string const &mode="w") const |
| Write the object to a FITS image in memory. More... | |
| void | writeFits (fits::Fits &fitsfile) const |
| Write the object to an already-open FITS object. More... | |
Static Public Member Functions | |
| static bool | hasBeenCorrupted () |
| static memId | getNextMemId () |
| static int | init () |
| static int | census (int, memId startingMemId=0) |
| static void | census (std::ostream &stream, memId startingMemId=0) |
| static const std::vector< const Citizen *> * | census () |
| static int | census (int, memId startingMemId=0) |
| static void | census (std::ostream &stream, memId startingMemId=0) |
| static const std::vector< const Citizen *> * | census () |
| static memId | setNewCallbackId (memId id) |
| static memId | setNewCallbackId (memId id) |
| static memId | setDeleteCallbackId (memId id) |
| static memId | setDeleteCallbackId (memId id) |
| static memNewCallback | setNewCallback (memNewCallback func) |
| static memCallback | setDeleteCallback (memCallback func) |
| static memCallback | setCorruptionCallback (memCallback func) |
| static std::shared_ptr< lsst::afw::detection::Footprint > | readFits (fits::Fits &fitsfile) |
| Read an object from an already open FITS object. More... | |
| static std::shared_ptr< lsst::afw::detection::Footprint > | readFits (std::string const &fileName, int hdu=INT_MIN) |
| Read an object from a regular FITS file. More... | |
| static std::shared_ptr< lsst::afw::detection::Footprint > | readFits (fits::MemFileManager &manager, int hdu=INT_MIN) |
| Read an object from a FITS file in memory. More... | |
Public Attributes | |
| magicSentinel | |
Protected Types | |
| typedef io::OutputArchiveHandle | OutputArchiveHandle |
Protected Member Functions | |
| std::string | getPersistenceName () const override |
| Return the name correspoinging ot the persistence type. More... | |
| std::string | getPythonModule () const override |
| Return the python module the object will live in. More... | |
| void | write (OutputArchiveHandle &handle) const override |
| Write an instance of a Footprint to an output Archive. More... | |
Static Protected Member 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. More... | |
| static void | readPeaks (afw::table::BaseCatalog const &, Footprint &) |
| Static method used to unpersist the PeakCatalog member of the Footprint class. More... | |
Friends | |
| class | FootprintFactory |
| class | FootprintMerge |
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.
Definition at line 62 of file Footprint.h.
|
protectedinherited |
Definition at line 107 of file Persistable.h.
|
explicit |
Constructor for Footprint object.
| inputSpans | Shared pointer to a SpanSet defining the pixels included in the Footprint. |
| region | Bounding box of the image in which the Footprint was created, defaults to empty box. |
Definition at line 32 of file Footprint.cc.
|
explicit |
Constructor for the Footprint object.
| inputSpans | Shared pointer to a SpanSet defining the pixels included in the Footprint. |
| peakSchema | schema to be used in the PeakCatalog |
| region | Bounding box of the image in which the Footprint was created, defaults to empty box. |
Definition at line 38 of file Footprint.cc.
|
inlineexplicit |
Constructor of a empty Footprint object.
Definition at line 96 of file Footprint.h.
|
default |
|
default |
|
inlinevirtual |
Definition at line 108 of file Footprint.h.
| std::shared_ptr< PeakRecord > lsst::afw::detection::Footprint::addPeak | ( | float | fx, |
| float | fy, | ||
| float | value | ||
| ) |
Convenience function to add a peak.
| fx | Float containing the x position of a peak |
| fy | Float containing the y position of a peak |
| value | The intensity value of the peak |
Definition at line 44 of file Footprint.cc.
| void lsst::afw::detection::Footprint::clipTo | ( | geom::Box2I const & | bbox | ) |
Clip the Footprint such that all values lie inside the supplied Bounding Box.
| bbox | Integer box object that defines the boundaries the footprint should be clipped to. |
Definition at line 71 of file Footprint.cc.
| bool lsst::afw::detection::Footprint::contains | ( | geom::Point2I const & | pix | ) | const |
Tests if a pixel postion falls inside the Footprint.
| pix | Integer point object defining the position of a pixel to test |
Definition at line 76 of file Footprint.cc.
| void lsst::afw::detection::Footprint::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
| r | The radius of the stencil object used to create a dilation kernel |
| s | The stencil object used to create the dilation kernel |
Definition at line 114 of file Footprint.cc.
| void lsst::afw::detection::Footprint::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
| other | SpanSet to use as the kernel in dilation |
Definition at line 116 of file Footprint.cc.
| void lsst::afw::detection::Footprint::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
| r | The radius of the stencil object used to create a erosion kernel |
| s | The stencil object used to create the erosion kernel |
Definition at line 118 of file Footprint.cc.
| void lsst::afw::detection::Footprint::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
| other | SpanSet to use as the kernel in erosion |
Definition at line 123 of file Footprint.cc.
|
inline |
Return the number of pixels in this Footprint.
This function returns the real number of pixels, not the area of the bbox.
Definition at line 174 of file Footprint.h.
|
inline |
Return the Footprint's bounding box.
Definition at line 209 of file Footprint.h.
|
inline |
Return the Footprint's centroid.
The centroid is calculated as the mean of the pixel centers
Definition at line 181 of file Footprint.h.
|
inline |
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.
Definition at line 130 of file Footprint.h.
|
inline |
Definition at line 131 of file Footprint.h.
|
overrideprotectedvirtual |
Return the name correspoinging ot the persistence type.
Reimplemented from lsst::afw::table::io::Persistable.
Reimplemented in lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >.
Definition at line 250 of file Footprint.cc.
|
inlineoverrideprotectedvirtual |
Return the python module the object will live in.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 363 of file Footprint.h.
|
inline |
Return the corners of the MaskedImage the footprints live in.
Definition at line 214 of file Footprint.h.
|
inline |
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)
Definition at line 189 of file Footprint.h.
|
inline |
Return a shared pointer to the SpanSet.
Definition at line 116 of file Footprint.h.
|
inline |
Reports if the Footprint is simply connected or has multiple components.
Definition at line 336 of file Footprint.h.
|
inlinevirtual |
Indicates if this object is a HeavyFootprint.
Reimplemented in lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >.
Definition at line 112 of file Footprint.h.
|
inlineoverridevirtual |
Report if this object is persistable.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 284 of file Footprint.h.
| bool lsst::afw::detection::Footprint::operator== | ( | Footprint const & | other | ) | const |
equality operator
| other | The Footprint for which equality will be computed |
Definition at line 154 of file Footprint.cc.
|
inlinestaticinherited |
Read an object from an already open FITS object.
| [in] | fitsfile | FITS object to read from, already positioned at the desired HDU. |
Definition at line 180 of file Persistable.h.
|
inlinestaticinherited |
Read an object from a regular FITS file.
| [in] | fileName | Name of the file to read. |
| [in] | hdu | HDU to read, where 0 is the primary. The special value of INT_MIN skips the primary HDU if it is empty. |
Definition at line 191 of file Persistable.h.
|
inlinestaticinherited |
Read an object from a FITS file in memory.
| [in] | manager | Manager for the memory to read from. |
| [in] | hdu | HDU to read, where 0 is the primary. The special value of INT_MIN skips the primary HDU if it is empty. |
Definition at line 202 of file Persistable.h.
|
staticprotected |
Static method used to unpersist the PeakCatalog member of the Footprint class.
Definition at line 291 of file Footprint.cc.
|
staticprotected |
Static method used to unpersist the SpanSet member of the Footprint class.
Definition at line 267 of file Footprint.cc.
| void lsst::afw::detection::Footprint::removeOrphanPeaks | ( | ) |
Remove peaks from the PeakCatalog that fall outside the area of the Footprint.
Definition at line 128 of file Footprint.cc.
| void lsst::afw::detection::Footprint::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.
| otherPeaks | The PeakCatalog to copy |
Definition at line 413 of file Footprint.cc.
| void lsst::afw::detection::Footprint::setPeakSchema | ( | afw::table::Schema const & | peakSchema | ) |
Set the Schema used by the PeakCatalog (will throw if PeakCatalog is not empty).
| peakSchema | The schema to use in the PeakCatalog |
| pex::exceptions::LogicError | Thrown if if the PeakCatalog is not empty |
Definition at line 409 of file Footprint.cc.
|
inline |
Set the corners of the MaskedImage wherein the footprints dwell.
| region | A box describing the corners of the Image the Footprint derives from |
Definition at line 221 of file Footprint.h.
| void lsst::afw::detection::Footprint::setSpans | ( | std::shared_ptr< geom::SpanSet > | otherSpanSet | ) |
Sets the shared pointer to the SpanSet in the Footprint.
| otherSpanSet | Shared pointer to a SpanSet |
Definition at line 42 of file Footprint.cc.
| void lsst::afw::detection::Footprint::shift | ( | int | dx, |
| int | dy | ||
| ) |
Shift a Footprint by (dx, dy)
| dx | How much to move Footprint in column direction |
| dy | How much to move in row direction |
Definition at line 61 of file Footprint.cc.
|
inline |
Shift a Footprint by a given extent.
| d | ExtentI object which gives the dimensions the Footprint should be shifted |
Definition at line 204 of file Footprint.h.
| void lsst::afw::detection::Footprint::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.
| key | A key corresponding to the field in the Schema the PeakCatalog is to be sorted by. |
Definition at line 54 of file Footprint.cc.
| std::vector< std::shared_ptr< Footprint > > lsst::afw::detection::Footprint::split | ( | ) | const |
| std::shared_ptr< Footprint > lsst::afw::detection::Footprint::transform | ( | std::shared_ptr< image::Wcs > | source, |
| std::shared_ptr< image::Wcs > | target, | ||
| geom::Box2I const & | region, | ||
| bool | doClip = true |
||
| ) | const |
Transform the footprint from one WCS to another.
| 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. |
Definition at line 78 of file Footprint.cc.
| std::shared_ptr< Footprint > lsst::afw::detection::Footprint::transform | ( | geom::LinearTransform const & | t, |
| geom::Box2I const & | region, | ||
| bool | doClip = true |
||
| ) | const |
Return a new Footprint who's pixels are the product of applying the specified transformation.
| t | A linear transform object which will be used to map the pixels |
| 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. |
Definition at line 86 of file Footprint.cc.
| std::shared_ptr< Footprint > lsst::afw::detection::Footprint::transform | ( | geom::AffineTransform const & | t, |
| geom::Box2I const & | region, | ||
| bool | doClip = true |
||
| ) | const |
Return a new Footprint who's pixels are the product of applying the specified transformation.
| t | An affine transform object which will be used to map the pixels |
| 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. |
Definition at line 91 of file Footprint.cc.
| std::shared_ptr< Footprint > lsst::afw::detection::Footprint::transform | ( | geom::XYTransform const & | t, |
| geom::Box2I const & | region, | ||
| bool | doClip = true |
||
| ) | const |
Return a new Footprint who's pixels are the product of applying the specified transformation.
| t | A XY transform object which will be used to map the pixels |
| 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. |
Definition at line 96 of file Footprint.cc.
|
overrideprotectedvirtual |
Write an instance of a Footprint to an output Archive.
Reimplemented from lsst::afw::table::io::Persistable.
Reimplemented in lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >.
Definition at line 252 of file Footprint.cc.
|
inherited |
Write the object to a regular FITS file.
| [in] | fileName | Name of the file to write to. |
| [in] | mode | If "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file. |
|
inherited |
Write the object to a FITS image in memory.
| [in] | manager | Name of the file to write to. |
| [in] | mode | If "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file. |
|
inherited |
Write the object to an already-open FITS object.
| [in] | fitsfile | Open FITS object to write to. |
|
friend |
Definition at line 370 of file Footprint.h.
|
friend |
Definition at line 383 of file Footprint.h.
1.8.13