LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT > Class Template Reference

A set of pixels in an Image, including those pixels' actual values. More...

#include <HeavyFootprint.h>

Inheritance diagram for lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >:
lsst::afw::table::io::PersistableFacade< HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT > > lsst::afw::detection::Footprint lsst::daf::base::Citizen lsst::afw::table::io::PersistableFacade< lsst::afw::detection::Footprint > lsst::afw::table::io::Persistable

Public Member Functions

 HeavyFootprint (Footprint const &foot, lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const &mimage, HeavyFootprintCtrl const *ctrl=NULL)
 
 HeavyFootprint (Footprint const &foot, HeavyFootprintCtrl const *ctrl=NULL)
 
virtual bool isHeavy () const
 
void insert (lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > &mimage) const
 
void insert (lsst::afw::image::Image< ImagePixelT > &image) const
 
ndarray::Array< ImagePixelT, 1, 1 > getImageArray ()
 
ndarray::Array< MaskPixelT, 1, 1 > getMaskArray ()
 
ndarray::Array< VariancePixelT, 1, 1 > getVarianceArray ()
 
ndarray::Array< ImagePixelT
const, 1, 1 > 
getImageArray () const
 
ndarray::Array< MaskPixelT
const, 1, 1 > 
getMaskArray () const
 
ndarray::Array< VariancePixelT
const, 1, 1 > 
getVarianceArray () const
 
MaskPixelT getMaskBitsSet () const
 
double dot (HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT > const &other) const
 
- Public Member Functions inherited from lsst::afw::detection::Footprint
 Footprint (int nspan=0, geom::Box2I const &region=geom::Box2I())
 
 Footprint (afw::table::Schema const &peakSchema, int nspan=0, geom::Box2I const &region=geom::Box2I())
 
 Footprint (geom::Box2I const &bbox, geom::Box2I const &region=geom::Box2I())
 
 Footprint (geom::Point2I const &center, double const radius, geom::Box2I const &=geom::Box2I())
 
 Footprint (geom::ellipses::Ellipse const &ellipse, geom::Box2I const &region=geom::Box2I())
 
 Footprint (SpanList const &spans, geom::Box2I const &region=geom::Box2I())
 
 Footprint (Footprint const &other)
 
virtual ~Footprint ()
 
int getId () const
 
SpanListgetSpans ()
 
const SpanListgetSpans () const
 
PeakCataloggetPeaks ()
 
const PeakCataloggetPeaks () const
 
boost::shared_ptr< PeakRecordaddPeak (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 &region)
 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 &region=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 &region=geom::Box2I()) const
 
Footprintoperator= (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< Footprinttransform (image::Wcs const &source, image::Wcs const &target, geom::Box2I const &region, bool doClip=true) const
 Transform the footprint from one WCS to another. More...
 
boost::shared_ptr< FootprintfindEdgePixels () 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 ()
 
Citizenoperator= (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 void write (OutputArchiveHandle &handle) const
 Write the object to one or more catalogs. More...
 
- Protected Member Functions inherited from lsst::afw::detection::Footprint
virtual std::string getPythonModule () const
 Return the fully-qualified Python module that should be imported to guarantee that its factory is registered. 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 Member Functions

 HeavyFootprint ()
 

Private Attributes

ndarray::Array< ImagePixelT, 1, 1 > _image
 
ndarray::Array< MaskPixelT, 1, 1 > _mask
 
ndarray::Array< VariancePixelT, 1, 1 > _variance
 

Additional Inherited Members

- Public Types inherited from lsst::afw::detection::Footprint
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)
 
- Static Public Member Functions inherited from lsst::afw::table::io::PersistableFacade< HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT > >
static boost::shared_ptr
< HeavyFootprint< ImagePixelT,
MaskPixelT, VariancePixelT > > 
readFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 
static boost::shared_ptr
< HeavyFootprint< ImagePixelT,
MaskPixelT, VariancePixelT > > 
readFits (std::string const &fileName, int hdu=0)
 Read an object from a regular FITS file. More...
 
static boost::shared_ptr
< HeavyFootprint< ImagePixelT,
MaskPixelT, VariancePixelT > > 
readFits (fits::MemFileManager &manager, int hdu=0)
 Read an object from a FITS file in memory. More...
 
- 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
 

Detailed Description

template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
class lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >

A set of pixels in an Image, including those pixels' actual values.

Definition at line 50 of file HeavyFootprint.h.

Constructor & Destructor Documentation

template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::HeavyFootprint ( Footprint const &  foot,
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const &  mimage,
HeavyFootprintCtrl const *  ctrl = NULL 
)
explicit

Create a HeavyFootprint from a regular Footprint and the image that provides the pixel values

Note
: the HeavyFootprintCtrl is passed by const* not const& so that we needn't provide a definition in the header.

foot: The Footprint defining the pixels to set mimage: The pixel values ctrl: Control how we manipulate HeavyFootprints

template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::HeavyFootprint ( Footprint const &  foot,
HeavyFootprintCtrl const *  ctrl = NULL 
)
explicit

Create a HeavyFootprint from a regular Footprint, allocating space to hold foot.getArea() pixels, but not initializing them. This is used when unpersisting a HeavyFootprint.

template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::HeavyFootprint ( )
inlineprivate

Definition at line 127 of file HeavyFootprint.h.

127 {} // private constructor, only used for persistence.

Member Function Documentation

template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
double lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::dot ( HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT > const &  other) const

Dot product between HeavyFootprints

The mask and variance planes are ignored.

template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
ndarray::Array<ImagePixelT,1,1> lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::getImageArray ( )
inline

Definition at line 96 of file HeavyFootprint.h.

96 { return _image; }
ndarray::Array< ImagePixelT, 1, 1 > _image
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
ndarray::Array<ImagePixelT const,1,1> lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::getImageArray ( ) const
inline

Definition at line 100 of file HeavyFootprint.h.

100 { return _image; }
ndarray::Array< ImagePixelT, 1, 1 > _image
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
ndarray::Array<MaskPixelT,1,1> lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::getMaskArray ( )
inline

Definition at line 97 of file HeavyFootprint.h.

97 { return _mask; }
ndarray::Array< MaskPixelT, 1, 1 > _mask
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
ndarray::Array<MaskPixelT const,1,1> lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::getMaskArray ( ) const
inline

Definition at line 101 of file HeavyFootprint.h.

101 { return _mask; }
ndarray::Array< MaskPixelT, 1, 1 > _mask
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
MaskPixelT lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::getMaskBitsSet ( ) const
inline

Definition at line 105 of file HeavyFootprint.h.

105  {
106  MaskPixelT maskbits = 0;
107  for (typename ndarray::Array<MaskPixelT,1,1>::Iterator i = _mask.begin(); i != _mask.end(); ++i) {
108  maskbits |= *i;
109  }
110  return maskbits;
111  }
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
ExpressionTraits< Derived >::Iterator Iterator
Nested expression or element iterator.
ndarray::Array< MaskPixelT, 1, 1 > _mask
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
virtual std::string lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::getPersistenceName ( ) const
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::detection::Footprint.

template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
ndarray::Array<VariancePixelT,1,1> lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::getVarianceArray ( )
inline

Definition at line 98 of file HeavyFootprint.h.

98 { return _variance; }
ndarray::Array< VariancePixelT, 1, 1 > _variance
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
ndarray::Array<VariancePixelT const,1,1> lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::getVarianceArray ( ) const
inline

Definition at line 102 of file HeavyFootprint.h.

102 { return _variance; }
ndarray::Array< VariancePixelT, 1, 1 > _variance
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
void lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::insert ( lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > &  mimage) const

Replace all the pixels in the image with the values in the HeavyFootprint.

template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
void lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::insert ( lsst::afw::image::Image< ImagePixelT > &  image) const

Replace all the pixels in the image with the values in the HeavyFootprint.

template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
virtual bool lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::isHeavy ( ) const
inlinevirtual

Is this a HeavyFootprint (yes!)

Reimplemented from lsst::afw::detection::Footprint.

Definition at line 84 of file HeavyFootprint.h.

84 { return true; }
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
virtual void lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::write ( OutputArchiveHandle handle) const
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::detection::Footprint.

Member Data Documentation

template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
ndarray::Array<ImagePixelT, 1, 1> lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::_image
private

Definition at line 129 of file HeavyFootprint.h.

template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
ndarray::Array<MaskPixelT, 1, 1> lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::_mask
private

Definition at line 130 of file HeavyFootprint.h.

template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
ndarray::Array<VariancePixelT, 1, 1> lsst::afw::detection::HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT >::_variance
private

Definition at line 131 of file HeavyFootprint.h.


The documentation for this class was generated from the following file: