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
|
#include <Convolve.h>
Public Types | |
enum | Location { BOTTOM_LEFT, BOTTOM_RIGHT, TOP_LEFT, TOP_RIGHT } |
typedef boost::shared_ptr < lsst::afw::math::Kernel const > | KernelConstPtr |
typedef lsst::afw::image::Image < lsst::afw::math::Kernel::Pixel > | Image |
typedef boost::shared_ptr< Image > | ImagePtr |
typedef boost::shared_ptr < Image const > | ImageConstPtr |
typedef boost::shared_ptr < KernelImagesForRegion const > | ConstPtr |
typedef boost::shared_ptr < KernelImagesForRegion > | Ptr |
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 Types inherited from lsst::daf::base::Persistable | |
typedef boost::shared_ptr < Persistable > | Ptr |
Public Member Functions | |
KernelImagesForRegion (KernelConstPtr kernelPtr, lsst::afw::geom::Box2I const &bbox, lsst::afw::geom::Point2I const &xy0, bool doNormalize) | |
KernelImagesForRegion (KernelConstPtr kernelPtr, lsst::afw::geom::Box2I const &bbox, lsst::afw::geom::Point2I const &xy0, bool doNormalize, ImagePtr bottomLeftImagePtr, ImagePtr bottomRightImagePtr, ImagePtr topLeftImagePtr, ImagePtr topRightImagePtr) | |
lsst::afw::geom::Box2I | getBBox () const |
lsst::afw::geom::Point2I | getXY0 () const |
bool | getDoNormalize () const |
ImagePtr | getImage (Location location) const |
KernelConstPtr | getKernel () const |
lsst::afw::geom::Point2I | getPixelIndex (Location location) const |
bool | computeNextRow (RowOfKernelImagesForRegion ®ionRow) const |
Compute next row of subregions. 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::daf::base::Persistable | |
Persistable (void) | |
virtual | ~Persistable (void) |
template<class Archive > | |
void | serialize (Archive &, unsigned int const) |
Static Public Member Functions | |
static int | getMinInterpolationSize () |
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... | |
Private Types | |
typedef std::vector< Location > | LocationList |
Private Member Functions | |
void | _computeImage (Location location) const |
void | _insertImage (Location location, ImagePtr imagePtr) const |
void | _moveUp (bool isFirst, int newHeight) |
Move the region up one segment. More... | |
Static Private Member Functions | |
static int | _computeNextSubregionLength (int length, int nDivisions) |
static std::vector< int > | _computeSubregionLengths (int length, int nDivisions) |
Private Attributes | |
KernelConstPtr | _kernelPtr |
lsst::afw::geom::Box2I | _bbox |
lsst::afw::geom::Point2I | _xy0 |
bool | _doNormalize |
std::vector< ImagePtr > | _imagePtrList |
Static Private Attributes | |
static int const | _MinInterpolationSize = 10 |
A collection of Kernel images for special locations on a rectangular region of an image
See the Location enum for a list of those special locations.
This is a low-level helper class for recursive convolving with interpolation. Many of these objects may be created during a convolution, and many will share kernel images. It uses shared pointers to kernels and kernel images for increased speed and decreased memory usage (at the expense of safety). Note that null pointers are NOT acceptable for the constructors!
Also note that it uses lazy evaluation: images are computed when they are wanted.
Definition at line 111 of file Convolve.h.
typedef boost::shared_ptr< KernelImagesForRegion const> lsst::afw::math::detail::KernelImagesForRegion::ConstPtr |
Definition at line 120 of file Convolve.h.
typedef lsst::afw::image::Image<lsst::afw::math::Kernel::Pixel> lsst::afw::math::detail::KernelImagesForRegion::Image |
Definition at line 117 of file Convolve.h.
typedef boost::shared_ptr< Image const> lsst::afw::math::detail::KernelImagesForRegion::ImageConstPtr |
Definition at line 119 of file Convolve.h.
typedef boost::shared_ptr< Image > lsst::afw::math::detail::KernelImagesForRegion::ImagePtr |
Definition at line 118 of file Convolve.h.
typedef boost::shared_ptr< lsst::afw::math::Kernel const> lsst::afw::math::detail::KernelImagesForRegion::KernelConstPtr |
Definition at line 116 of file Convolve.h.
|
private |
Definition at line 178 of file Convolve.h.
typedef boost::shared_ptr< KernelImagesForRegion > lsst::afw::math::detail::KernelImagesForRegion::Ptr |
Definition at line 121 of file Convolve.h.
locations of various points in the region
RIGHT and TOP are one column/row beyond the region's bounding box. Thus adjacent regions share corner images.
The posiitions are: BOTTOM_LEFT, BOTTOM_RIGHT, TOP_LEFT, TOP_RIGHT
These locations always refer to the center of a pixel. Thus if the region has an odd size along an axis (so that the span to the top and right, which are one beyond, is even), the middle pixel will be 1/2 pixel off from the true center along that axis (in an unspecified direction).
Enumerator | |
---|---|
BOTTOM_LEFT | |
BOTTOM_RIGHT | |
TOP_LEFT | |
TOP_RIGHT |
Definition at line 136 of file Convolve.h.
lsst::afw::math::detail::KernelImagesForRegion::KernelImagesForRegion | ( | KernelConstPtr | kernelPtr, |
lsst::afw::geom::Box2I const & | bbox, | ||
lsst::afw::geom::Point2I const & | xy0, | ||
bool | doNormalize | ||
) |
Construct a KernelImagesForRegion
lsst::pex::exceptions::InvalidParameterError | if kernelPtr is null |
kernelPtr | kernel |
bbox | bounding box of region of an image for which we want to compute kernel images (inclusive and relative to parent image) |
xy0 | xy0 of image for which we want to compute kernel images |
doNormalize | normalize the kernel images? |
Definition at line 59 of file KernelImagesForRegion.cc.
lsst::afw::math::detail::KernelImagesForRegion::KernelImagesForRegion | ( | KernelConstPtr | kernelPtr, |
lsst::afw::geom::Box2I const & | bbox, | ||
lsst::afw::geom::Point2I const & | xy0, | ||
bool | doNormalize, | ||
ImagePtr | bottomLeftImagePtr, | ||
ImagePtr | bottomRightImagePtr, | ||
ImagePtr | topLeftImagePtr, | ||
ImagePtr | topRightImagePtr | ||
) |
Construct a KernelImagesForRegion with some or all corner images
Null corner image pointers are ignored.
lsst::pex::exceptions::InvalidParameterError | if kernelPtr is null |
lsst::pex::exceptions::InvalidParameterError | if an image has the wrong dimensions |
kernelPtr | kernel |
bbox | bounding box of region of an image for which we want to compute kernel images (inclusive and relative to parent image) |
xy0 | xy0 of image |
doNormalize | normalize the kernel images? |
bottomLeftImagePtr | kernel image and sum at bottom left of region |
bottomRightImagePtr | kernel image and sum at bottom right of region |
topLeftImagePtr | kernel image and sum at top left of region |
topRightImagePtr | kernel image and sum at top right of region |
Definition at line 92 of file KernelImagesForRegion.cc.
|
private |
Compute image at a particular location
lsst::pex::exceptions::NotFoundError | if there is no pointer at that location |
Definition at line 250 of file KernelImagesForRegion.cc.
|
inlinestaticprivate |
Compute length of next subregion if the region is to be divided into pieces of approximately equal length.
length | length of region |
nDivisions | number of divisions of region |
Definition at line 304 of file Convolve.h.
|
staticprivate |
Compute length of each subregion for a region divided into nDivisions pieces of approximately equal length.
lsst::pex::exceptions::InvalidParameterError | if nDivisions >= length |
length | length of region |
nDivisions | number of divisions of region |
Definition at line 274 of file KernelImagesForRegion.cc.
|
inlineprivate |
Insert an image in the cache.
lsst::pex::exceptions::InvalidParameterError | if image pointer is null |
lsst::pex::exceptions::InvalidParameterError | if image has the wrong dimensions |
location | location at which to insert image |
imagePtr | image to insert |
Definition at line 318 of file Convolve.h.
|
private |
Move the region up one segment.
To avoid reallocating memory for kernel images, swap the top and bottom kernel image pointers and recompute the top images. Actually, only does this to the right-hande images if isFirst is false since it assumes the left images were already handled.
Intended to support computeNextRow; as such assumes that a list of adjacent regions will be moved, left to right.
isFirst | true if the first region in a row (or the only region you are moving) |
newHeight | new height of region |
Definition at line 309 of file KernelImagesForRegion.cc.
bool lsst::afw::math::detail::KernelImagesForRegion::computeNextRow | ( | RowOfKernelImagesForRegion & | regionRow | ) | const |
Compute next row of subregions.
For the first row call with a new RowOfKernelImagesForRegion (with the desired number of columns and rows). Every subequent call updates the data in the RowOfKernelImagesForRegion.
regionRow | RowOfKernelImagesForRegion object |
Definition at line 177 of file KernelImagesForRegion.cc.
|
inline |
Get the bounding box for the region
Definition at line 158 of file Convolve.h.
|
inline |
Get the doNormalize parameter
Definition at line 166 of file Convolve.h.
mathDetail::KernelImagesForRegion::ImagePtr lsst::afw::math::detail::KernelImagesForRegion::getImage | ( | Location | location | ) | const |
Return the image and sum at the specified location
If the image has not yet been computed, it is computed at this time.
location | location of image |
Definition at line 128 of file KernelImagesForRegion.cc.
|
inline |
Get the kernel (as a shared pointer to const)
Definition at line 171 of file Convolve.h.
|
inlinestatic |
Get the minInterpolationSize class constant
Definition at line 178 of file Convolve.h.
lsst::afw::geom::Point2I lsst::afw::math::detail::KernelImagesForRegion::getPixelIndex | ( | Location | location | ) | const |
Compute pixel index of a given location, relative to the parent image (thus offset by bottom left corner of bounding box)
location | location for which to return pixel index |
Definition at line 145 of file KernelImagesForRegion.cc.
|
inline |
Get xy0 of the image
Definition at line 162 of file Convolve.h.
|
private |
Definition at line 192 of file Convolve.h.
|
private |
Definition at line 194 of file Convolve.h.
|
mutableprivate |
Definition at line 195 of file Convolve.h.
|
private |
Definition at line 191 of file Convolve.h.
|
staticprivate |
Definition at line 197 of file Convolve.h.
|
private |
Definition at line 193 of file Convolve.h.