Class FootprintSet

Class Documentation

class FootprintSet

A set of Footprints, associated with a MaskedImage

Public Types

typedef std::vector<std::shared_ptr<Footprint>> FootprintList

The FootprintSet’s set of Footprints.

Public Functions

template<typename ImagePixelT>
FootprintSet(image::Image<ImagePixelT> const &img, Threshold const &threshold, int const npixMin = 1, bool const setPeaks = true)

Find a FootprintSet given an Image and a threshold

Parameters
  • img: Image to search for objects

  • threshold: threshold to find objects

  • npixMin: minimum number of pixels in an object

  • setPeaks: should I set the Peaks list?

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

Parameters
  • img: Image to search for objects

  • threshold: threshold to find objects

  • npixMin: minimum number of pixels in an object

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

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
  • img: MaskedImage to search for objects

  • threshold: threshold for footprints (controls size)

  • planeName: mask plane to set (if != “”)

  • npixMin: minimum number of pixels in an object

  • setPeaks: should I set the Peaks list?

FootprintSet(lsst::geom::Box2I region)

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

Parameters
  • region: the desired region

FootprintSet(FootprintSet const &rhs)

Copy constructor

Parameters

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

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

Note

Isotropic grows are significantly slower

Parameters
  • set: the input FootprintSet

  • rGrow: Grow Footprints by r pixels

  • isotropic: Grow isotropically (as opposed to a Manhattan metric)

FootprintSet(FootprintSet const &footprints1, FootprintSet const &footprints2, bool const includePeaks)

Return the FootprintSet corresponding to the merge of two input FootprintSets

FootprintSet &operator=(FootprintSet const &rhs)

Assignment operator.

FootprintSet &operator=(FootprintSet &&rhs)
void swap(FootprintSet &rhs)
void swapFootprintList(FootprintList &rhs)
std::shared_ptr<FootprintList> getFootprints()

: 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.

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

Parameters
  • [inout] catalog: Catalog to append new sources to.

void setRegion(lsst::geom::Box2I const &region)

Set the corners of the FootprintSet’s MaskedImage to region

Note

updates all the Footprints’ regions too

Parameters
  • region: desired 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

Return

an std::shared_ptr<image::Image>

template<typename MaskPixelT>
void setMask(image::Mask<MaskPixelT> *mask, std::string const &planeName)

Parameters
  • mask: Set bits in the mask

  • planeName: Here’s the name of the mask plane to fit

template<typename MaskPixelT>
void setMask(std::shared_ptr<image::Mask<MaskPixelT>> mask, std::string const &planeName)

Parameters
  • mask: Set bits in the mask

  • planeName: Here’s the name of the mask plane to fit

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

Merge a FootprintSet into *this

Parameters
  • rhs: the Footprints to merge

  • tGrow: No. of pixels to grow this Footprints

  • rGrow: No. of pixels to grow rhs Footprints

  • isotropic: Use (expensive) isotropic grow

template<typename ImagePixelT, typename MaskPixelT>
void makeHeavy(image::MaskedImage<ImagePixelT, MaskPixelT> const &mimg, HeavyFootprintCtrl const *ctrl = NULL)

Convert all the Footprints in the FootprintSet to be HeavyFootprints

Parameters
  • mimg: the image providing pixel values

  • ctrl: Control how we manipulate HeavyFootprints