LSSTApplications
10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
|
A set of pixels in an Image. More...
#include <Footprint.h>
Public Types | |
typedef boost::shared_ptr < Footprint > | Ptr |
typedef boost::shared_ptr < const Footprint > | ConstPtr |
typedef std::vector< Span::Ptr > | SpanList |
The Footprint's Span list. More... | |
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 | |
Footprint (int nspan=0, geom::Box2I const ®ion=geom::Box2I()) | |
Footprint (afw::table::Schema const &peakSchema, int nspan=0, geom::Box2I const ®ion=geom::Box2I()) | |
Footprint (geom::Box2I const &bbox, geom::Box2I const ®ion=geom::Box2I()) | |
Footprint (geom::Point2I const ¢er, double const radius, geom::Box2I const &=geom::Box2I()) | |
Footprint (geom::ellipses::Ellipse const &ellipse, geom::Box2I const ®ion=geom::Box2I()) | |
Footprint (SpanList const &spans, geom::Box2I const ®ion=geom::Box2I()) | |
Footprint (Footprint const &other) | |
virtual | ~Footprint () |
virtual bool | isHeavy () const |
int | getId () const |
SpanList & | getSpans () |
const SpanList & | getSpans () const |
PeakCatalog & | getPeaks () |
const PeakCatalog & | getPeaks () const |
boost::shared_ptr< PeakRecord > | addPeak (float fx, float fy, float value) |
Convenience function to add a peak (since that'd now be multiple lines without this function) More... | |
void | sortPeaks (afw::table::Key< float > const &key=afw::table::Key< float >()) |
void | setPeakSchema (afw::table::Schema const &peakSchema) |
Set the Schema used by the PeakCatalog (will throw if PeakCatalog is not empty). More... | |
int | getNpix () const |
int | getArea () const |
geom::Point2D | getCentroid () const |
geom::ellipses::Quadrupole | getShape () const |
const Span & | addSpan (const int y, const int x0, const int x1) |
const Span & | addSpan (Span const &span) |
const Span & | addSpan (Span const &span, int dx, int dy) |
const Span & | addSpanInSeries (const int y, const int x0, const int x1) |
void | shift (int dx, int dy) |
void | shift (geom::ExtentI d) |
geom::Box2I | getBBox () const |
Return the Footprint's bounding box. More... | |
geom::Box2I const & | 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) |
template<typename PixelT > | |
void | clipToNonzero (lsst::afw::image::Image< PixelT > const &img) |
bool | contains (geom::Point2I const &pix) const |
void | normalize () |
bool | isNormalized () const |
template<typename PixelT > | |
void | insertIntoImage (typename lsst::afw::image::Image< PixelT > &idImage, boost::uint64_t const id, geom::Box2I const ®ion=geom::Box2I()) const |
template<typename PixelT > | |
void | insertIntoImage (typename lsst::afw::image::Image< PixelT > &idImage, boost::uint64_t const id, bool const overwriteId, long const idMask, typename std::set< boost::uint64_t > *oldIds, geom::Box2I const ®ion=geom::Box2I()) const |
Footprint & | operator= (Footprint &other) |
template<typename MaskPixelT > | |
void | intersectMask (image::Mask< MaskPixelT > const &mask, MaskPixelT bitmask=~0x0) |
Intersect the Footprint with a Mask. More... | |
boost::shared_ptr< Footprint > | transform (image::Wcs const &source, image::Wcs const &target, geom::Box2I const ®ion, bool doClip=true) const |
Transform the footprint from one WCS to another. More... | |
boost::shared_ptr< Footprint > | findEdgePixels () const |
Find edge pixels on the footprint. More... | |
void | include (std::vector< boost::shared_ptr< Footprint >> const &children, bool ignoreSelf=false) |
Update the Footprint in-place to be the union of itself and all others provided. More... | |
bool | isPersistable () const |
Return true if this particular object can be persisted using afw::table::io. More... | |
Public Member Functions inherited from lsst::daf::base::Citizen | |
Citizen (const std::type_info &) | |
Citizen (Citizen const &) | |
~Citizen () | |
Citizen & | operator= (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... | |
Public Member Functions inherited from lsst.afw.table.io::Persistable | |
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... | |
virtual | ~Persistable () |
Protected Member Functions | |
virtual std::string | getPersistenceName () const |
Return the unique name used to persist this object and look up its factory. More... | |
virtual std::string | getPythonModule () const |
Return the fully-qualified Python module that should be imported to guarantee that its factory is registered. More... | |
virtual void | write (OutputArchiveHandle &handle) const |
Write the object to one or more catalogs. More... | |
void | readSpans (afw::table::BaseCatalog const &spanCat) |
Persistence implementation functions made available for derived classes. More... | |
void | readPeaks (afw::table::BaseCatalog const &peakCat) |
Persistence implementation functions made available for derived classes. More... | |
Protected Member Functions inherited from lsst.afw.table.io::Persistable | |
Persistable () | |
Persistable (Persistable const &other) | |
void | operator= (Persistable const &other) |
Private Attributes | |
int | _fid |
unique ID More... | |
int | _area |
number of pixels in this Footprint (not the area of the bbox) More... | |
SpanList | _spans |
the Spans contained in this Footprint More... | |
geom::Box2I | _bbox |
the Footprint's bounding box More... | |
PeakCatalog | _peaks |
the Peaks lying in this footprint More... | |
geom::Box2I | _region |
The corners of the MaskedImage the footprints live in. More... | |
bool | _normalized |
Are the spans sorted? More... | |
Static Private Attributes | |
static int | id |
Friends | |
class | FootprintFactory |
class | FootprintMerge |
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... | |
Static Public Member Functions inherited from lsst.afw.table.io::PersistableFacade< lsst::afw::detection::Footprint > | |
static boost::shared_ptr < lsst::afw::detection::Footprint > | readFits (fits::Fits &fitsfile) |
Read an object from an already open FITS object. More... | |
static boost::shared_ptr < lsst::afw::detection::Footprint > | readFits (std::string const &fileName, int hdu=0) |
Read an object from a regular FITS file. More... | |
static boost::shared_ptr < lsst::afw::detection::Footprint > | readFits (fits::MemFileManager &manager, int hdu=0) |
Read an object from a FITS file in memory. More... | |
Protected Types inherited from lsst.afw.table.io::Persistable | |
typedef io::OutputArchiveHandle | OutputArchiveHandle |
A set of pixels in an Image.
A Footprint is a set of pixels, usually but not necessarily contiguous. There are constructors to find Footprints above some threshold in an Image (see FootprintSet), or to create Footprints in the shape of various geometrical figures
Definition at line 62 of file Footprint.h.
typedef boost::shared_ptr<const Footprint> lsst.afw.detection::Footprint::ConstPtr |
Definition at line 68 of file Footprint.h.
typedef boost::shared_ptr<Footprint> lsst.afw.detection::Footprint::Ptr |
Definition at line 67 of file Footprint.h.
typedef std::vector<Span::Ptr> lsst.afw.detection::Footprint::SpanList |
The Footprint's Span list.
Definition at line 71 of file Footprint.h.
|
explicit |
Create a Footprint
lsst::pex::exceptions::InvalidParameterException | in nspan is < 0 |
nspan: initial number of Spans in this Footprint region: Bounding box of MaskedImage footprint
|
explicit |
Create a rectangular Footprint
|
explicit |
lsst.afw.detection::Footprint::Footprint | ( | geom::Point2I const & | center, |
double const | radius, | ||
geom::Box2I const & | = geom::Box2I() |
||
) |
|
explicit |
|
explicit |
lsst.afw.detection::Footprint::Footprint | ( | Footprint const & | other | ) |
Construct a footprint from a list of spans. Resulting Footprint is not normalized.
|
virtual |
boost::shared_ptr< PeakRecord > lsst.afw.detection::Footprint::addPeak | ( | float | fx, |
float | fy, | ||
float | value | ||
) |
Convenience function to add a peak (since that'd now be multiple lines without this function)
const Span& lsst.afw.detection::Footprint::addSpan | ( | const int | y, |
const int | x0, | ||
const int | x1 | ||
) |
Add a Span to a footprint, returning a reference to the new Span.
const Span& lsst.afw.detection::Footprint::addSpan | ( | Span const & | span | ) |
Add a Span to a Footprint returning a reference to the new Span
const Span& lsst.afw.detection::Footprint::addSpan | ( | Span const & | span, |
int | dx, | ||
int | dy | ||
) |
Add a Span to a Footprint returning a reference to the new Span
const Span& lsst.afw.detection::Footprint::addSpanInSeries | ( | const int | y, |
const int | x0, | ||
const int | x1 | ||
) |
Add a Span to a Footprint, where the Spans MUST be added in order (first in increasing y, then increasing x), and MUST NOT be overlapping. This method does NOT reset the _normalized boolean.
This method is useful when a Footprint is being constructed in such a way that Spans are guaranteed to be produced in order. In that case, it is not necessary to normalize() the Footprint after all the Spans have been added. This can save some computation.
void lsst.afw.detection::Footprint::clipTo | ( | geom::Box2I const & | bbox | ) |
void lsst.afw.detection::Footprint::clipToNonzero | ( | lsst::afw::image::Image< PixelT > const & | img | ) |
Clips the given Footprint to the region in the Image containing non-zero values. The clipping drops spans that are totally zero, and moves endpoints to non-zero; it does not split spans that have internal zeros.
bool lsst.afw.detection::Footprint::contains | ( | geom::Point2I const & | pix | ) | const |
Does this Footprint contain this pixel?
boost::shared_ptr< Footprint > lsst.afw.detection::Footprint::findEdgePixels | ( | ) | const |
Find edge pixels on the footprint.
Note that the resultant Footprint of edge pixels may not be contiguous.
|
inline |
Definition at line 153 of file Footprint.h.
|
inline |
Return the Footprint's bounding box.
Definition at line 206 of file Footprint.h.
geom::Point2D lsst.afw.detection::Footprint::getCentroid | ( | ) | const |
Return the Footprint's centroid
The centroid is calculated as the mean of the pixel centers
|
inline |
|
inline |
Return the number of pixels in this Footprint (the real number of pixels, not the area of the bbox).
Definition at line 152 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 123 of file Footprint.h.
|
inline |
Definition at line 124 of file Footprint.h.
|
protectedvirtual |
Return the unique name used to persist this object and look up its factory.
Must be less than ArchiveIndexSchema::MAX_NAME_LENGTH characters.
Reimplemented from lsst.afw.table.io::Persistable.
Reimplemented in lsst.afw.detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >.
|
protectedvirtual |
Return the fully-qualified Python module that should be imported to guarantee that its factory is registered.
Must be less than ArchiveIndexSchema::MAX_MODULE_LENGTH characters.
Will be ignored if empty.
Reimplemented from lsst.afw.table.io::Persistable.
|
inline |
Return the corners of the MaskedImage the footprints live in.
Definition at line 209 of file Footprint.h.
geom::ellipses::Quadrupole lsst.afw.detection::Footprint::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)
|
inline |
Return the Spans contained in this Footprint.
Definition at line 112 of file Footprint.h.
|
inline |
Return the Spans contained in this Footprint.
Definition at line 115 of file Footprint.h.
void lsst.afw.detection::Footprint::include | ( | std::vector< boost::shared_ptr< Footprint >> const & | children, |
bool | ignoreSelf = false |
||
) |
Update the Footprint in-place to be the union of itself and all others provided.
Only spans will be modified; peaks will be left unchanged. If ignoreSelf is true it will only be the union of all its children.
void lsst.afw.detection::Footprint::insertIntoImage | ( | typename lsst::afw::image::Image< PixelT > & | idImage, |
boost::uint64_t const | id, | ||
geom::Box2I const & | region = geom::Box2I() |
||
) | const |
Set the pixels in idImage that are in Footprint by adding the specified value to the Image.
idImage: Image to contain the footprint id: Add id to idImage for pixels in the Footprint region: Footprint's region (default: getRegion())
void lsst.afw.detection::Footprint::insertIntoImage | ( | typename lsst::afw::image::Image< PixelT > & | idImage, |
boost::uint64_t const | id, | ||
bool const | overwriteId, | ||
long const | idMask, | ||
typename std::set< boost::uint64_t > * | oldIds, | ||
geom::Box2I const & | region = geom::Box2I() |
||
) | const |
Set the pixels in idImage which are in Footprint by adding the specified value to the Image.
The list of ids found under the new Footprint are returned.
idImage: Image to contain the footprint id: Add id to idImage for pixels in the Footprint overwriteId: should id replace any value already in idImage? idMask: Don't overwrite ID bits in this mask oldIds: if non-NULL, set the IDs that were overwritten region: Footprint's region (default: getRegion())
void lsst.afw.detection::Footprint::intersectMask | ( | image::Mask< MaskPixelT > const & | mask, |
MaskPixelT | bitmask = ~0x0 |
||
) |
Intersect the Footprint with a Mask.
The resulting Footprint contains only pixels for which (mask & bitMask) == 0; it may have disjoint pieces. Any part of the footprint that falls outside the bounds of the mask will be clipped.
|
inlinevirtual |
Is this a HeavyFootprint?
Reimplemented in lsst.afw.detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >.
Definition at line 106 of file Footprint.h.
|
inline |
Definition at line 234 of file Footprint.h.
|
inlinevirtual |
Return true if this particular object can be persisted using afw::table::io.
Reimplemented from lsst.afw.table.io::Persistable.
Definition at line 322 of file Footprint.h.
void lsst.afw.detection::Footprint::normalize | ( | ) |
Normalise a Footprint, sorting spans and setting the BBox
Assignment operator. Will not change the id
|
protected |
Persistence implementation functions made available for derived classes.
|
protected |
Persistence implementation functions made available for derived classes.
|
inline |
Set the Schema used by the PeakCatalog (will throw if PeakCatalog is not empty).
Definition at line 137 of file Footprint.h.
|
inline |
Set the corners of the MaskedImage wherein the footprints dwell.
Definition at line 212 of file Footprint.h.
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
|
inline |
Definition at line 203 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.
boost::shared_ptr< Footprint > lsst.afw.detection::Footprint::transform | ( | image::Wcs const & | source, |
image::Wcs const & | target, | ||
geom::Box2I const & | region, | ||
bool | doClip = true |
||
) | const |
Transform the footprint from one WCS to another.
[in] | source | Wcs that defines the coordinate system of the input footprint. |
[in] | target | Wcs that defines that desired coordinate system of the returned footprint. |
[in] | region | Used to set the "region" box of the returned footprint; note that this is NOT the same as the footprint's bounding box. |
[in] | doClip | If true, clip the new footprint to the region bbox before returning it. |
|
protectedvirtual |
Write the object to one or more catalogs.
The handle object passed to this function provides an interface for adding new catalogs and adding nested objects to the same archive (while checking for duplicates). See OutputArchiveHandle for more information.
Reimplemented from lsst.afw.table.io::Persistable.
Reimplemented in lsst.afw.detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >.
|
friend |
Definition at line 338 of file Footprint.h.
|
friend |
Definition at line 342 of file Footprint.h.
|
private |
number of pixels in this Footprint (not the area of the bbox)
Definition at line 346 of file Footprint.h.
|
private |
the Footprint's bounding box
Definition at line 349 of file Footprint.h.
|
mutableprivate |
unique ID
Definition at line 345 of file Footprint.h.
|
private |
Are the spans sorted?
Definition at line 352 of file Footprint.h.
|
private |
the Peaks lying in this footprint
Definition at line 350 of file Footprint.h.
|
mutableprivate |
The corners of the MaskedImage the footprints live in.
Definition at line 351 of file Footprint.h.
|
private |
the Spans contained in this Footprint
Definition at line 348 of file Footprint.h.
|
staticprivate |
Definition at line 344 of file Footprint.h.