A functor class to allow users to process all the pixels in a Footprint.
More...
#include <FootprintFunctor.h>
template<typename ImageT>
class lsst::afw::detection::FootprintFunctor< ImageT >
A functor class to allow users to process all the pixels in a Footprint.
There's an annotated example of a FootprintFunctor in action FootprintFunctors here
- Examples:
- footprintFunctor.cc.
Definition at line 40 of file FootprintFunctor.h.
template<typename ImageT >
- Parameters
-
image | The image that the Footprint lives in |
Definition at line 42 of file FootprintFunctor.h.
table::Key< table::Array< Kernel::Pixel > > image
template<typename ImageT >
Although FootprintFunctor is pure virtual, this is needed by subclasses
It wasn't defined in the class body as I want swig to know that the class is pure virtual
Definition at line 137 of file FootprintFunctor.h.
template<typename ImageT >
Apply operator() to each pixel in the Footprint.
- Parameters
-
foot | The Footprint in question |
margin | The required margin from the edge of the image |
Definition at line 57 of file FootprintFunctor.h.
63 if (foot.getSpans().empty()) {
72 lsst::pex::exceptions::LengthError,
74 "doesn't fit in image with BBox (%d,%d) -- (%dx%d)"
89 typename ImageT::xy_locator loc =
_image.xy_at(-x0, -y0);
93 for (Footprint::SpanList::const_iterator siter = foot.getSpans().begin();
94 siter != foot.getSpans().end(); siter++) {
95 Span::Ptr
const span = *siter;
97 int const y = span->getY();
98 if (y - y0 < margin || y - y0 >= height - margin) {
101 int sx0 = span->getX0();
102 int sx1 = span->getX1();
103 if (sx0 - x0 < margin) {
106 if (sx1 - x0 >= width - margin) {
107 sx1 = width + x0 - margin - 1;
110 loc += lsst::afw::image::pair2I(sx0 - ox1, y - oy);
112 for (
int x = sx0;
x <= sx1; ++
x, ++loc.x()) {
116 ox1 = sx1 + 1; oy =
y;
bool contains(Point2I const &point) const
Return true if the box contains the point.
Point2I const getMax() const
An integer coordinate rectangle.
void ImageT ImageT int float saturatedPixelValue int const width
bool isEmpty() const
Return true if the box contains no points.
void ImageT ImageT int float saturatedPixelValue int const height
#define LSST_EXCEPT(type,...)
Point2I const getMin() const
template<typename ImageT >
template<typename ImageT >
The operator to be applied to each pixel in the Footprint.
N.b. the coordinates (x, y) are relative to the origin of the image's parent if it exists (i.e. they obey getX0/getY0)
template<typename ImageT >
A function that's called at the beginning of apply; useful if apply calculates a per-footprint quantity
Definition at line 51 of file FootprintFunctor.h.
template<typename ImageT >
template<typename ImageT >
The documentation for this class was generated from the following file:
- /home/lsstsw/stack/Linux64/afw/11.0-2-g04d2804/include/lsst/afw/detection/FootprintFunctor.h