LSST Applications g063fba187b+66a50001ff,g0f08755f38+1a22dc2551,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g217e2c1bcf+12e87a5bd8,g246886dfd9+466c7b6c06,g28da252d5a+858b171e04,g2bbee38e9b+404b60ec9b,g2bc492864f+404b60ec9b,g3156d2b45e+6e55a43351,g347aa1857d+404b60ec9b,g35bb328faa+a8ce1bb630,g3a166c0a6a+404b60ec9b,g3e281a1b8c+c5dd892a6c,g414038480c+6b9177ef31,g41af890bb2+70bea58702,g599934f4f4+b8c5400ca5,g781aacb6e4+a8ce1bb630,g7af13505b9+b5b9cefdb8,g80478fca09+c2997882f3,g82479be7b0+8974e6af0f,g858d7b2824+1a22dc2551,g89c8672015+f4add4ffd5,g8f1c07a47a+de51c9b0a5,g9125e01d80+a8ce1bb630,ga5288a1d22+b66f8cf76b,gb58c049af0+d64f4d3760,gc28159a63d+404b60ec9b,gcab2d0539d+66cf1de5d4,gcf0d15dbbd+12cb7e2563,gda6a2b7d83+12cb7e2563,gdaeeff99f8+1711a396fd,ge79ae78c31+404b60ec9b,gef2f8181fd+414189b318,gf0baf85859+c1f95f4921,gf0c06eb49c+1a22dc2551,gfa517265be+1a22dc2551,gfa999e8aa5+17cd334064,v28.0.0.rc2
LSST Data Management Base Package
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > Class Template Reference

A class to manipulate images, masks, and variance as a single object. More...

#include <MaskedImage.h>

Classes

class  const_MaskedImageIterator
 An const iterator to the MaskedImage. More...
 
class  const_MaskedImageLocator
 A const locator for the MaskedImage. More...
 
struct  ImageTypeFactory
 A templated class to return this classes' type (present in Image/Mask/MaskedImage) More...
 
class  MaskedImageIterator
 An iterator to the MaskedImage. More...
 
class  MaskedImageIteratorBase
 The base class for MaskedImageIterators (const and non-const) More...
 
class  MaskedImageLocator
 A locator for the MaskedImage. More...
 
class  MaskedImageLocatorBase
 The base class for MaskedImageLocators (const and non-const) More...
 

Public Types

using ImagePtr = std::shared_ptr<image::Image<ImagePixelT>>
 shared pointer to the Image
 
using MaskPtr = std::shared_ptr<image::Mask<MaskPixelT>>
 shared pointer to the Mask
 
using VariancePtr = std::shared_ptr<image::Image<VariancePixelT>>
 shared pointer to the variance Image
 
using MaskPlaneDict = typename Mask<MaskPixelT>::MaskPlaneDict
 The Mask's MaskPlaneDict.
 
using Variance = lsst::afw::image::Image<VariancePixelT>
 
using Image = lsst::afw::image::Image<ImagePixelT>
 
using Mask = lsst::afw::image::Mask<MaskPixelT>
 
using image_category = detail::MaskedImage_tag
 
using Pixel = lsst::afw::image::pixel::Pixel<ImagePixelT, MaskPixelT, VariancePixelT>
 A Pixel in the MaskedImage.
 
using SinglePixel = lsst::afw::image::pixel::SinglePixel<ImagePixelT, MaskPixelT, VariancePixelT>
 A single Pixel of the same type as those in the MaskedImage.
 
using iterator = MaskedImageIterator<typename Image::iterator, typename Mask::iterator, typename Variance::iterator>
 
using const_iterator = const_MaskedImageIterator<typename Image::iterator, typename Mask::iterator, typename Variance::iterator>
 
using reverse_iterator = MaskedImageIterator<typename Image::reverse_iterator, typename Mask::reverse_iterator, typename Variance::reverse_iterator>
 
using x_iterator = MaskedImageIterator<typename Image::x_iterator, typename Mask::x_iterator, typename Variance::x_iterator>
 An iterator to a row of a MaskedImage.
 
using const_x_iterator = const_MaskedImageIterator<typename Image::x_iterator, typename Mask::x_iterator, typename Variance::x_iterator>
 A const_iterator to a row of a MaskedImage.
 
using fast_iterator = x_iterator
 A fast STL compliant iterator for contiguous images N.b.
 
using y_iterator = MaskedImageIterator<typename Image::y_iterator, typename Mask::y_iterator, typename Variance::y_iterator>
 An iterator to a column of a MaskedImage.
 
using const_y_iterator = const_MaskedImageIterator<typename Image::y_iterator, typename Mask::y_iterator, typename Variance::y_iterator>
 A const_iterator to a column of a MaskedImage.
 
using xy_locator = MaskedImageLocator<typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator>
 A locator for a MaskedImage.
 
using const_xy_locator = const_MaskedImageLocator<typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator>
 A const_locator for a MaskedImage.
 
using xy_x_iterator = typename MaskedImageLocator<typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator>::x_iterator
 an x_iterator associated with an xy_locator
 
using xy_y_iterator = typename MaskedImageLocator<typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator>::y_iterator
 an y_iterator associated with an xy_locator
 

Public Member Functions

 MaskedImage (unsigned int width, unsigned int height, MaskPlaneDict const &planeDict=MaskPlaneDict())
 Construct from a supplied dimensions.
 
 MaskedImage (lsst::geom::Extent2I const &dimensions=lsst::geom::Extent2I(), MaskPlaneDict const &planeDict=MaskPlaneDict())
 Construct from a supplied dimensions.
 
 MaskedImage (ImagePtr image, MaskPtr mask=MaskPtr(), VariancePtr variance=VariancePtr())
 Construct from a supplied Image and optional Mask and Variance.
 
 MaskedImage (lsst::geom::Box2I const &bbox, MaskPlaneDict const &planeDict=MaskPlaneDict())
 Create an MaskedImage of the specified size.
 
 MaskedImage (std::string const &fileName, std::shared_ptr< daf::base::PropertySet > metadata=std::shared_ptr< daf::base::PropertySet >(), lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false, bool needAllHdus=false, std::shared_ptr< daf::base::PropertySet > imageMetadata=std::shared_ptr< daf::base::PropertySet >(), std::shared_ptr< daf::base::PropertySet > maskMetadata=std::shared_ptr< daf::base::PropertySet >(), std::shared_ptr< daf::base::PropertySet > varianceMetadata=std::shared_ptr< daf::base::PropertySet >(), bool allowUnsafe=false)
 Construct a MaskedImage by reading a regular FITS file.
 
 MaskedImage (fits::MemFileManager &manager, std::shared_ptr< daf::base::PropertySet > metadata=std::shared_ptr< daf::base::PropertySet >(), lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false, bool needAllHdus=false, std::shared_ptr< daf::base::PropertySet > imageMetadata=std::shared_ptr< daf::base::PropertySet >(), std::shared_ptr< daf::base::PropertySet > maskMetadata=std::shared_ptr< daf::base::PropertySet >(), std::shared_ptr< daf::base::PropertySet > varianceMetadata=std::shared_ptr< daf::base::PropertySet >(), bool allowUnsafe=false)
 Construct a MaskedImage by reading a FITS image in memory.
 
 MaskedImage (fits::Fits &fitsfile, std::shared_ptr< daf::base::PropertySet > metadata=std::shared_ptr< daf::base::PropertySet >(), lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false, bool needAllHdus=false, std::shared_ptr< daf::base::PropertySet > imageMetadata=std::shared_ptr< daf::base::PropertySet >(), std::shared_ptr< daf::base::PropertySet > maskMetadata=std::shared_ptr< daf::base::PropertySet >(), std::shared_ptr< daf::base::PropertySet > varianceMetadata=std::shared_ptr< daf::base::PropertySet >(), bool allowUnsafe=false)
 Construct a MaskedImage from an already-open FITS object.
 
 MaskedImage (MaskedImage const &rhs, bool const deep=false)
 Copy constructor; shallow, unless deep is true.
 
 MaskedImage (MaskedImage &&rhs)
 
 MaskedImage (MaskedImage const &rhs, lsst::geom::Box2I const &bbox, ImageOrigin const origin=PARENT, bool const deep=false)
 Copy constructor of the pixels specified by bbox; shallow, unless deep is true.
 
template<typename OtherPixelT >
 MaskedImage (MaskedImage< OtherPixelT, MaskPixelT, VariancePixelT > const &rhs, const bool deep)
 generalised copy constructor; defined here in the header so that the compiler can instantiate N(N-1)/2 conversions between N ImageBase types.
 
MaskedImageoperator= (MaskedImage const &rhs)
 Make the lhs use the rhs's pixels.
 
MaskedImageoperator= (MaskedImage &&rhs)
 
virtual ~MaskedImage ()=default
 
void swap (MaskedImage &rhs)
 
MaskedImageoperator= (Pixel const &rhs)
 Set the pixels in the MaskedImage to the rhs.
 
MaskedImageoperator= (SinglePixel const &rhs)
 Set the pixels in the MaskedImage to the rhs.
 
MaskedImage subset (lsst::geom::Box2I const &bbox, ImageOrigin origin=PARENT) const
 Return a subimage corresponding to the given box.
 
MaskedImage operator[] (lsst::geom::Box2I const &bbox) const
 Return a subimage corresponding to the given box (interpreted as PARENT coordinates).
 
void assign (MaskedImage const &rhs, lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT)
 Copy pixels from another masked image to a specified subregion of this masked image.
 
MaskedImageoperator+= (ImagePixelT const rhs)
 Add a scalar rhs to a MaskedImage.
 
MaskedImageoperator+= (MaskedImage const &rhs)
 Add a MaskedImage rhs to a MaskedImage.
 
MaskedImageoperator+= (lsst::afw::image::Image< ImagePixelT > const &rhs)
 
MaskedImageoperator+= (lsst::afw::math::Function2< double > const &function)
 
void scaledPlus (double const c, MaskedImage const &rhs)
 Add a scaled MaskedImage c*rhs to a MaskedImage.
 
MaskedImageoperator-= (ImagePixelT const rhs)
 Subtract a scalar rhs from a MaskedImage.
 
MaskedImageoperator-= (MaskedImage const &rhs)
 Subtract a MaskedImage rhs from a MaskedImage.
 
MaskedImageoperator-= (lsst::afw::image::Image< ImagePixelT > const &rhs)
 
MaskedImageoperator-= (lsst::afw::math::Function2< double > const &function)
 
void scaledMinus (double const c, MaskedImage const &rhs)
 Subtract a scaled MaskedImage c*rhs from a MaskedImage.
 
MaskedImageoperator*= (ImagePixelT const rhs)
 
MaskedImageoperator*= (MaskedImage const &rhs)
 
MaskedImageoperator*= (lsst::afw::image::Image< ImagePixelT > const &rhs)
 
void scaledMultiplies (double const c, MaskedImage const &rhs)
 
MaskedImageoperator/= (ImagePixelT const rhs)
 
MaskedImageoperator/= (MaskedImage const &rhs)
 
MaskedImageoperator/= (lsst::afw::image::Image< ImagePixelT > const &rhs)
 
void scaledDivides (double const c, MaskedImage const &rhs)
 
void writeFits (std::string const &fileName, std::shared_ptr< daf::base::PropertySet const > metadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > imageMetadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > maskMetadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > varianceMetadata=std::shared_ptr< daf::base::PropertySet const >()) const
 Write a MaskedImage to a regular FITS file.
 
void writeFits (fits::MemFileManager &manager, std::shared_ptr< daf::base::PropertySet const > metadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > imageMetadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > maskMetadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > varianceMetadata=std::shared_ptr< daf::base::PropertySet const >()) const
 Write a MaskedImage to a FITS RAM file.
 
void writeFits (fits::Fits &fitsfile, std::shared_ptr< daf::base::PropertySet const > metadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > imageMetadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > maskMetadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > varianceMetadata=std::shared_ptr< daf::base::PropertySet const >()) const
 Write a MaskedImage to a FITS file.
 
void writeFits (std::string const &fileName, fits::ImageWriteOptions const &imageOptions, fits::ImageWriteOptions const &maskOptions, fits::ImageWriteOptions const &varianceOptions, std::shared_ptr< daf::base::PropertySet const > metadata=nullptr, std::shared_ptr< daf::base::PropertySet const > imageMetadata=nullptr, std::shared_ptr< daf::base::PropertySet const > maskMetadata=nullptr, std::shared_ptr< daf::base::PropertySet const > varianceMetadata=nullptr) const
 Write a MaskedImage to a FITS file.
 
void writeFits (fits::MemFileManager &manager, fits::ImageWriteOptions const &imageOptions, fits::ImageWriteOptions const &maskOptions, fits::ImageWriteOptions const &varianceOptions, std::shared_ptr< daf::base::PropertySet const > metadata=nullptr, std::shared_ptr< daf::base::PropertySet const > imageMetadata=nullptr, std::shared_ptr< daf::base::PropertySet const > maskMetadata=nullptr, std::shared_ptr< daf::base::PropertySet const > varianceMetadata=nullptr) const
 Write a MaskedImage to a FITS file.
 
void writeFits (fits::Fits &fitsfile, fits::ImageWriteOptions const &imageOptions, fits::ImageWriteOptions const &maskOptions, fits::ImageWriteOptions const &varianceOptions, std::shared_ptr< daf::base::PropertySet const > metadata=nullptr, std::shared_ptr< daf::base::PropertySet const > imageMetadata=nullptr, std::shared_ptr< daf::base::PropertySet const > maskMetadata=nullptr, std::shared_ptr< daf::base::PropertySet const > varianceMetadata=nullptr) const
 Write a MaskedImage to a FITS file.
 
ImagePtr getImage () const
 Return a (shared_ptr to) the MaskedImage's image.
 
void setImage (Image const &other)
 Set the image plane's pixel values to those of another Image.
 
MaskPtr getMask () const
 Return a (shared_ptr to) the MaskedImage's mask.
 
void setMask (Mask const &other)
 Set the mask plane's pixel values to those of another Mask.
 
void setVariance (Variance const &other)
 Set the variance plane's pixel values to those of another Image.
 
VariancePtr getVariance () const
 Return a (shared_ptr to) the MaskedImage's variance.
 
int getWidth () const
 Return the number of columns in the image.
 
int getHeight () const
 Return the number of rows in the image.
 
lsst::geom::Extent2I getDimensions () const
 
lsst::geom::Box2I getBBox (ImageOrigin const origin=PARENT) const
 
int getX0 () const
 Return the image's column-origin.
 
int getY0 () const
 Return the image's row-origin.
 
lsst::geom::Point2I getXY0 () const
 Return the image's origin.
 
void setXY0 (int const x0, int const y0)
 Set the MaskedImage's origin.
 
void setXY0 (lsst::geom::Point2I const origin)
 Set the MaskedImage's origin.
 
double indexToPosition (double ind, lsst::afw::image::xOrY const xy) const
 Convert image index to image position (see Image::indexToPosition)
 
std::pair< int, double > positionToIndex (double const pos, lsst::afw::image::xOrY const xy) const
 Convert image position to index (see Image::positionToIndex)
 
iterator begin () const
 Return an iterator to the start of the image.
 
iterator end () const
 Return an iterator to the end of the image.
 
iterator at (int const x, int const y) const
 Return an iterator at the point (x, y)
 
reverse_iterator rbegin () const
 Return a reverse_iterator to the start of the image.
 
reverse_iterator rend () const
 Return a reverse_iterator to the end of the image.
 
fast_iterator begin (bool contiguous) const
 Fast iterators to contiguous images.
 
fast_iterator end (bool contiguous) const
 Return a fast iterator to the end of the image, which must be contiguous Note that the order in which pixels are visited is undefined.
 
x_iterator row_begin (int y) const
 Return an x_iterator to the start of the image.
 
x_iterator row_end (int y) const
 Return an x_iterator to the end of the image.
 
x_iterator x_at (int x, int y) const
 Return an x_iterator at the point (x, y)
 
y_iterator col_begin (int x) const
 Return an y_iterator to the start of the image.
 
y_iterator col_end (int x) const
 Return an y_iterator to the end of the image.
 
y_iterator y_at (int x, int y) const
 Return an y_iterator at the point (x, y)
 
xy_locator xy_at (int x, int y) const
 Return an xy_locator at the point (x, y)
 

Static Public Member Functions

static MaskedImage readFits (std::string const &filename)
 Read a MaskedImage from a regular FITS file.
 
static MaskedImage readFits (fits::MemFileManager &manager)
 Read a MaskedImage from a FITS RAM file.
 

Detailed Description

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

A class to manipulate images, masks, and variance as a single object.

Definition at line 74 of file MaskedImage.h.

Member Typedef Documentation

◆ const_iterator

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::const_iterator = const_MaskedImageIterator<typename Image::iterator, typename Mask::iterator, typename Variance::iterator>

Definition at line 532 of file MaskedImage.h.

◆ const_x_iterator

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::const_x_iterator = const_MaskedImageIterator<typename Image::x_iterator, typename Mask::x_iterator, typename Variance::x_iterator>

A const_iterator to a row of a MaskedImage.

Definition at line 543 of file MaskedImage.h.

◆ const_xy_locator

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::const_xy_locator = const_MaskedImageLocator<typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator>

A const_locator for a MaskedImage.

Definition at line 556 of file MaskedImage.h.

◆ const_y_iterator

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::const_y_iterator = const_MaskedImageIterator<typename Image::y_iterator, typename Mask::y_iterator, typename Variance::y_iterator>

A const_iterator to a column of a MaskedImage.

Definition at line 551 of file MaskedImage.h.

◆ fast_iterator

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::fast_iterator = x_iterator

A fast STL compliant iterator for contiguous images N.b.

The order of pixel access is undefined

Definition at line 547 of file MaskedImage.h.

◆ Image

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::Image = lsst::afw::image::Image<ImagePixelT>

Definition at line 86 of file MaskedImage.h.

◆ image_category

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::image_category = detail::MaskedImage_tag

Definition at line 89 of file MaskedImage.h.

◆ ImagePtr

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::ImagePtr = std::shared_ptr<image::Image<ImagePixelT>>

shared pointer to the Image

Definition at line 77 of file MaskedImage.h.

◆ iterator

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::iterator = MaskedImageIterator<typename Image::iterator, typename Mask::iterator, typename Variance::iterator>

Definition at line 530 of file MaskedImage.h.

◆ Mask

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::Mask = lsst::afw::image::Mask<MaskPixelT>

Definition at line 87 of file MaskedImage.h.

◆ MaskPlaneDict

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskPlaneDict = typename Mask<MaskPixelT>::MaskPlaneDict

The Mask's MaskPlaneDict.

Definition at line 83 of file MaskedImage.h.

◆ MaskPtr

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskPtr = std::shared_ptr<image::Mask<MaskPixelT>>

shared pointer to the Mask

Definition at line 79 of file MaskedImage.h.

◆ Pixel

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::Pixel = lsst::afw::image::pixel::Pixel<ImagePixelT, MaskPixelT, VariancePixelT>

A Pixel in the MaskedImage.

Definition at line 112 of file MaskedImage.h.

◆ reverse_iterator

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::reverse_iterator = MaskedImageIterator<typename Image::reverse_iterator, typename Mask::reverse_iterator, typename Variance::reverse_iterator>

Definition at line 534 of file MaskedImage.h.

◆ SinglePixel

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::SinglePixel = lsst::afw::image::pixel::SinglePixel<ImagePixelT, MaskPixelT, VariancePixelT>

A single Pixel of the same type as those in the MaskedImage.

Definition at line 114 of file MaskedImage.h.

◆ Variance

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::Variance = lsst::afw::image::Image<VariancePixelT>

Definition at line 85 of file MaskedImage.h.

◆ VariancePtr

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::VariancePtr = std::shared_ptr<image::Image<VariancePixelT>>

shared pointer to the variance Image

Definition at line 81 of file MaskedImage.h.

◆ x_iterator

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::x_iterator = MaskedImageIterator<typename Image::x_iterator, typename Mask::x_iterator, typename Variance::x_iterator>

An iterator to a row of a MaskedImage.

Definition at line 541 of file MaskedImage.h.

◆ xy_locator

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::xy_locator = MaskedImageLocator<typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator>

A locator for a MaskedImage.

Definition at line 554 of file MaskedImage.h.

◆ xy_x_iterator

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::xy_x_iterator = typename MaskedImageLocator<typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator>::x_iterator

an x_iterator associated with an xy_locator

Definition at line 559 of file MaskedImage.h.

◆ xy_y_iterator

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::xy_y_iterator = typename MaskedImageLocator<typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator>::y_iterator

an y_iterator associated with an xy_locator

Definition at line 561 of file MaskedImage.h.

◆ y_iterator

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
using lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::y_iterator = MaskedImageIterator<typename Image::y_iterator, typename Mask::y_iterator, typename Variance::y_iterator>

An iterator to a column of a MaskedImage.

Definition at line 549 of file MaskedImage.h.

Constructor & Destructor Documentation

◆ MaskedImage() [1/11]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( unsigned int width,
unsigned int height,
MaskPlaneDict const & planeDict = MaskPlaneDict() )
explicit

Construct from a supplied dimensions.

The Image, Mask, and Variance will be set to zero

Parameters
widthnumber of columns
heightnumber of rows
planeDictMake Mask conform to this mask layout (ignore if empty)

Definition at line 43 of file MaskedImage.cc.

45 : _image(new Image(width, height)),
46 _mask(new Mask(width, height, planeDict)),
47 _variance(new Variance(width, height)) {
48 *_image = 0;
49 *_mask = 0x0;
50 *_variance = 0;
51}
lsst::afw::image::Image< VariancePixelT > Variance
Definition MaskedImage.h:85
lsst::afw::image::Mask< MaskPixelT > Mask
Definition MaskedImage.h:87
lsst::afw::image::Image< ImagePixelT > Image
Definition MaskedImage.h:86

◆ MaskedImage() [2/11]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( lsst::geom::Extent2I const & dimensions = lsst::geom::Extent2I(),
MaskPlaneDict const & planeDict = MaskPlaneDict() )
explicit

Construct from a supplied dimensions.

The Image, Mask, and Variance will be set to zero

Parameters
dimensionsNumber of columns, rows in image
planeDictMake Mask conform to this mask layout (ignore if empty)

Definition at line 54 of file MaskedImage.cc.

56 : _image(new Image(dimensions)),
57 _mask(new Mask(dimensions, planeDict)),
58 _variance(new Variance(dimensions)) {
59 *_image = 0;
60 *_mask = 0x0;
61 *_variance = 0;
62}

◆ MaskedImage() [3/11]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( ImagePtr image,
MaskPtr mask = MaskPtr(),
VariancePtr variance = VariancePtr() )
explicit

Construct from a supplied Image and optional Mask and Variance.

The Mask and Variance will be set to zero if omitted

Parameters
imageImage
maskMask
varianceVariance Mask

Definition at line 149 of file MaskedImage.cc.

151 : _image(image != nullptr ? image : std::make_shared<Image>()),
152 _mask(mask), _variance(variance) {
153 conformSizes();
154}
afw::table::Key< afw::table::Array< MaskPixelT > > mask
afw::table::Key< afw::table::Array< VariancePixelT > > variance
T make_shared(T... args)
STL namespace.
g2d::python::Image< double > Image
Definition test_image.cc:14

◆ MaskedImage() [4/11]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( lsst::geom::Box2I const & bbox,
MaskPlaneDict const & planeDict = MaskPlaneDict() )
explicit

Create an MaskedImage of the specified size.

The Image, Mask, and Variance will be set to zero

Parameters
bboxdimensions of image: width x height
planeDictMake Mask conform to this mask layout (ignore if empty)
Note
Many lsst::afw::image and lsst::afw::math objects define a dimensions member which may be conveniently used to make objects of an appropriate size

Definition at line 65 of file MaskedImage.cc.

67 : _image(new Image(bbox)), _mask(new Mask(bbox, planeDict)), _variance(new Variance(bbox)) {
68 *_image = 0;
69 *_mask = 0x0;
70 *_variance = 0;
71}
AmpInfoBoxKey bbox
Definition Amplifier.cc:117

◆ MaskedImage() [5/11]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( std::string const & fileName,
std::shared_ptr< daf::base::PropertySet > metadata = std::shared_ptr<daf::base::PropertySet>(),
lsst::geom::Box2I const & bbox = lsst::geom::Box2I(),
ImageOrigin origin = PARENT,
bool conformMasks = false,
bool needAllHdus = false,
std::shared_ptr< daf::base::PropertySet > imageMetadata = std::shared_ptr<daf::base::PropertySet>(),
std::shared_ptr< daf::base::PropertySet > maskMetadata = std::shared_ptr<daf::base::PropertySet>(),
std::shared_ptr< daf::base::PropertySet > varianceMetadata = std::shared_ptr<daf::base::PropertySet>(),
bool allowUnsafe = false )
explicit

Construct a MaskedImage by reading a regular FITS file.

Parameters
[in]fileNameFile to read.
[in,out]metadataMetadata read from the primary HDU header.
[in]bboxIf non-empty, read only the pixels within the bounding box.
[in]originCoordinate system of the bounding box; if PARENT, the bounding box should take into account the xy0 saved with the image.
[in]conformMasksIf true, make Mask conform to the mask layout in the file.
[in]needAllHdusIf true, throw fits::FitsError if the mask and/or variance plane is missing. If false, silently initialize them to zero.
[in,out]imageMetadataMetadata read from the image HDU header.
[in,out]maskMetadataMetadata read from the mask HDU header.
[in,out]varianceMetadataMetadata read from the variance HDU header.
[in]allowUnsafePermit reading into the requested pixel type even when on-disk values may overflow or truncate.

Definition at line 74 of file MaskedImage.cc.

80 : _image(), _mask(), _variance() {
81 MaskedImageFitsReader reader(fileName);
82 *this = reader.read<ImagePixelT, MaskPixelT, VariancePixelT>(bbox, origin, conformMasks, needAllHdus,
83 allowUnsafe);
84 if (metadata) {
85 metadata->combine(*reader.readPrimaryMetadata());
86 }
87 if (imageMetadata) {
88 imageMetadata->combine(*reader.readImageMetadata());
89 }
90 if (maskMetadata) {
91 maskMetadata->combine(*reader.readMaskMetadata());
92 }
93 if (varianceMetadata) {
94 varianceMetadata->combine(*reader.readVarianceMetadata());
95 }
96}

◆ MaskedImage() [6/11]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( fits::MemFileManager & manager,
std::shared_ptr< daf::base::PropertySet > metadata = std::shared_ptr<daf::base::PropertySet>(),
lsst::geom::Box2I const & bbox = lsst::geom::Box2I(),
ImageOrigin origin = PARENT,
bool conformMasks = false,
bool needAllHdus = false,
std::shared_ptr< daf::base::PropertySet > imageMetadata = std::shared_ptr<daf::base::PropertySet>(),
std::shared_ptr< daf::base::PropertySet > maskMetadata = std::shared_ptr<daf::base::PropertySet>(),
std::shared_ptr< daf::base::PropertySet > varianceMetadata = std::shared_ptr<daf::base::PropertySet>(),
bool allowUnsafe = false )
explicit

Construct a MaskedImage by reading a FITS image in memory.

Parameters
[in]managerAn object that manages the memory buffer to read.
[in,out]metadataMetadata read from the primary HDU header.
[in]bboxIf non-empty, read only the pixels within the bounding box.
[in]originCoordinate system of the bounding box; if PARENT, the bounding box should take into account the xy0 saved with the image.
[in]conformMasksIf true, make Mask conform to the mask layout in the file.
[in]needAllHdusIf true, throw fits::FitsError if the mask and/or variance plane is missing. If false, silently initialize them to zero.
[in,out]imageMetadataMetadata read from the image HDU header.
[in,out]maskMetadataMetadata read from the mask HDU header.
[in,out]varianceMetadataMetadata read from the variance HDU header.
[in]allowUnsafePermit reading into the requested pixel type even when on-disk values may overflow or truncate.

Definition at line 99 of file MaskedImage.cc.

105 : _image(), _mask(), _variance() {
106 MaskedImageFitsReader reader(manager);
107 *this = reader.read<ImagePixelT, MaskPixelT, VariancePixelT>(bbox, origin, conformMasks, needAllHdus,
108 allowUnsafe);
109 if (metadata) {
110 metadata->combine(*reader.readPrimaryMetadata());
111 }
112 if (imageMetadata) {
113 imageMetadata->combine(*reader.readImageMetadata());
114 }
115 if (maskMetadata) {
116 maskMetadata->combine(*reader.readMaskMetadata());
117 }
118 if (varianceMetadata) {
119 varianceMetadata->combine(*reader.readVarianceMetadata());
120 }
121}

◆ MaskedImage() [7/11]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( fits::Fits & fitsfile,
std::shared_ptr< daf::base::PropertySet > metadata = std::shared_ptr<daf::base::PropertySet>(),
lsst::geom::Box2I const & bbox = lsst::geom::Box2I(),
ImageOrigin origin = PARENT,
bool conformMasks = false,
bool needAllHdus = false,
std::shared_ptr< daf::base::PropertySet > imageMetadata = std::shared_ptr<daf::base::PropertySet>(),
std::shared_ptr< daf::base::PropertySet > maskMetadata = std::shared_ptr<daf::base::PropertySet>(),
std::shared_ptr< daf::base::PropertySet > varianceMetadata = std::shared_ptr<daf::base::PropertySet>(),
bool allowUnsafe = false )
explicit

Construct a MaskedImage from an already-open FITS object.

Parameters
[in]fitsfileA FITS object to read from. Current HDU is ignored.
[in,out]metadataMetadata read from the primary HDU header.
[in]bboxIf non-empty, read only the pixels within the bounding box.
[in]originCoordinate system of the bounding box; if PARENT, the bounding box should take into account the xy0 saved with the image.
[in]conformMasksIf true, make Mask conform to the mask layout in the file.
[in]needAllHdusIf true, throw fits::FitsError if the mask and/or variance plane is missing. If false, silently initialize them to zero.
[in,out]imageMetadataMetadata read from the image HDU header.
[in,out]maskMetadataMetadata read from the mask HDU header.
[in,out]varianceMetadataMetadata read from the variance HDU header.
[in]allowUnsafePermit reading into the requested pixel type even when on-disk values may overflow or truncate.

Definition at line 124 of file MaskedImage.cc.

130 : _image(), _mask(), _variance() {
131 MaskedImageFitsReader reader(&fitsFile);
132 *this = reader.read<ImagePixelT, MaskPixelT, VariancePixelT>(bbox, origin, conformMasks, needAllHdus,
133 allowUnsafe);
134 if (metadata) {
135 metadata->combine(*reader.readPrimaryMetadata());
136 }
137 if (imageMetadata) {
138 imageMetadata->combine(*reader.readImageMetadata());
139 }
140 if (maskMetadata) {
141 maskMetadata->combine(*reader.readMaskMetadata());
142 }
143 if (varianceMetadata) {
144 varianceMetadata->combine(*reader.readVarianceMetadata());
145 }
146}

◆ MaskedImage() [8/11]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const & rhs,
bool const deep = false )

Copy constructor; shallow, unless deep is true.

Parameters
rhsImage to copy
deepMake deep copy?

Definition at line 157 of file MaskedImage.cc.

158 : _image(rhs._image), _mask(rhs._mask), _variance(rhs._variance) {
159 if (deep) {
160 _image = std::shared_ptr<Image>(new Image(*rhs.getImage(), deep));
161 _mask = std::shared_ptr<Mask>(new Mask(*rhs.getMask(), deep));
162 _variance = std::shared_ptr<Variance>(new Variance(*rhs.getVariance(), deep));
163 }
164 conformSizes();
165}

◆ MaskedImage() [9/11]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > && rhs)

Definition at line 169 of file MaskedImage.cc.

170 : MaskedImage(rhs, false) {}
MaskedImage(unsigned int width, unsigned int height, MaskPlaneDict const &planeDict=MaskPlaneDict())
Construct from a supplied dimensions.

◆ MaskedImage() [10/11]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const & rhs,
lsst::geom::Box2I const & bbox,
ImageOrigin const origin = PARENT,
bool const deep = false )

Copy constructor of the pixels specified by bbox; shallow, unless deep is true.

Parameters
rhsMaskedImage to copy
bboxSpecify desired region
originSpecify the coordinate system of the bbox
deepIf false, new ImageBase shares storage with rhs; if true make a new, standalone, MaskedImage

Definition at line 173 of file MaskedImage.cc.

178 : _image(new Image(*rhs.getImage(), bbox, origin, deep)),
179 _mask(rhs._mask ? new Mask(*rhs.getMask(), bbox, origin, deep) : static_cast<Mask*>(nullptr)),
180 _variance(rhs._variance ? new Variance(*rhs.getVariance(), bbox, origin, deep)
181 : static_cast<Variance*>(nullptr)) {
182 conformSizes();
183}
VariancePtr getVariance() const
Return a (shared_ptr to) the MaskedImage's variance.
g2d::python::Image< bool > Mask
Definition test_image.cc:16

◆ MaskedImage() [11/11]

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
template<typename OtherPixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( MaskedImage< OtherPixelT, MaskPixelT, VariancePixelT > const & rhs,
const bool deep )
inline

generalised copy constructor; defined here in the header so that the compiler can instantiate N(N-1)/2 conversions between N ImageBase types.

We only support converting the Image part

Parameters
rhsInput image
deepMust be true; needed to disambiguate

Definition at line 713 of file MaskedImage.h.

717 : _image(), _mask(), _variance() {
718 if (!deep) {
720 "Only deep copies are permitted for MaskedImages with different pixel types");
721 }
722
723 _image = ImagePtr(new Image(*rhs.getImage(), deep));
724 _mask = MaskPtr(new Mask(*rhs.getMask(), deep));
725 _variance = VariancePtr(new Variance(*rhs.getVariance(), deep));
726 }
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48
std::shared_ptr< image::Mask< MaskPixelT > > MaskPtr
shared pointer to the Mask
Definition MaskedImage.h:79
std::shared_ptr< image::Image< ImagePixelT > > ImagePtr
shared pointer to the Image
Definition MaskedImage.h:77
std::shared_ptr< image::Image< VariancePixelT > > VariancePtr
shared pointer to the variance Image
Definition MaskedImage.h:81
Reports invalid arguments.
Definition Runtime.h:66

◆ ~MaskedImage()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
virtual lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::~MaskedImage ( )
virtualdefault

Member Function Documentation

◆ assign()

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::assign ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const & rhs,
lsst::geom::Box2I const & bbox = lsst::geom::Box2I(),
ImageOrigin origin = PARENT )

Copy pixels from another masked image to a specified subregion of this masked image.

Parameters
[in]rhssource image whose pixels are to be copied into this image (the destination)
[in]bboxsubregion of this image to set; if empty (the default) then all pixels are set
[in]originorigin of bbox: if PARENT then the lower left pixel of this image is at xy0 if LOCAL then the lower left pixel of this image is at 0,0
Exceptions
lsst::pex::exceptions::LengthErrorif the dimensions of rhs and the specified subregion of this image do not match.

Definition at line 224 of file MaskedImage.cc.

226 {
227 _image->assign(*rhs.getImage(), bbox, origin);
228 _mask->assign(*rhs.getMask(), bbox, origin);
229 _variance->assign(*rhs.getVariance(), bbox, origin);
230}
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.
Definition Image.cc:153

◆ at()

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::iterator lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::at ( int const x,
int const y ) const

Return an iterator at the point (x, y)

Definition at line 592 of file MaskedImage.cc.

592 {
593 typename Image::iterator imageEnd = getImage()->at(x, y);
594 typename Mask::iterator maskEnd = getMask()->at(x, y);
595 typename Variance::iterator varianceEnd = getVariance()->at(x, y);
596
597 return iterator(imageEnd, maskEnd, varianceEnd);
598}
int y
Definition SpanSet.cc:48
typename _view_t::iterator iterator
An STL compliant iterator.
Definition ImageBase.h:125
iterator at(int x, int y) const
Return an STL compliant iterator at the point (x, y)
Definition Image.cc:270
MaskedImageIterator< typename Image::iterator, typename Mask::iterator, typename Variance::iterator > iterator
MaskPtr getMask() const
Return a (shared_ptr to) the MaskedImage's mask.
ImagePtr getImage() const
Return a (shared_ptr to) the MaskedImage's image.

◆ begin() [1/2]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::iterator lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::begin ( ) const

Return an iterator to the start of the image.

Definition at line 568 of file MaskedImage.cc.

568 {
569#if 0 // this doesn't compile; why?
570 return iterator(_image->begin(), _mask->begin(), _variance->begin());
571#else
572 typename Image::iterator imageBegin = _image->begin();
573 typename Mask::iterator maskBegin = _mask->begin();
574 typename Variance::iterator varianceBegin = _variance->begin();
575
576 return iterator(imageBegin, maskBegin, varianceBegin);
577#endif
578}
iterator begin() const
Return an STL compliant iterator to the start of the image.
Definition Image.cc:250

◆ begin() [2/2]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::fast_iterator lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::begin ( bool contiguous) const

Fast iterators to contiguous images.

Return a fast iterator to the start of the image, which must be contiguous Note that the order in which pixels are visited is undefined.

Parameters
contiguousPixels are contiguous (must be true)
Exceptions
lsst::pex::exceptions::RuntimeErrorArgument contiguous is false, or the pixels are not in fact contiguous

Definition at line 662 of file MaskedImage.cc.

662 {
663 typename Image::fast_iterator imageBegin = _image->begin(contiguous);
664 typename Mask::fast_iterator maskBegin = _mask->begin(contiguous);
665 typename Variance::fast_iterator varianceBegin = _variance->begin(contiguous);
666
667 return fast_iterator(imageBegin, maskBegin, varianceBegin);
668}
x_iterator fast_iterator
A fast STL compliant iterator for contiguous images N.b.
Definition ImageBase.h:137
x_iterator fast_iterator
A fast STL compliant iterator for contiguous images N.b.

◆ col_begin()

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::y_iterator lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::col_begin ( int x) const

Return an y_iterator to the start of the image.

Definition at line 642 of file MaskedImage.cc.

642 {
643 typename Image::y_iterator imageBegin = _image->col_begin(x);
644 typename Mask::y_iterator maskBegin = _mask->col_begin(x);
645 typename Variance::y_iterator varianceBegin = _variance->col_begin(x);
646
647 return y_iterator(imageBegin, maskBegin, varianceBegin);
648}
y_iterator col_begin(int x) const
Return an y_iterator to the start of the y'th row.
Definition ImageBase.h:413
typename _view_t::y_iterator y_iterator
An iterator for traversing the pixels in a column.
Definition ImageBase.h:143
MaskedImageIterator< typename Image::y_iterator, typename Mask::y_iterator, typename Variance::y_iterator > y_iterator
An iterator to a column of a MaskedImage.

◆ col_end()

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::y_iterator lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::col_end ( int x) const

Return an y_iterator to the end of the image.

Definition at line 652 of file MaskedImage.cc.

652 {
653 typename Image::y_iterator imageEnd = getImage()->col_end(x);
654 typename Mask::y_iterator maskEnd = getMask()->col_end(x);
655 typename Variance::y_iterator varianceEnd = getVariance()->col_end(x);
656
657 return y_iterator(imageEnd, maskEnd, varianceEnd);
658}
y_iterator col_end(int x) const
Return an y_iterator to the start of the y'th row.
Definition ImageBase.h:416

◆ end() [1/2]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::iterator lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::end ( ) const

Return an iterator to the end of the image.

Definition at line 582 of file MaskedImage.cc.

582 {
583 typename Image::iterator imageEnd = getImage()->end();
584 typename Mask::iterator maskEnd = getMask()->end();
585 typename Variance::iterator varianceEnd = getVariance()->end();
586
587 return iterator(imageEnd, maskEnd, varianceEnd);
588}
iterator end() const
Return an STL compliant iterator to the end of the image.
Definition Image.cc:255

◆ end() [2/2]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::fast_iterator lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::end ( bool contiguous) const

Return a fast iterator to the end of the image, which must be contiguous Note that the order in which pixels are visited is undefined.

Parameters
contiguousPixels are contiguous (must be true)
Exceptions
lsst::pex::exceptions::RuntimeErrorArgument contiguous is false, or the pixels are not in fact contiguous

Definition at line 672 of file MaskedImage.cc.

672 {
673 typename Image::fast_iterator imageEnd = getImage()->end(contiguous);
674 typename Mask::fast_iterator maskEnd = getMask()->end(contiguous);
675 typename Variance::fast_iterator varianceEnd = getVariance()->end(contiguous);
676
677 return fast_iterator(imageEnd, maskEnd, varianceEnd);
678}

◆ getBBox()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
lsst::geom::Box2I lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::getBBox ( ImageOrigin const origin = PARENT) const
inline

Definition at line 1059 of file MaskedImage.h.

1059{ return _image->getBBox(origin); }
lsst::geom::Box2I getBBox(ImageOrigin origin=PARENT) const
Definition ImageBase.h:445

◆ getDimensions()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
lsst::geom::Extent2I lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::getDimensions ( ) const
inline

Definition at line 1058 of file MaskedImage.h.

1058{ return _image->getDimensions(); }
lsst::geom::Extent2I getDimensions() const
Return the image's size; useful for passing to constructors.
Definition ImageBase.h:356

◆ getHeight()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
int lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::getHeight ( ) const
inline

Return the number of rows in the image.

Definition at line 1057 of file MaskedImage.h.

1057{ return _image->getHeight(); }
int getHeight() const
Return the number of rows in the image.
Definition ImageBase.h:296

◆ getImage()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
ImagePtr lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::getImage ( ) const
inline

Return a (shared_ptr to) the MaskedImage's image.

Definition at line 1019 of file MaskedImage.h.

1019{ return _image; }

◆ getMask()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
MaskPtr lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::getMask ( ) const
inline

Return a (shared_ptr to) the MaskedImage's mask.

Definition at line 1031 of file MaskedImage.h.

1031{ return _mask; }

◆ getVariance()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
VariancePtr lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::getVariance ( ) const
inline

Return a (shared_ptr to) the MaskedImage's variance.

Definition at line 1052 of file MaskedImage.h.

1052{ return _variance; }

◆ getWidth()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
int lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::getWidth ( ) const
inline

Return the number of columns in the image.

Definition at line 1055 of file MaskedImage.h.

1055{ return _image->getWidth(); }
int getWidth() const
Return the number of columns in the image.
Definition ImageBase.h:294

◆ getX0()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
int lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::getX0 ( ) const
inline

Return the image's column-origin.

This will usually be 0 except for images created using the MaskedImage(fileName, hdu, BBox, mode) ctor or MaskedImage(ImageBase, BBox) cctor The origin can be reset with setXY0()

Definition at line 1067 of file MaskedImage.h.

1067{ return _image->getX0(); }
int getX0() const
Return the image's column-origin.
Definition ImageBase.h:306

◆ getXY0()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
lsst::geom::Point2I lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::getXY0 ( ) const
inline

Return the image's origin.

This will usually be (0, 0) except for images created using the MaskedImage(fileName, hdu, BBox, mode) ctor or MaskedImage(ImageBase, BBox) cctor The origin can be reset with setXY0

Definition at line 1083 of file MaskedImage.h.

1083{ return _image->getXY0(); }
lsst::geom::Point2I getXY0() const
Return the image's origin.
Definition ImageBase.h:323

◆ getY0()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
int lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::getY0 ( ) const
inline

Return the image's row-origin.

This will usually be 0 except for images created using the MaskedImage(fileName, hdu, BBox, mode) ctor or MaskedImage(ImageBase, BBox) cctor The origin can be reset with setXY0()

Definition at line 1075 of file MaskedImage.h.

1075{ return _image->getY0(); }
int getY0() const
Return the image's row-origin.
Definition ImageBase.h:314

◆ indexToPosition()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
double lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::indexToPosition ( double ind,
lsst::afw::image::xOrY const xy ) const
inline

Convert image index to image position (see Image::indexToPosition)

Returns
image position
Parameters
indimage index
xyIs this a column or row coordinate?

Definition at line 1122 of file MaskedImage.h.

1124 {
1125 return getImage()->indexToPosition(ind, xy);
1126 }
double indexToPosition(double ind, lsst::afw::image::xOrY const xy) const
Convert image index to image position.
Definition ImageBase.h:349

◆ operator*=() [1/3]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator*= ( ImagePixelT const rhs)

Definition at line 343 of file MaskedImage.cc.

344 {
345 *_image *= rhs;
346 *_variance *= rhs * rhs;
347 return *this;
348}

◆ operator*=() [2/3]

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
MaskedImage & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator*= ( lsst::afw::image::Image< ImagePixelT > const & rhs)
inline

Definition at line 841 of file MaskedImage.h.

841 {
842 *_image *= rhs;
843 *_variance *= rhs; // yes, multiply twice
844 *_variance *= rhs;
845 return *this;
846 }

◆ operator*=() [3/3]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator*= ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const & rhs)

Definition at line 302 of file MaskedImage.cc.

303 {
304 // Must do variance before we modify the image values
305 if (_image->getDimensions() != rhs._image->getDimensions()) {
307 boost::str(boost::format("Images are of different size, %dx%d v %dx%d") %
308 _image->getWidth() % _image->getHeight() % rhs._image->getWidth() % rhs._image->getHeight()));
309 }
310 transform_pixels(_image->_getRawView(), // lhs
311 rhs._image->_getRawView(), // rhs,
312 _variance->_getRawView(), // Var(lhs),
313 rhs._variance->_getRawView(), // Var(rhs)
314 _variance->_getRawView(), // result
315 productVariance<ImagePixelT, VariancePixelT>());
316
317 *_image *= *rhs.getImage();
318 *_mask |= *rhs.getMask();
319 return *this;
320}
_view_t _getRawView() const
Definition ImageBase.h:465
Reports attempts to exceed implementation-defined length limits for some classes.
Definition Runtime.h:76

◆ operator+=() [1/4]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator+= ( ImagePixelT const rhs)

Add a scalar rhs to a MaskedImage.

Definition at line 250 of file MaskedImage.cc.

251 {
252 *_image += rhs;
253 return *this;
254}

◆ operator+=() [2/4]

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
MaskedImage & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator+= ( lsst::afw::image::Image< ImagePixelT > const & rhs)
inline

Definition at line 796 of file MaskedImage.h.

796 {
797 *_image += rhs;
798 return *this;
799 }

◆ operator+=() [3/4]

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
MaskedImage & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator+= ( lsst::afw::math::Function2< double > const & function)
inline

Definition at line 800 of file MaskedImage.h.

800 {
801 *_image += function;
802 return *this;
803 }

◆ operator+=() [4/4]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator+= ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const & rhs)

Add a MaskedImage rhs to a MaskedImage.

The image and variances are added; the masks are ORd together

Note
The pixels in the two images are taken to be independent. There is a Pixel operation (plus) which models the covariance, but this is not (yet?) available as full-MaskedImage operators

Definition at line 233 of file MaskedImage.cc.

234 {
235 *_image += *rhs.getImage();
236 *_mask |= *rhs.getMask();
237 *_variance += *rhs.getVariance();
238 return *this;
239}

◆ operator-=() [1/4]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator-= ( ImagePixelT const rhs)

Subtract a scalar rhs from a MaskedImage.

Definition at line 274 of file MaskedImage.cc.

275 {
276 *_image -= rhs;
277 return *this;
278}

◆ operator-=() [2/4]

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
MaskedImage & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator-= ( lsst::afw::image::Image< ImagePixelT > const & rhs)
inline

Definition at line 823 of file MaskedImage.h.

823 {
824 *_image -= rhs;
825 return *this;
826 }

◆ operator-=() [3/4]

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
MaskedImage & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator-= ( lsst::afw::math::Function2< double > const & function)
inline

Definition at line 827 of file MaskedImage.h.

827 {
828 *_image -= function;
829 return *this;
830 }

◆ operator-=() [4/4]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator-= ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const & rhs)

Subtract a MaskedImage rhs from a MaskedImage.

The images are subtracted; the masks are ORd together; and the variances are added

Note
the pixels in the two images are taken to be independent

Definition at line 257 of file MaskedImage.cc.

258 {
259 *_image -= *rhs.getImage();
260 *_mask |= *rhs.getMask();
261 *_variance += *rhs.getVariance();
262 return *this;
263}

◆ operator/=() [1/3]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator/= ( ImagePixelT const rhs)

Definition at line 414 of file MaskedImage.cc.

415 {
416 *_image /= rhs;
417 *_variance /= rhs * rhs;
418 return *this;
419}

◆ operator/=() [2/3]

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
MaskedImage & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator/= ( lsst::afw::image::Image< ImagePixelT > const & rhs)
inline

Definition at line 851 of file MaskedImage.h.

851 {
852 *_image /= rhs;
853 *_variance /= rhs; // yes, divide twice
854 *_variance /= rhs;
855 return *this;
856 }

◆ operator/=() [3/3]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator/= ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const & rhs)

Definition at line 373 of file MaskedImage.cc.

374 {
375 // Must do variance before we modify the image values
376 if (_image->getDimensions() != rhs._image->getDimensions()) {
378 boost::str(boost::format("Images are of different size, %dx%d v %dx%d") %
379 _image->getWidth() % _image->getHeight() % rhs._image->getWidth() % rhs._image->getHeight()));
380 }
381 transform_pixels(_image->_getRawView(), // lhs
382 rhs._image->_getRawView(), // rhs,
383 _variance->_getRawView(), // Var(lhs),
384 rhs._variance->_getRawView(), // Var(rhs)
385 _variance->_getRawView(), // result
386 quotientVariance<ImagePixelT, VariancePixelT>());
387
388 *_image /= *rhs.getImage();
389 *_mask |= *rhs.getMask();
390 return *this;
391}

◆ operator=() [1/4]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator= ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > && rhs)
default

◆ operator=() [2/4]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator= ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const & rhs)
default

Make the lhs use the rhs's pixels.

If you are copying a scalar value, a simple lhs = scalar; is OK, but this is probably not the function that you want to use with an image. To copy pixel values from the rhs use assign(rhs)

Parameters
rhsRight hand side

◆ operator=() [3/4]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator= ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::Pixel const & rhs)

Set the pixels in the MaskedImage to the rhs.

Definition at line 204 of file MaskedImage.cc.

205 {
206 *_image = rhs.image();
207 *_mask = rhs.mask();
208 *_variance = rhs.variance();
209
210 return *this;
211}

◆ operator=() [4/4]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator= ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::SinglePixel const & rhs)

Set the pixels in the MaskedImage to the rhs.

Definition at line 214 of file MaskedImage.cc.

215 {
216 *_image = rhs.image();
217 *_mask = rhs.mask();
218 *_variance = rhs.variance();
219
220 return *this;
221}

◆ operator[]()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
MaskedImage lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator[] ( lsst::geom::Box2I const & bbox) const
inline

Return a subimage corresponding to the given box (interpreted as PARENT coordinates).

Definition at line 768 of file MaskedImage.h.

768{ return subset(bbox); }
MaskedImage subset(lsst::geom::Box2I const &bbox, ImageOrigin origin=PARENT) const
Return a subimage corresponding to the given box.

◆ positionToIndex()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
std::pair< int, double > lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::positionToIndex ( double const pos,
lsst::afw::image::xOrY const xy ) const
inline

Convert image position to index (see Image::positionToIndex)

Returns
std::pair(nearest integer index, fractional part)
Parameters
posimage position
xyIs this a column or row coordinate?

Definition at line 1133 of file MaskedImage.h.

1136 {
1137 return getImage()->positionToIndex(pos, xy);
1138 }
std::pair< int, double > positionToIndex(double const pos, lsst::afw::image::xOrY const xy) const
Convert image position to index (nearest integer and fractional parts)
Definition ImageBase.h:330

◆ rbegin()

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::reverse_iterator lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::rbegin ( ) const

Return a reverse_iterator to the start of the image.

Definition at line 602 of file MaskedImage.cc.

602 {
603 typename Image::reverse_iterator imageBegin = _image->rbegin();
604 typename Mask::reverse_iterator maskBegin = _mask->rbegin();
605 typename Variance::reverse_iterator varianceBegin = _variance->rbegin();
606
607 return reverse_iterator(imageBegin, maskBegin, varianceBegin);
608}
typename _view_t::reverse_iterator reverse_iterator
An STL compliant reverse iterator.
Definition ImageBase.h:129
reverse_iterator rbegin() const
Return an STL compliant reverse iterator to the start of the image.
Definition Image.cc:260
MaskedImageIterator< typename Image::reverse_iterator, typename Mask::reverse_iterator, typename Variance::reverse_iterator > reverse_iterator

◆ readFits() [1/2]

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
static MaskedImage lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::readFits ( fits::MemFileManager & manager)
inlinestatic

Read a MaskedImage from a FITS RAM file.

Parameters
[in]managerObject that manages the memory to be read.

Definition at line 1012 of file MaskedImage.h.

1012 {
1013 return MaskedImage<ImagePixelT, MaskPixelT, VariancePixelT>(manager);
1014 }

◆ readFits() [2/2]

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
static MaskedImage lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::readFits ( std::string const & filename)
inlinestatic

Read a MaskedImage from a regular FITS file.

Parameters
[in]filenameName of the file to read.

Definition at line 1003 of file MaskedImage.h.

1003 {
1004 return MaskedImage<ImagePixelT, MaskPixelT, VariancePixelT>(filename);
1005 }

◆ rend()

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::reverse_iterator lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::rend ( ) const

Return a reverse_iterator to the end of the image.

Definition at line 612 of file MaskedImage.cc.

612 {
613 typename Image::reverse_iterator imageEnd = getImage()->rend();
614 typename Mask::reverse_iterator maskEnd = getMask()->rend();
615 typename Variance::reverse_iterator varianceEnd = getVariance()->rend();
616
617 return reverse_iterator(imageEnd, maskEnd, varianceEnd);
618}
reverse_iterator rend() const
Return an STL compliant reverse iterator to the end of the image.
Definition Image.cc:265

◆ row_begin()

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::x_iterator lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::row_begin ( int y) const

Return an x_iterator to the start of the image.

Definition at line 622 of file MaskedImage.cc.

622 {
623 typename Image::x_iterator imageBegin = _image->row_begin(y);
624 typename Mask::x_iterator maskBegin = _mask->row_begin(y);
625 typename Variance::x_iterator varianceBegin = _variance->row_begin(y);
626
627 return x_iterator(imageBegin, maskBegin, varianceBegin);
628}
x_iterator row_begin(int y) const
Return an x_iterator to the start of the y'th row.
Definition ImageBase.h:401
typename _view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
Definition ImageBase.h:133
MaskedImageIterator< typename Image::x_iterator, typename Mask::x_iterator, typename Variance::x_iterator > x_iterator
An iterator to a row of a MaskedImage.

◆ row_end()

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::x_iterator lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::row_end ( int y) const

Return an x_iterator to the end of the image.

Definition at line 632 of file MaskedImage.cc.

632 {
633 typename Image::x_iterator imageEnd = getImage()->row_end(y);
634 typename Mask::x_iterator maskEnd = getMask()->row_end(y);
635 typename Variance::x_iterator varianceEnd = getVariance()->row_end(y);
636
637 return x_iterator(imageEnd, maskEnd, varianceEnd);
638}
x_iterator row_end(int y) const
Return an x_iterator to the end of the y'th row.
Definition ImageBase.h:404

◆ scaledDivides()

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::scaledDivides ( double const c,
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const & rhs )

Definition at line 394 of file MaskedImage.cc.

395 {
396 // Must do variance before we modify the image values
397 if (_image->getDimensions() != rhs._image->getDimensions()) {
399 str(boost::format("Images are of different size, %dx%d v %dx%d") %
400 _image->getWidth() % _image->getHeight() % rhs._image->getWidth() % rhs._image->getHeight()));
401 }
402 transform_pixels(_image->_getRawView(), // lhs
403 rhs._image->_getRawView(), // rhs,
404 _variance->_getRawView(), // Var(lhs),
405 rhs._variance->_getRawView(), // Var(rhs)
406 _variance->_getRawView(), // result
407 scaledQuotientVariance<ImagePixelT, VariancePixelT>(c));
408
409 (*_image).scaledDivides(c, *rhs.getImage());
410 *_mask |= *rhs._mask;
411}

◆ scaledMinus()

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::scaledMinus ( double const c,
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const & rhs )

Subtract a scaled MaskedImage c*rhs from a MaskedImage.

The images are subtracted; the masks are ORd together; and the variances are added

Note
the pixels in the two images are taken to be independent

Definition at line 266 of file MaskedImage.cc.

267 {
268 (*_image).scaledMinus(c, *rhs.getImage());
269 *_mask |= *rhs.getMask();
270 (*_variance).scaledPlus(c * c, *rhs.getVariance());
271}

◆ scaledMultiplies()

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::scaledMultiplies ( double const c,
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const & rhs )

Definition at line 323 of file MaskedImage.cc.

324 {
325 // Must do variance before we modify the image values
326 if (_image->getDimensions() != rhs._image->getDimensions()) {
328 boost::str(boost::format("Images are of different size, %dx%d v %dx%d") %
329 _image->getWidth() % _image->getHeight() % rhs._image->getWidth() % rhs._image->getHeight()));
330 }
331 transform_pixels(_image->_getRawView(), // lhs
332 rhs._image->_getRawView(), // rhs,
333 _variance->_getRawView(), // Var(lhs),
334 rhs._variance->_getRawView(), // Var(rhs)
335 _variance->_getRawView(), // result
336 scaledProductVariance<ImagePixelT, VariancePixelT>(c));
337
338 (*_image).scaledMultiplies(c, *rhs.getImage());
339 *_mask |= *rhs.getMask();
340}

◆ scaledPlus()

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::scaledPlus ( double const c,
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const & rhs )

Add a scaled MaskedImage c*rhs to a MaskedImage.

The image and variances are added; the masks are ORd together

Note
The pixels in the two images are taken to be independent. There is a Pixel operation (plus) which models the covariance, but this is not (yet?) available as full-MaskedImage operators

Definition at line 242 of file MaskedImage.cc.

243 {
244 (*_image).scaledPlus(c, *rhs.getImage());
245 *_mask |= *rhs.getMask();
246 (*_variance).scaledPlus(c * c, *rhs.getVariance());
247}

◆ setImage()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::setImage ( Image const & other)
inline

Set the image plane's pixel values to those of another Image.

This copies pixel values, not pointers.

Exceptions
pex::exceptions::LengthErrorif dimensions do not match.

Definition at line 1028 of file MaskedImage.h.

1028{ _image->assign(other); }

◆ setMask()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::setMask ( Mask const & other)
inline

Set the mask plane's pixel values to those of another Mask.

This copies pixel values, not pointers.

Exceptions
pex::exceptions::LengthErrorif dimensions do not match.

Definition at line 1040 of file MaskedImage.h.

1040{ _mask->assign(other); }

◆ setVariance()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::setVariance ( Variance const & other)
inline

Set the variance plane's pixel values to those of another Image.

This copies pixel values, not pointers.

Exceptions
pex::exceptions::LengthErrorif dimensions do not match.

Definition at line 1049 of file MaskedImage.h.

1049{ _variance->assign(other); }

◆ setXY0() [1/2]

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::setXY0 ( int const x0,
int const y0 )
inline

Set the MaskedImage's origin.

The origin is usually set by the constructor, so you shouldn't need this function

Note
There are use cases (e.g. memory overlays) that may want to set these values, but don't do so unless you are an Expert.

Definition at line 1093 of file MaskedImage.h.

1093{ setXY0(lsst::geom::Point2I(x0, y0)); }
void setXY0(int const x0, int const y0)
Set the MaskedImage's origin.

◆ setXY0() [2/2]

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::setXY0 ( lsst::geom::Point2I const origin)
inline

Set the MaskedImage's origin.

The origin is usually set by the constructor, so you shouldn't need this function

Note
There are use cases (e.g. memory overlays) that may want to set these values, but don't do so unless you are an Expert.

Definition at line 1103 of file MaskedImage.h.

1103 {
1104 if (_image) {
1105 _image->setXY0(origin);
1106 }
1107
1108 if (_mask) {
1109 _mask->setXY0(origin);
1110 }
1111
1112 if (_variance) {
1113 _variance->setXY0(origin);
1114 }
1115 }
void setXY0(lsst::geom::Point2I const origin)
Set the ImageBase's origin.
Definition ImageBase.h:434

◆ subset()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
MaskedImage lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::subset ( lsst::geom::Box2I const & bbox,
ImageOrigin origin = PARENT ) const
inline

Return a subimage corresponding to the given box.

Parameters
bboxBounding box of the subimage returned.
originOrigin bbox is rleative to; PARENT accounts for xy0, LOCAL does not.
Returns
A subimage view into this.

This method is wrapped as getitem in Python.

Note
This method permits mutable views to be obtained from const references to images (just as the copy constructor does). This is an intrinsic flaw in Image's design.

Definition at line 763 of file MaskedImage.h.

763 {
764 return MaskedImage(*this, bbox, origin, false);
765 }

◆ swap()

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::swap ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > & rhs)

Definition at line 194 of file MaskedImage.cc.

194 {
195 using std::swap; // See Meyers, Effective C++, Item 25
196
197 _image.swap(rhs._image);
198 _mask.swap(rhs._mask);
199 _variance.swap(rhs._variance);
200}
T swap(T... args)

◆ writeFits() [1/6]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::writeFits ( fits::Fits & fitsfile,
fits::ImageWriteOptions const & imageOptions,
fits::ImageWriteOptions const & maskOptions,
fits::ImageWriteOptions const & varianceOptions,
std::shared_ptr< daf::base::PropertySet const > metadata = nullptr,
std::shared_ptr< daf::base::PropertySet const > imageMetadata = nullptr,
std::shared_ptr< daf::base::PropertySet const > maskMetadata = nullptr,
std::shared_ptr< daf::base::PropertySet const > varianceMetadata = nullptr ) const

Write a MaskedImage to a FITS file.

Parameters
[in]fitsfileAn empty FITS file object.
[in]imageOptionsOptions controlling writing of image as FITS.
[in]maskOptionsOptions controlling writing of mask as FITS.
[in]varianceOptionsOptions controlling writing of variance as FITS.
[in]metadataAdditional values to write to the primary HDU header (may be null).
[in]imageMetadataMetadata to be written to the image header.
[in]maskMetadataMetadata to be written to the mask header.
[in]varianceMetadataMetadata to be written to the variance header.

The FITS file will have four HDUs; the primary HDU will contain only metadata, while the image, mask, and variance HDU headers will use the "INHERIT='T'" convention to indicate that the primary metadata applies to those HDUs as well.

Definition at line 494 of file MaskedImage.cc.

500 {
502 if (metadata) {
503 header = metadata->deepCopy();
504 } else {
505 header = std::make_shared<daf::base::PropertyList>();
506 }
507
508 if (fitsfile.countHdus() != 0) {
509 throw LSST_EXCEPT(pex::exceptions::LogicError,
510 "MaskedImage::writeFits can only write to an empty file");
511 }
512 if (fitsfile.getHdu() < 1) {
513 // Don't ever write images to primary; instead we make an empty primary.
514 fitsfile.createEmpty();
515 } else {
516 fitsfile.setHdu(0);
517 }
518 fitsfile.writeMetadata(*header);
519
520 processPlaneMetadata(imageMetadata.get(), header, "IMAGE");
521 _image->writeFits(fitsfile, imageOptions, header.get(), _mask.get());
522
523 processPlaneMetadata(maskMetadata.get(), header, "MASK");
524 _mask->writeFits(fitsfile, maskOptions, header.get());
525
526 processPlaneMetadata(varianceMetadata.get(), header, "VARIANCE");
527 _variance->writeFits(fitsfile, varianceOptions, header.get(), _mask.get());
528}
void writeFits(std::string const &fileName, daf::base::PropertySet const *metadata=nullptr, std::string const &mode="w") const
Write an image to a regular FITS file.
T get(T... args)

◆ writeFits() [2/6]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::writeFits ( fits::Fits & fitsfile,
std::shared_ptr< daf::base::PropertySet const > metadata = std::shared_ptr<daf::base::PropertySet const>(),
std::shared_ptr< daf::base::PropertySet const > imageMetadata = std::shared_ptr<daf::base::PropertySet const>(),
std::shared_ptr< daf::base::PropertySet const > maskMetadata = std::shared_ptr<daf::base::PropertySet const>(),
std::shared_ptr< daf::base::PropertySet const > varianceMetadata = std::shared_ptr<daf::base::PropertySet const>() ) const

Write a MaskedImage to a FITS file.

Parameters
[in]fitsfileAn empty FITS file object.
[in]metadataAdditional values to write to the primary HDU header (may be null).
[in]imageMetadataMetadata to be written to the image header.
[in]maskMetadataMetadata to be written to the mask header.
[in]varianceMetadataMetadata to be written to the variance header.

The FITS file will have four HDUs; the primary HDU will contain only metadata, while the image, mask, and variance HDU headers will use the "INHERIT='T'" convention to indicate that the primary metadata applies to those HDUs as well.

Definition at line 458 of file MaskedImage.cc.

462 {
463 writeFits(fitsfile, fits::ImageWriteOptions(*_image), fits::ImageWriteOptions(*_mask),
464 fits::ImageWriteOptions(*_variance), metadata, imageMetadata, maskMetadata, varianceMetadata);
465}
void writeFits(std::string const &fileName, std::shared_ptr< daf::base::PropertySet const > metadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > imageMetadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > maskMetadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > varianceMetadata=std::shared_ptr< daf::base::PropertySet const >()) const
Write a MaskedImage to a regular FITS file.

◆ writeFits() [3/6]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::writeFits ( fits::MemFileManager & manager,
fits::ImageWriteOptions const & imageOptions,
fits::ImageWriteOptions const & maskOptions,
fits::ImageWriteOptions const & varianceOptions,
std::shared_ptr< daf::base::PropertySet const > metadata = nullptr,
std::shared_ptr< daf::base::PropertySet const > imageMetadata = nullptr,
std::shared_ptr< daf::base::PropertySet const > maskMetadata = nullptr,
std::shared_ptr< daf::base::PropertySet const > varianceMetadata = nullptr ) const

Write a MaskedImage to a FITS file.

Parameters
[in]managerManager object for the memory block to write to.
[in]imageOptionsOptions controlling writing of image as FITS.
[in]maskOptionsOptions controlling writing of mask as FITS.
[in]varianceOptionsOptions controlling writing of variance as FITS.
[in]metadataAdditional values to write to the primary HDU header (may be null).
[in]imageMetadataMetadata to be written to the image header.
[in]maskMetadataMetadata to be written to the mask header.
[in]varianceMetadataMetadata to be written to the variance header.

The FITS file will have four HDUs; the primary HDU will contain only metadata, while the image, mask, and variance HDU headers will use the "INHERIT='T'" convention to indicate that the primary metadata applies to those HDUs as well.

Definition at line 481 of file MaskedImage.cc.

487 {
488 fits::Fits fitsfile(manager, "w", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
489 writeFits(fitsfile, imageOptions, maskOptions, varianceOptions, metadata, imageMetadata, maskMetadata,
490 varianceMetadata);
491}

◆ writeFits() [4/6]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::writeFits ( fits::MemFileManager & manager,
std::shared_ptr< daf::base::PropertySet const > metadata = std::shared_ptr<daf::base::PropertySet const>(),
std::shared_ptr< daf::base::PropertySet const > imageMetadata = std::shared_ptr<daf::base::PropertySet const>(),
std::shared_ptr< daf::base::PropertySet const > maskMetadata = std::shared_ptr<daf::base::PropertySet const>(),
std::shared_ptr< daf::base::PropertySet const > varianceMetadata = std::shared_ptr<daf::base::PropertySet const>() ) const

Write a MaskedImage to a FITS RAM file.

Parameters
[in]managerManager object for the memory block to write to.
[in]metadataAdditional values to write to the primary HDU header (may be null).
[in]imageMetadataMetadata to be written to the image header.
[in]maskMetadataMetadata to be written to the mask header.
[in]varianceMetadataMetadata to be written to the variance header.

The FITS file will have four HDUs; the primary HDU will contain only metadata, while the image, mask, and variance HDU headers will use the "INHERIT='T'" convention to indicate that the primary metadata applies to those HDUs as well.

Definition at line 432 of file MaskedImage.cc.

436 {
437 fits::Fits fitsfile(manager, "w", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
438 writeFits(fitsfile, metadata, imageMetadata, maskMetadata, varianceMetadata);
439}

◆ writeFits() [5/6]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::writeFits ( std::string const & fileName,
fits::ImageWriteOptions const & imageOptions,
fits::ImageWriteOptions const & maskOptions,
fits::ImageWriteOptions const & varianceOptions,
std::shared_ptr< daf::base::PropertySet const > metadata = nullptr,
std::shared_ptr< daf::base::PropertySet const > imageMetadata = nullptr,
std::shared_ptr< daf::base::PropertySet const > maskMetadata = nullptr,
std::shared_ptr< daf::base::PropertySet const > varianceMetadata = nullptr ) const

Write a MaskedImage to a FITS file.

Parameters
[in]fileNameName of the file to write.
[in]imageOptionsOptions controlling writing of image as FITS.
[in]maskOptionsOptions controlling writing of mask as FITS.
[in]varianceOptionsOptions controlling writing of variance as FITS.
[in]metadataAdditional values to write to the primary HDU header (may be null).
[in]imageMetadataMetadata to be written to the image header.
[in]maskMetadataMetadata to be written to the mask header.
[in]varianceMetadataMetadata to be written to the variance header.

The FITS file will have four HDUs; the primary HDU will contain only metadata, while the image, mask, and variance HDU headers will use the "INHERIT='T'" convention to indicate that the primary metadata applies to those HDUs as well.

Definition at line 468 of file MaskedImage.cc.

474 {
475 fits::Fits fitsfile(fileName, "w", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
476 writeFits(fitsfile, imageOptions, maskOptions, varianceOptions, metadata, imageMetadata, maskMetadata,
477 varianceMetadata);
478}

◆ writeFits() [6/6]

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::writeFits ( std::string const & fileName,
std::shared_ptr< daf::base::PropertySet const > metadata = std::shared_ptr<daf::base::PropertySet const>(),
std::shared_ptr< daf::base::PropertySet const > imageMetadata = std::shared_ptr<daf::base::PropertySet const>(),
std::shared_ptr< daf::base::PropertySet const > maskMetadata = std::shared_ptr<daf::base::PropertySet const>(),
std::shared_ptr< daf::base::PropertySet const > varianceMetadata = std::shared_ptr<daf::base::PropertySet const>() ) const

Write a MaskedImage to a regular FITS file.

Parameters
[in]fileNameName of the file to write. When writing separate files, this is the "base" of the filename (e.g. foo reads foo_{img.msk.var}.fits).
[in]metadataAdditional values to write to the primary HDU header (may be null).
[in]imageMetadataMetadata to be written to the image header.
[in]maskMetadataMetadata to be written to the mask header.
[in]varianceMetadataMetadata to be written to the variance header.

The FITS file will have four HDUs; the primary HDU will contain only metadata, while the image, mask, and variance HDU headers will use the "INHERIT='T'" convention to indicate that the primary metadata applies to those HDUs as well.

Definition at line 422 of file MaskedImage.cc.

426 {
427 fits::Fits fitsfile(fileName, "w", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
428 writeFits(fitsfile, metadata, imageMetadata, maskMetadata, varianceMetadata);
429}

◆ x_at()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
x_iterator lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::x_at ( int x,
int y ) const
inline

Return an x_iterator at the point (x, y)

Definition at line 1181 of file MaskedImage.h.

1181 {
1182#if 0
1183 typename Image::x_iterator imageEnd = getImage()->x_at(x, y);
1184 typename Mask::x_iterator maskEnd = getMask()->x_at(x, y);
1185 typename Variance::x_iterator varianceEnd = getVariance()->x_at(x, y);
1186#else // bypass checks for non-NULL pointers
1187 typename Image::x_iterator imageEnd = _image->x_at(x, y);
1188 typename Mask::x_iterator maskEnd = _mask->x_at(x, y);
1189 typename Variance::x_iterator varianceEnd = _variance->x_at(x, y);
1190#endif
1191
1192 return x_iterator(imageEnd, maskEnd, varianceEnd);
1193 }
x_iterator x_at(int x, int y) const
Return an x_iterator to the point (x, y) in the image.
Definition ImageBase.h:407

◆ xy_at()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
xy_locator lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::xy_at ( int x,
int y ) const
inline

Return an xy_locator at the point (x, y)

Definition at line 1215 of file MaskedImage.h.

1215 {
1216#if 0
1217 typename Image::xy_locator imageEnd = getImage()->xy_at(x, y);
1218 typename Mask::xy_locator maskEnd = getMask()->xy_at(x, y);
1219 typename Variance::xy_locator varianceEnd = getVariance()->xy_at(x, y);
1220#else // bypass checks for non-NULL pointers
1221 typename Image::xy_locator imageEnd = _image->xy_at(x, y);
1222 typename Mask::xy_locator maskEnd = _mask->xy_at(x, y);
1223 typename Variance::xy_locator varianceEnd = _variance->xy_at(x, y);
1224#endif
1225
1226 return xy_locator(imageEnd, maskEnd, varianceEnd);
1227 }
xy_locator xy_at(int x, int y) const
Return an xy_locator at the point (x, y) in the image.
Definition ImageBase.h:425
typename _view_t::xy_locator xy_locator
An xy_locator.
Definition ImageBase.h:121
MaskedImageLocator< typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator > xy_locator
A locator for a MaskedImage.

◆ y_at()

template<typename ImagePixelT , typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
y_iterator lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::y_at ( int x,
int y ) const
inline

Return an y_iterator at the point (x, y)

Definition at line 1201 of file MaskedImage.h.

1201 {
1202#if 0
1203 typename Image::y_iterator imageEnd = getImage()->y_at(x, y);
1204 typename Mask::y_iterator maskEnd = getMask()->y_at(x, y);
1205 typename Variance::y_iterator varianceEnd = getVariance()->y_at(x, y);
1206#else // bypass checks for non-NULL pointers
1207 typename Image::y_iterator imageEnd = _image->y_at(x, y);
1208 typename Mask::y_iterator maskEnd = _mask->y_at(x, y);
1209 typename Variance::y_iterator varianceEnd = _variance->y_at(x, y);
1210#endif
1211 return y_iterator(imageEnd, maskEnd, varianceEnd);
1212 }
y_iterator y_at(int x, int y) const
Return an y_iterator to the point (x, y) in the image.
Definition ImageBase.h:419

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