| LSSTApplications
    20.0.0
    LSSTDataManagementBasePackage | 
 
 
 
Go to the documentation of this file.
   49 template <
typename OutImageT, 
typename InImageT>
 
   52     if (outImage.getDimensions() != inImage.getDimensions()) {
 
   54         os << 
"outImage dimensions = ( " << outImage.getWidth() << 
", " << outImage.getHeight() << 
") != (" 
   55            << inImage.getWidth() << 
", " << inImage.getHeight() << 
") = inImage dimensions";
 
   65     LOGL_DEBUG(
"TRACE5.afw.math.convolve.convolveWithInterpolation",
 
   66                "convolveWithInterpolation: full bbox minimum=(%d, %d), extent=(%d, %d)", fullBBox.
getMinX(),
 
   68     LOGL_DEBUG(
"TRACE5.afw.math.convolve.convolveWithInterpolation",
 
   69                "convolveWithInterpolation: goodRegion bbox minimum=(%d, %d), extent=(%d, %d)",
 
   76     LOGL_DEBUG(
"TRACE3.afw.math.convolve.convolveWithInterpolation",
 
   77                "convolveWithInterpolation: divide into %d x %d subregions", nx, ny);
 
   83              rgnIter != rgnEnd; ++rgnIter) {
 
   84             LOGL_DEBUG(
"TRACE5.afw.math.convolve.convolveWithInterpolation",
 
   85                        "convolveWithInterpolation: bbox minimum=(%d, %d), extent=(%d, %d)",
 
   86                        (*rgnIter)->getBBox().getMinX(), (*rgnIter)->getBBox().getMinY(),
 
   87                        (*rgnIter)->getBBox().getWidth(), (*rgnIter)->getBBox().getHeight());
 
   93 template <
typename OutImageT, 
typename InImageT>
 
   97     typedef typename OutImageT::xy_locator OutLocator;
 
   98     typedef typename InImageT::const_xy_locator InConstLocator;
 
  100     typedef KernelImage::const_xy_locator KernelConstLocator;
 
  113     double xfrac = 1.0 / 
static_cast<double>(goodBBox.
getWidth());
 
  114     double yfrac = 1.0 / 
static_cast<double>(goodBBox.
getHeight());
 
  120     KernelConstLocator 
const kernelLocator = workingImages.
kernelImage.
xy_at(0, 0);
 
  126     InConstLocator inLocator = inImage.xy_at(fullBBox.
getMinX(), fullBBox.
getMinY());
 
  127     OutLocator outLocator = outImage.xy_at(goodBBox.
getMinX(), goodBBox.
getMinY());
 
  129         auto inLocatorInitialPosition = inLocator;
 
  130         auto outLocatorInitialPosition = outLocator;
 
  134             *outLocator = math::convolveAtAPoint<OutImageT, InImageT>(
 
  135                     inLocator, kernelLocator, kernelDimensions.getX(), kernelDimensions.getY());
 
  157         inLocator = inLocatorInitialPosition;
 
  158         outLocator = outLocatorInitialPosition;
 
  168 #define IMAGE(PIXTYPE) image::Image<PIXTYPE> 
  169 #define MASKEDIMAGE(PIXTYPE) image::MaskedImage<PIXTYPE, image::MaskPixel, image::VariancePixel> 
  172 #define INSTANTIATE_IM_OR_MI(IMGMACRO, OUTPIXTYPE, INPIXTYPE)                                             \ 
  173     template void convolveWithInterpolation(IMGMACRO(OUTPIXTYPE) &, IMGMACRO(INPIXTYPE) const &,          \ 
  174                                             math::Kernel const &, math::ConvolutionControl const &);      \ 
  175     NL template void convolveRegionWithInterpolation(IMGMACRO(OUTPIXTYPE) &, IMGMACRO(INPIXTYPE) const &, \ 
  176                                                      KernelImagesForRegion const &,                       \ 
  177                                                      ConvolveWithInterpolationWorkingImages &); 
  179 #define INSTANTIATE(OUTPIXTYPE, INPIXTYPE)             \ 
  180     INSTANTIATE_IM_OR_MI(IMAGE, OUTPIXTYPE, INPIXTYPE) \ 
  181     INSTANTIATE_IM_OR_MI(MASKEDIMAGE, OUTPIXTYPE, INPIXTYPE) 
  
void assign(ImageBase const &rhs, lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT)
Copy pixels from another image to a specified subregion of this image.
A row of KernelImagesForRegion.
lsst::geom::Extent2I const getDimensions() const
Return the Kernel's dimensions (width, height)
void scaledPlus(OutImageT &outImage, double c1, InImageT const &inImage1, double c2, InImageT const &inImage2)
Compute the scaled sum of two images.
int getHeight() const noexcept
lsst::geom::Box2I getBBox() const
Get the bounding box for the region.
KernelConstPtr getKernel() const
Get the kernel (as a shared pointer to const)
int getMaxInterpolationDistance() const
virtual std::shared_ptr< Kernel > clone() const =0
Return a pointer to a deep copy of this kernel.
kernel images used by convolveRegionWithInterpolation
#define INSTANTIATE(FROMSYS, TOSYS)
int getWidth() const noexcept
RegionList::const_iterator end() const
Return the end iterator for the list.
xy_locator xy_at(int x, int y) const
Return an xy_locator at the point (x, y) in the image.
RegionList::const_iterator ConstIterator
bool getDoNormalize() const
RegionList::const_iterator begin() const
Return the begin iterator for the list.
lsst::geom::Box2I shrinkBBox(lsst::geom::Box2I const &bbox) const
Given a bounding box for an image one wishes to convolve with this kernel, return the bounding box fo...
A base class for image defects.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
ImagePtr getImage(Location location) const
Return the image and sum at the specified location.
bool computeNextRow(RowOfKernelImagesForRegion ®ionRow) const
Compute next row of subregions.
Parameters to control convolution.
Reports invalid arguments.
#define LOGL_DEBUG(logger, message...)
An integer coordinate rectangle.
A collection of Kernel images for special locations on a rectangular region of an image.
int getMinX() const noexcept
Kernels are used for convolution with MaskedImages and (eventually) Images.
LSST DM logging module built on log4cxx.
void convolveRegionWithInterpolation(OutImageT &outImage, InImageT const &inImage, KernelImagesForRegion const ®ion, ConvolveWithInterpolationWorkingImages &workingImages)
Convolve a region of an Image or MaskedImage with a spatially varying Kernel using interpolation.
int getMinY() const noexcept
void convolveWithInterpolation(OutImageT &outImage, InImageT const &inImage, lsst::afw::math::Kernel const &kernel, ConvolutionControl const &convolutionControl)
Convolve an Image or MaskedImage with a spatially varying Kernel using linear interpolation.