LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | 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>

Inheritance diagram for lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >:
lsst::daf::base::Persistable lsst::daf::base::Citizen

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

typedef Image< ImagePixelT >::Ptr ImagePtr
 shared pointer to the Image More...
 
typedef Mask< MaskPixelT >::Ptr MaskPtr
 shared pointer to the Mask More...
 
typedef Image< VariancePixelT >
::Ptr 
VariancePtr
 shared pointer to the variance Image More...
 
typedef boost::shared_ptr
< MaskedImage
Ptr
 shared pointer to a MaskedImage More...
 
typedef boost::shared_ptr
< const MaskedImage
ConstPtr
 
typedef Mask< MaskPixelT >
::MaskPlaneDict 
MaskPlaneDict
 The Mask's MaskPlaneDict. More...
 
typedef
lsst::afw::image::Image
< VariancePixelT > 
Variance
 
typedef
lsst::afw::image::Image
< ImagePixelT > 
Image
 
typedef lsst::afw::image::Mask
< MaskPixelT > 
Mask
 
typedef detail::MaskedImage_tag image_category
 
typedef
lsst::afw::image::pixel::Pixel
< ImagePixelT, MaskPixelT,
VariancePixelT > 
Pixel
 A Pixel in the MaskedImage. More...
 
typedef
lsst::afw::image::pixel::SinglePixel
< ImagePixelT, MaskPixelT,
VariancePixelT > 
SinglePixel
 A single Pixel of the same type as those in the MaskedImage. More...
 
typedef MaskedImageIterator
< typename Image::iterator,
typename Mask::iterator,
typename Variance::iterator
iterator
 
typedef
const_MaskedImageIterator
< typename Image::iterator,
typename Mask::iterator,
typename Variance::iterator
const_iterator
 
typedef MaskedImageIterator
< typename
Image::reverse_iterator,
typename
Mask::reverse_iterator,
typename
Variance::reverse_iterator
reverse_iterator
 
typedef MaskedImageIterator
< typename Image::x_iterator,
typename Mask::x_iterator,
typename Variance::x_iterator
x_iterator
 An iterator to a row of a MaskedImage. More...
 
typedef
const_MaskedImageIterator
< typename Image::x_iterator,
typename Mask::x_iterator,
typename Variance::x_iterator
const_x_iterator
 A const_iterator to a row of a MaskedImage. More...
 
typedef x_iterator fast_iterator
 
typedef MaskedImageIterator
< typename Image::y_iterator,
typename Mask::y_iterator,
typename Variance::y_iterator
y_iterator
 An iterator to a column of a MaskedImage. More...
 
typedef
const_MaskedImageIterator
< typename Image::y_iterator,
typename Mask::y_iterator,
typename Variance::y_iterator
const_y_iterator
 A const_iterator to a column of a MaskedImage. More...
 
typedef MaskedImageLocator
< typename Image::xy_locator,
typename Mask::xy_locator,
typename Variance::xy_locator
xy_locator
 A locator for a MaskedImage. More...
 
typedef
const_MaskedImageLocator
< typename Image::xy_locator,
typename Mask::xy_locator,
typename Variance::xy_locator
const_xy_locator
 A const_locator for a MaskedImage. More...
 
typedef MaskedImageLocator
< typename Image::xy_locator,
typename Mask::xy_locator,
typename Variance::xy_locator >
::x_iterator 
xy_x_iterator
 an x_iterator associated with an xy_locator More...
 
typedef MaskedImageLocator
< typename Image::xy_locator,
typename Mask::xy_locator,
typename Variance::xy_locator >
::y_iterator 
xy_y_iterator
 an y_iterator associated with an xy_locator More...
 
- Public Types inherited from lsst::daf::base::Persistable
typedef boost::shared_ptr
< Persistable
Ptr
 
- Public Types inherited from lsst::daf::base::Citizen
enum  { magicSentinel = 0xdeadbeef }
 
typedef unsigned long memId
 Type of the block's ID. More...
 
typedef memId(* memNewCallback )(const memId cid)
 A function used to register a callback. More...
 
typedef memId(* memCallback )(const Citizen *ptr)
 

Public Member Functions

 MaskedImage (unsigned int width, unsigned int height, MaskPlaneDict const &planeDict=MaskPlaneDict())
 Construct from a supplied dimensions. The Image, Mask, and Variance will be set to zero. More...
 
 MaskedImage (geom::Extent2I const &dimensions=geom::Extent2I(), MaskPlaneDict const &planeDict=MaskPlaneDict())
 Construct from a supplied dimensions. The Image, Mask, and Variance will be set to zero. More...
 
 MaskedImage (ImagePtr image, MaskPtr mask=MaskPtr(), VariancePtr variance=VariancePtr())
 Construct from a supplied Image and optional Mask and Variance. The Mask and Variance will be set to zero if omitted. More...
 
 MaskedImage (geom::Box2I const &bbox, MaskPlaneDict const &planeDict=MaskPlaneDict())
 
 MaskedImage (std::string const &fileName, boost::shared_ptr< daf::base::PropertySet > metadata=boost::shared_ptr< daf::base::PropertySet >(), geom::Box2I const &bbox=geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false, bool needAllHdus=false, boost::shared_ptr< daf::base::PropertySet > imageMetadata=boost::shared_ptr< daf::base::PropertySet >(), boost::shared_ptr< daf::base::PropertySet > maskMetadata=boost::shared_ptr< daf::base::PropertySet >(), boost::shared_ptr< daf::base::PropertySet > varianceMetadata=boost::shared_ptr< daf::base::PropertySet >())
 Construct a MaskedImage by reading a regular FITS file. More...
 
 MaskedImage (fits::MemFileManager &manager, boost::shared_ptr< daf::base::PropertySet > metadata=boost::shared_ptr< daf::base::PropertySet >(), geom::Box2I const &bbox=geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false, bool needAllHdus=false, boost::shared_ptr< daf::base::PropertySet > imageMetadata=boost::shared_ptr< daf::base::PropertySet >(), boost::shared_ptr< daf::base::PropertySet > maskMetadata=boost::shared_ptr< daf::base::PropertySet >(), boost::shared_ptr< daf::base::PropertySet > varianceMetadata=boost::shared_ptr< daf::base::PropertySet >())
 Construct a MaskedImage by reading a FITS image in memory. More...
 
 MaskedImage (fits::Fits &fitsfile, boost::shared_ptr< daf::base::PropertySet > metadata=boost::shared_ptr< daf::base::PropertySet >(), geom::Box2I const &bbox=geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false, bool needAllHdus=false, boost::shared_ptr< daf::base::PropertySet > imageMetadata=boost::shared_ptr< daf::base::PropertySet >(), boost::shared_ptr< daf::base::PropertySet > maskMetadata=boost::shared_ptr< daf::base::PropertySet >(), boost::shared_ptr< daf::base::PropertySet > varianceMetadata=boost::shared_ptr< daf::base::PropertySet >())
 Construct a MaskedImage from an already-open FITS object. More...
 
 MaskedImage (MaskedImage const &rhs, bool const deep=false)
 Copy constructor; shallow, unless deep is true. More...
 
 MaskedImage (MaskedImage const &rhs, 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. More...
 
template<typename OtherPixelT >
 MaskedImage (MaskedImage< OtherPixelT, MaskPixelT, VariancePixelT > const &rhs, const bool deep)
 
MaskedImageoperator= (MaskedImage const &rhs)
 Make the lhs use the rhs's pixels. More...
 
virtual ~MaskedImage ()
 
void swap (MaskedImage &rhs)
 
MaskedImageoperator= (Pixel const &rhs)
 
MaskedImageoperator= (SinglePixel const &rhs)
 
void operator<<= (MaskedImage const &rhs)
 
void operator+= (ImagePixelT const rhs)
 Add a scalar rhs to a MaskedImage. More...
 
void operator+= (MaskedImage const &rhs)
 
void operator+= (lsst::afw::image::Image< ImagePixelT > const &rhs)
 
void operator+= (lsst::afw::math::Function2< double > const &function)
 
void scaledPlus (double const c, MaskedImage const &rhs)
 
void operator-= (ImagePixelT const rhs)
 Subtract a scalar rhs from a MaskedImage. More...
 
void operator-= (MaskedImage const &rhs)
 
void operator-= (lsst::afw::image::Image< ImagePixelT > const &rhs)
 
void operator-= (lsst::afw::math::Function2< double > const &function)
 
void scaledMinus (double const c, MaskedImage const &rhs)
 
void operator*= (ImagePixelT const rhs)
 
void operator*= (MaskedImage const &rhs)
 
void operator*= (lsst::afw::image::Image< ImagePixelT > const &rhs)
 
void scaledMultiplies (double const c, MaskedImage const &rhs)
 
void operator/= (ImagePixelT const rhs)
 
void operator/= (MaskedImage const &rhs)
 
void operator/= (lsst::afw::image::Image< ImagePixelT > const &rhs)
 
void scaledDivides (double const c, MaskedImage const &rhs)
 
void writeFits (std::string const &fileName, boost::shared_ptr< daf::base::PropertySet const > metadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > imageMetadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > maskMetadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > varianceMetadata=boost::shared_ptr< daf::base::PropertySet const >()) const
 Write a MaskedImage to a regular FITS file. More...
 
void writeFits (fits::MemFileManager &manager, boost::shared_ptr< daf::base::PropertySet const > metadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > imageMetadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > maskMetadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > varianceMetadata=boost::shared_ptr< daf::base::PropertySet const >()) const
 Write a MaskedImage to a FITS RAM file. More...
 
void writeFits (fits::Fits &fitsfile, boost::shared_ptr< daf::base::PropertySet const > metadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > imageMetadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > maskMetadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > varianceMetadata=boost::shared_ptr< daf::base::PropertySet const >()) const
 Write a MaskedImage to a FITS RAM file. More...
 
ImagePtr getImage (bool const noThrow=false) const
 Return a (Ptr to) the MaskedImage's image. More...
 
MaskPtr getMask (bool const noThrow=false) const
 Return a (Ptr to) the MaskedImage's mask. More...
 
VariancePtr getVariance (bool const noThrow=false) const
 Return a (Ptr to) the MaskedImage's variance. More...
 
int getWidth () const
 Return the number of columns in the image. More...
 
int getHeight () const
 Return the number of rows in the image. More...
 
geom::Extent2I getDimensions () const
 
geom::Box2I getBBox (ImageOrigin const origin=PARENT) const
 
int getX0 () const
 
int getY0 () const
 
geom::Point2I getXY0 () const
 
void setXY0 (int const x0, int const y0)
 
void setXY0 (geom::Point2I const origin)
 
double indexToPosition (double ind, lsst::afw::image::xOrY const xy) const
 Convert image index to image position (see Image::indexToPosition) More...
 
std::pair< int, double > positionToIndex (double const pos, lsst::afw::image::xOrY const xy) const
 Convert image position to index (see Image::positionToIndex) More...
 
iterator begin () const
 Return an iterator to the start of the image. More...
 
iterator end () const
 Return an iterator to the end of the image. More...
 
iterator at (int const x, int const y) const
 Return an iterator at the point (x, y) More...
 
reverse_iterator rbegin () const
 Return a reverse_iterator to the start of the image. More...
 
reverse_iterator rend () const
 Return a reverse_iterator to the end of the image. More...
 
fast_iterator begin (bool) const
 
fast_iterator end (bool) const
 
x_iterator row_begin (int y) const
 Return an x_iterator to the start of the image. More...
 
x_iterator row_end (int y) const
 Return an x_iterator to the end of the image. More...
 
x_iterator x_at (int x, int y) const
 Return an x_iterator at the point (x, y) More...
 
y_iterator col_begin (int x) const
 Return an y_iterator to the start of the image. More...
 
y_iterator col_end (int x) const
 Return an y_iterator to the end of the image. More...
 
y_iterator y_at (int x, int y) const
 Return an y_iterator at the point (x, y) More...
 
xy_locator xy_at (int x, int y) const
 Return an xy_locator at the point (x, y) More...
 
- Public Member Functions inherited from lsst::daf::base::Persistable
 Persistable (void)
 
virtual ~Persistable (void)
 
template<class Archive >
void serialize (Archive &, unsigned int const)
 
- Public Member Functions inherited from lsst::daf::base::Citizen
 Citizen (const std::type_info &)
 
 Citizen (Citizen const &)
 
 ~Citizen ()
 
Citizenoperator= (Citizen const &)
 
std::string repr () const
 Return a string representation of a Citizen. More...
 
void markPersistent (void)
 Mark a Citizen as persistent and not destroyed until process end. More...
 
memId getId () const
 Return the Citizen's ID. More...
 

Static Public Member Functions

static MaskedImage readFits (std::string const &filename)
 Read a MaskedImage from a regular FITS file. More...
 
static MaskedImage readFits (fits::MemFileManager &manager)
 Read a MaskedImage from a FITS RAM file. More...
 
- Static Public Member Functions inherited from lsst::daf::base::Citizen
static bool hasBeenCorrupted ()
 Check all allocated blocks for corruption. More...
 
static memId getNextMemId ()
 Return the memId of the next object to be allocated. More...
 
static int init ()
 Called once when the memory system is being initialised. More...
 
static int census (int, memId startingMemId=0)
 How many active Citizens are there? More...
 
static void census (std::ostream &stream, memId startingMemId=0)
 Print a list of all active Citizens to stream, sorted by ID. More...
 
static const std::vector
< const Citizen * > * 
census ()
 Return a (newly allocated) std::vector of active Citizens sorted by ID. More...
 
static memId setNewCallbackId (memId id)
 Call the NewCallback when block is allocated. More...
 
static memId setDeleteCallbackId (memId id)
 Call the current DeleteCallback when block is deleted. More...
 
static memNewCallback setNewCallback (memNewCallback func)
 Set the NewCallback function. More...
 
static memCallback setDeleteCallback (memCallback func)
 Set the DeleteCallback function. More...
 
static memCallback setCorruptionCallback (memCallback func)
 Set the CorruptionCallback function. More...
 

Private Member Functions

void conformSizes ()
 

Private Attributes

ImagePtr _image
 
MaskPtr _mask
 
VariancePtr _variance
 

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.

Examples:
footprintFunctor.cc, imageStatistics.cc, maskedImage1.cc, maskedImage2.cc, spatialCellExample.cc, and testSpatialCell.h.

Definition at line 77 of file MaskedImage.h.

Member Typedef Documentation

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

Definition at line 567 of file MaskedImage.h.

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

A const_iterator to a row of a MaskedImage.

Definition at line 581 of file MaskedImage.h.

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

A const_locator for a MaskedImage.

Definition at line 597 of file MaskedImage.h.

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

A const_iterator to a column of a MaskedImage.

Definition at line 590 of file MaskedImage.h.

template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
typedef boost::shared_ptr<const MaskedImage> lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::ConstPtr

Definition at line 88 of file MaskedImage.h.

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

A fast STL compliant iterator for contiguous images N.b. The order of pixel access is undefined

Definition at line 584 of file MaskedImage.h.

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

Definition at line 93 of file MaskedImage.h.

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

Definition at line 96 of file MaskedImage.h.

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

shared pointer to the Image

Definition at line 81 of file MaskedImage.h.

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

Definition at line 564 of file MaskedImage.h.

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

Definition at line 94 of file MaskedImage.h.

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

The Mask's MaskPlaneDict.

Definition at line 90 of file MaskedImage.h.

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

shared pointer to the Mask

Definition at line 83 of file MaskedImage.h.

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

A Pixel in the MaskedImage.

Definition at line 115 of file MaskedImage.h.

template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
typedef boost::shared_ptr<MaskedImage> lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::Ptr

shared pointer to a MaskedImage

Definition at line 87 of file MaskedImage.h.

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

Definition at line 570 of file MaskedImage.h.

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

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

Definition at line 123 of file MaskedImage.h.

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

Definition at line 92 of file MaskedImage.h.

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

shared pointer to the variance Image

Definition at line 85 of file MaskedImage.h.

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

An iterator to a row of a MaskedImage.

Definition at line 578 of file MaskedImage.h.

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

A locator for a MaskedImage.

Definition at line 594 of file MaskedImage.h.

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

an x_iterator associated with an xy_locator

Definition at line 601 of file MaskedImage.h.

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

an y_iterator associated with an xy_locator

Definition at line 604 of file MaskedImage.h.

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

An iterator to a column of a MaskedImage.

Definition at line 587 of file MaskedImage.h.

Constructor & Destructor Documentation

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.

Constructors

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

Definition at line 53 of file MaskedImage.cc.

57  :
58  lsst::daf::base::Citizen(typeid(this)),
59  _image(new Image(width, height)),
60  _mask(new Mask(width, height, planeDict)),
62  *_image = 0;
63  *_mask = 0x0;
64  *_variance = 0;
65 }
lsst::afw::image::Mask< MaskPixelT > Mask
Definition: MaskedImage.h:94
void ImageT ImageT int float saturatedPixelValue int const width
Definition: saturated.cc:44
void ImageT ImageT int float saturatedPixelValue int const height
Definition: saturated.cc:44
lsst::afw::image::Image< VariancePixelT > Variance
Definition: MaskedImage.h:92
lsst::afw::image::Image< ImagePixelT > Image
Definition: MaskedImage.h:93
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( geom::Extent2I const &  dimensions = geom::Extent2I(),
MaskPlaneDict const &  planeDict = MaskPlaneDict() 
)
explicit

Construct from a supplied dimensions. The Image, Mask, and Variance will be set to zero.

Constructors

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

Definition at line 72 of file MaskedImage.cc.

75  :
76  lsst::daf::base::Citizen(typeid(this)),
77  _image(new Image(dimensions)),
78  _mask(new Mask(dimensions, planeDict)),
80  *_image = 0;
81  *_mask = 0x0;
82  *_variance = 0;
83 }
lsst::afw::image::Mask< MaskPixelT > Mask
Definition: MaskedImage.h:94
afw::table::PointKey< int > dimensions
Definition: GaussianPsf.cc:42
lsst::afw::image::Image< VariancePixelT > Variance
Definition: MaskedImage.h:92
lsst::afw::image::Image< ImagePixelT > Image
Definition: MaskedImage.h:93
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
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 271 of file MaskedImage.cc.

275  :
276  lsst::daf::base::Citizen(typeid(this)),
277  _image(image),
278  _mask(mask),
279  _variance(variance) {
280  conformSizes();
281 }
table::Key< table::Array< Kernel::Pixel > > image
Definition: FixedKernel.cc:117
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( 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

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
Parameters
bboxdimensions of image: width x height
planeDictMake Mask conform to this mask layout (ignore if empty)

Definition at line 94 of file MaskedImage.cc.

97  :
98  lsst::daf::base::Citizen(typeid(this)),
99  _image(new Image(bbox)),
100  _mask(new Mask(bbox, planeDict)),
101  _variance(new Variance(bbox)) {
102  *_image = 0;
103  *_mask = 0x0;
104  *_variance = 0;
105 }
lsst::afw::image::Mask< MaskPixelT > Mask
Definition: MaskedImage.h:94
lsst::afw::image::Image< VariancePixelT > Variance
Definition: MaskedImage.h:92
lsst::afw::image::Image< ImagePixelT > Image
Definition: MaskedImage.h:93
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( std::string const &  fileName,
boost::shared_ptr< daf::base::PropertySet metadata = boost::shared_ptr< daf::base::PropertySet >(),
geom::Box2I const &  bbox = geom::Box2I(),
ImageOrigin  origin = PARENT,
bool  conformMasks = false,
bool  needAllHdus = false,
boost::shared_ptr< daf::base::PropertySet imageMetadata = boost::shared_ptr< daf::base::PropertySet >(),
boost::shared_ptr< daf::base::PropertySet maskMetadata = boost::shared_ptr< daf::base::PropertySet >(),
boost::shared_ptr< daf::base::PropertySet varianceMetadata = boost::shared_ptr< daf::base::PropertySet >() 
)
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.

Definition at line 108 of file MaskedImage.cc.

114  : lsst::daf::base::Citizen(typeid(this)),
115  _image(), _mask(), _variance()
116 {
117  fits::Fits fitsfile(fileName, "r", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
118  *this = MaskedImage(fitsfile, metadata, bbox, origin, conformMasks, needAllHdus,
119  imageMetadata, maskMetadata, varianceMetadata);
120  }
MaskedImage(unsigned int width, unsigned int height, MaskPlaneDict const &planeDict=MaskPlaneDict())
Construct from a supplied dimensions. The Image, Mask, and Variance will be set to zero...
Definition: MaskedImage.cc:53
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( fits::MemFileManager manager,
boost::shared_ptr< daf::base::PropertySet metadata = boost::shared_ptr< daf::base::PropertySet >(),
geom::Box2I const &  bbox = geom::Box2I(),
ImageOrigin  origin = PARENT,
bool  conformMasks = false,
bool  needAllHdus = false,
boost::shared_ptr< daf::base::PropertySet imageMetadata = boost::shared_ptr< daf::base::PropertySet >(),
boost::shared_ptr< daf::base::PropertySet maskMetadata = boost::shared_ptr< daf::base::PropertySet >(),
boost::shared_ptr< daf::base::PropertySet varianceMetadata = boost::shared_ptr< daf::base::PropertySet >() 
)
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.

Definition at line 123 of file MaskedImage.cc.

129  : lsst::daf::base::Citizen(typeid(this)),
130  _image(), _mask(), _variance()
131 {
132  fits::Fits fitsfile(manager, "r", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
133  *this = MaskedImage(fitsfile, metadata, bbox, origin, conformMasks, needAllHdus,
134  imageMetadata, maskMetadata, varianceMetadata);
135 }
MaskedImage(unsigned int width, unsigned int height, MaskPlaneDict const &planeDict=MaskPlaneDict())
Construct from a supplied dimensions. The Image, Mask, and Variance will be set to zero...
Definition: MaskedImage.cc:53
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( fits::Fits fitsfile,
boost::shared_ptr< daf::base::PropertySet metadata = boost::shared_ptr< daf::base::PropertySet >(),
geom::Box2I const &  bbox = geom::Box2I(),
ImageOrigin  origin = PARENT,
bool  conformMasks = false,
bool  needAllHdus = false,
boost::shared_ptr< daf::base::PropertySet imageMetadata = boost::shared_ptr< daf::base::PropertySet >(),
boost::shared_ptr< daf::base::PropertySet maskMetadata = boost::shared_ptr< daf::base::PropertySet >(),
boost::shared_ptr< daf::base::PropertySet varianceMetadata = boost::shared_ptr< daf::base::PropertySet >() 
)
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.

Definition at line 170 of file MaskedImage.cc.

176  : lsst::daf::base::Citizen(typeid(this)),
177  _image(), _mask(), _variance()
178 {
179  // When reading a standard Masked Image, we expect four HDUs:
180  // * The primary (HDU 1) is empty;
181  // * The first extension (HDU 2) contains the image data;
182  // * The second extension (HDU 3) contains mask data;
183  // * The third extension (HDU 4) contains the variance.
184  //
185  // If the image HDU is unreadable, we will throw.
186  //
187  // If the user has specified a non-default HDU, we load image data from
188  // that HDU, but do not attempt to load mask/variance data; rather, log a
189  // warning and return (blank) defaults.
190  //
191  // If the mask and/or variance is unreadable, we log a warning and return
192  // (blank) defaults.
193 
194  // We log warnings about image loading through a child logger, so the user
195  // can disable them if required.
196  pex::logging::Log log(pex::logging::Log::getDefaultLog(), "afw.image.MaskedImage");
197 
198  enum class Hdu {
199  Primary = 1,
200  Image,
201  Mask,
202  Variance
203  };
204 
205  // If the user has requested a non-default HDU and we require all HDUs, we fail.
206  if (needAllHdus && fitsfile.getHdu() > static_cast<int>(Hdu::Image)) {
207  throw LSST_EXCEPT(fits::FitsError,
208  "Cannot read all HDUs starting from non-default");
209  }
210 
211  if (metadata) {
212  // Read primary metadata - only if user asks for it.
213  // If the primary HDU is not empty, this may be the same as imageMetadata.
214  auto prevHdu = fitsfile.getHdu();
215  fitsfile.setHdu(static_cast<int>(Hdu::Primary));
216  fitsfile.readMetadata(*metadata);
217  fitsfile.setHdu(prevHdu);
218  }
219 
220  // setHdu(0) jumps to the first extension iff the primary HDU is both
221  // empty and currently selected.
222  fitsfile.setHdu(0);
223  ensureMetadata(imageMetadata);
224  _image.reset(new Image(fitsfile, imageMetadata, bbox, origin));
225  checkExtType(fitsfile, imageMetadata, "IMAGE");
226 
227  if (fitsfile.getHdu() != static_cast<int>(Hdu::Image)) {
228  // Reading the image from a non-default HDU means we do not attempt to
229  // read mask and variance.
230  _mask.reset(new Mask(_image->getBBox()));
231  _variance.reset(new Variance(_image->getBBox()));
232  } else {
233  try {
234  fitsfile.setHdu(static_cast<int>(Hdu::Mask));
235  ensureMetadata(maskMetadata);
236  _mask.reset(new Mask(fitsfile, maskMetadata, bbox, origin, conformMasks));
237  checkExtType(fitsfile, maskMetadata, "MASK");
238  } catch(fits::FitsError &e) {
239  if (needAllHdus) {
240  LSST_EXCEPT_ADD(e, "Reading Mask");
241  throw e;
242  }
243  log.warn("Mask unreadable; using default");
244  // By resetting the status we are able to read the next HDU (the variance).
245  fitsfile.status = 0;
246  _mask.reset(new Mask(_image->getBBox()));
247  }
248 
249  try {
250  fitsfile.setHdu(static_cast<int>(Hdu::Variance));
251  ensureMetadata(varianceMetadata);
252  _variance.reset(new Variance(fitsfile, varianceMetadata, bbox, origin));
253  checkExtType(fitsfile, varianceMetadata, "VARIANCE");
254  } catch(fits::FitsError &e) {
255  if (needAllHdus) {
256  LSST_EXCEPT_ADD(e, "Reading Variance");
257  throw e;
258  }
259  log.warn("Variance unreadable; using default");
260  fitsfile.status = 0;
261  _variance.reset(new Variance(_image->getBBox()));
262  }
263  }
264 }
lsst::afw::image::Mask< MaskPixelT > Mask
Definition: MaskedImage.h:94
static Log & getDefaultLog()
def log
Definition: log.py:85
lsst::afw::image::Image< VariancePixelT > Variance
Definition: MaskedImage.h:92
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
lsst::afw::image::Image< ImagePixelT > Image
Definition: MaskedImage.h:93
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
#define LSST_EXCEPT_ADD(e, m)
Definition: Exception.h:51
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 287 of file MaskedImage.cc.

290  :
291  lsst::daf::base::Citizen(typeid(this)),
292  _image(rhs._image), _mask(rhs._mask), _variance(rhs._variance) {
293  if (deep) {
294  _image = typename Image::Ptr(new Image(*rhs.getImage(), deep));
295  _mask = typename Mask::Ptr(new Mask(*rhs.getMask(), deep));
296  _variance = typename Variance::Ptr(new Variance(*rhs.getVariance(), deep));
297  }
298  conformSizes();
299 }
lsst::afw::image::Mask< MaskPixelT > Mask
Definition: MaskedImage.h:94
boost::shared_ptr< Image< ImagePixelT > > Ptr
Definition: Image.h:418
lsst::afw::image::Image< VariancePixelT > Variance
Definition: MaskedImage.h:92
boost::shared_ptr< Mask > Ptr
Definition: Mask.h:95
lsst::afw::image::Image< ImagePixelT > Image
Definition: MaskedImage.h:93
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::MaskedImage ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const &  rhs,
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 305 of file MaskedImage.cc.

311  :
312  lsst::daf::base::Citizen(typeid(this)),
313  _image(new Image(*rhs.getImage(), bbox, origin, deep)),
314  _mask(rhs._mask ? new Mask(*rhs.getMask(), bbox, origin, deep) : static_cast<Mask *>(NULL)),
315  _variance(rhs._variance ? new Variance(*rhs.getVariance(), bbox, origin, deep) : static_cast<Variance *>(NULL)) {
316  conformSizes();
317 }
lsst::afw::image::Mask< MaskPixelT > Mask
Definition: MaskedImage.h:94
lsst::afw::image::Image< VariancePixelT > Variance
Definition: MaskedImage.h:92
lsst::afw::image::Image< ImagePixelT > Image
Definition: MaskedImage.h:93
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
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 717 of file MaskedImage.h.

721  :
722  lsst::daf::base::Citizen(typeid(this)), _image(), _mask(), _variance() {
723  if (!deep) {
724  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
725  "Only deep copies are permitted for MaskedImages with different pixel types");
726  }
727 
728  _image = typename Image::Ptr(new Image(*rhs.getImage(), deep));
729  _mask = typename Mask::Ptr(new Mask(*rhs.getMask(), deep));
730  _variance = typename Variance::Ptr(new Variance(*rhs.getVariance(), deep));
731  }
lsst::afw::image::Mask< MaskPixelT > Mask
Definition: MaskedImage.h:94
boost::shared_ptr< Image< ImagePixelT > > Ptr
Definition: Image.h:418
lsst::afw::image::Image< VariancePixelT > Variance
Definition: MaskedImage.h:92
boost::shared_ptr< Mask > Ptr
Definition: Mask.h:95
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
lsst::afw::image::Image< ImagePixelT > Image
Definition: MaskedImage.h:93
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
Definition: Citizen.h:56
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
virtual lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::~MaskedImage ( )
inlinevirtual

Definition at line 737 of file MaskedImage.h.

737 {}

Member Function Documentation

template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
image::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 712 of file MaskedImage.cc.

712  {
713  typename Image::iterator imageEnd = getImage()->at(x, y);
714  typename Mask::iterator maskEnd = getMask()->at(x, y);
715  typename Variance::iterator varianceEnd = getVariance()->at(x, y);
716 
717  return iterator(imageEnd, maskEnd, varianceEnd);
718 }
int y
ImagePtr getImage(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s image.
Definition: MaskedImage.h:869
MaskedImageIterator< typename Image::iterator, typename Mask::iterator, typename Variance::iterator > iterator
Definition: MaskedImage.h:564
VariancePtr getVariance(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s variance.
Definition: MaskedImage.h:890
_view_t::iterator iterator
An STL compliant iterator.
Definition: Image.h:143
MaskPtr getMask(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s mask.
Definition: MaskedImage.h:879
double x
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
image::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 688 of file MaskedImage.cc.

688  {
689 #if 0 // this doesn't compile; why?
690  return iterator(_image->begin(), _mask->begin(), _variance->begin());
691 #else
692  typename Image::iterator imageBegin = _image->begin();
693  typename Mask::iterator maskBegin = _mask->begin();
694  typename Variance::iterator varianceBegin = _variance->begin();
695 
696  return iterator(imageBegin, maskBegin, varianceBegin);
697 #endif
698 }
MaskedImageIterator< typename Image::iterator, typename Mask::iterator, typename Variance::iterator > iterator
Definition: MaskedImage.h:564
_view_t::iterator iterator
An STL compliant iterator.
Definition: Image.h:143
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
image::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.

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

Definition at line 792 of file MaskedImage.cc.

794  {
795  typename Image::fast_iterator imageBegin = _image->begin(contiguous);
796  typename Mask::fast_iterator maskBegin = _mask->begin(contiguous);
797  typename Variance::fast_iterator varianceBegin = _variance->begin(contiguous);
798 
799  return fast_iterator(imageBegin, maskBegin, varianceBegin);
800 }
x_iterator fast_iterator
Definition: Image.h:154
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
image::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 764 of file MaskedImage.cc.

764  {
765  typename Image::y_iterator imageBegin = _image->col_begin(x);
766  typename Mask::y_iterator maskBegin = _mask->col_begin(x);
767  typename Variance::y_iterator varianceBegin = _variance->col_begin(x);
768 
769  return y_iterator(imageBegin, maskBegin, varianceBegin);
770 }
MaskedImageIterator< typename Image::y_iterator, typename Mask::y_iterator, typename Variance::y_iterator > y_iterator
An iterator to a column of a MaskedImage.
Definition: MaskedImage.h:587
_view_t::y_iterator y_iterator
An iterator for traversing the pixels in a column.
Definition: Image.h:160
double x
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
image::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 774 of file MaskedImage.cc.

774  {
775  typename Image::y_iterator imageEnd = getImage()->col_end(x);
776  typename Mask::y_iterator maskEnd = getMask()->col_end(x);
777  typename Variance::y_iterator varianceEnd = getVariance()->col_end(x);
778 
779  return y_iterator(imageEnd, maskEnd, varianceEnd);
780 }
ImagePtr getImage(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s image.
Definition: MaskedImage.h:869
VariancePtr getVariance(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s variance.
Definition: MaskedImage.h:890
MaskedImageIterator< typename Image::y_iterator, typename Mask::y_iterator, typename Variance::y_iterator > y_iterator
An iterator to a column of a MaskedImage.
Definition: MaskedImage.h:587
MaskPtr getMask(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s mask.
Definition: MaskedImage.h:879
_view_t::y_iterator y_iterator
An iterator for traversing the pixels in a column.
Definition: Image.h:160
double x
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::conformSizes ( )
private

Definition at line 649 of file MaskedImage.cc.

649  {
650 
651  if (!_mask || _mask->getWidth() == 0 || _mask->getHeight() == 0) {
652  _mask = MaskPtr(new Mask(_image->getBBox()));
653  *_mask = 0;
654  } else {
655  if (_mask->getDimensions() != _image->getDimensions()) {
656  throw LSST_EXCEPT(
657  lsst::pex::exceptions::LengthError,
658  (boost::format("Dimension mismatch: Image %dx%d v. Mask %dx%d") %
659  _image->getWidth() % _image->getHeight() %
660  _mask->getWidth() % _mask->getHeight()
661  ).str()
662  );
663  }
664  }
665 
666  if (!_variance || _variance->getWidth() == 0 || _variance->getHeight() == 0) {
667  _variance = VariancePtr(new Variance(_image->getBBox()));
668  *_variance = 0;
669  } else {
670  if (_variance->getDimensions() != _image->getDimensions()) {
671  throw LSST_EXCEPT(
672  lsst::pex::exceptions::LengthError,
673  (boost::format("Dimension mismatch: Image %dx%d v. Variance %dx%d") %
674  _image->getWidth() % _image->getHeight() %
675  _variance->getWidth() % _variance->getHeight()
676  ).str()
677  );
678  }
679  }
680 }
Image< VariancePixelT >::Ptr VariancePtr
shared pointer to the variance Image
Definition: MaskedImage.h:85
lsst::afw::image::Mask< MaskPixelT > Mask
Definition: MaskedImage.h:94
lsst::afw::image::Image< VariancePixelT > Variance
Definition: MaskedImage.h:92
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
Mask< MaskPixelT >::Ptr MaskPtr
shared pointer to the Mask
Definition: MaskedImage.h:83
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
image::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 702 of file MaskedImage.cc.

702  {
703  typename Image::iterator imageEnd = getImage()->end();
704  typename Mask::iterator maskEnd = getMask()->end();
705  typename Variance::iterator varianceEnd = getVariance()->end();
706 
707  return iterator(imageEnd, maskEnd, varianceEnd);
708 }
ImagePtr getImage(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s image.
Definition: MaskedImage.h:869
MaskedImageIterator< typename Image::iterator, typename Mask::iterator, typename Variance::iterator > iterator
Definition: MaskedImage.h:564
VariancePtr getVariance(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s variance.
Definition: MaskedImage.h:890
_view_t::iterator iterator
An STL compliant iterator.
Definition: Image.h:143
MaskPtr getMask(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s mask.
Definition: MaskedImage.h:879
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
image::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.

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

Definition at line 809 of file MaskedImage.cc.

811  {
812  typename Image::fast_iterator imageEnd = getImage()->end(contiguous);
813  typename Mask::fast_iterator maskEnd = getMask()->end(contiguous);
814  typename Variance::fast_iterator varianceEnd = getVariance()->end(contiguous);
815 
816  return fast_iterator(imageEnd, maskEnd, varianceEnd);
817 }
x_iterator fast_iterator
Definition: Image.h:154
ImagePtr getImage(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s image.
Definition: MaskedImage.h:869
VariancePtr getVariance(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s variance.
Definition: MaskedImage.h:890
MaskPtr getMask(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s mask.
Definition: MaskedImage.h:879
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
geom::Box2I lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::getBBox ( ImageOrigin const  origin = PARENT) const
inline

Definition at line 905 of file MaskedImage.h.

905 {return _image->getBBox(origin);}
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
geom::Extent2I lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::getDimensions ( ) const
inline

Definition at line 904 of file MaskedImage.h.

904 {return _image->getDimensions();}
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 903 of file MaskedImage.h.

903 { return _image->getHeight(); }
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
ImagePtr lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::getImage ( bool const  noThrow = false) const
inline

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

Definition at line 869 of file MaskedImage.h.

869  {
870  if (!_image && !noThrow) {
871  throw LSST_EXCEPT(
872  lsst::pex::exceptions::RuntimeError,
873  "MaskedImage's Image is NULL"
874  );
875  }
876  return _image;
877  }
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
MaskPtr lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::getMask ( bool const  noThrow = false) const
inline

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

Definition at line 879 of file MaskedImage.h.

879  {
880  if (!_mask && !noThrow) {
881  throw LSST_EXCEPT(
882  lsst::pex::exceptions::RuntimeError,
883  "MaskedImage's Mask is NULL"
884  );
885  }
886 
887  return _mask;
888  }
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
VariancePtr lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::getVariance ( bool const  noThrow = false) const
inline

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

Definition at line 890 of file MaskedImage.h.

890  {
891  if (!_variance && !noThrow) {
892  throw LSST_EXCEPT(
893  lsst::pex::exceptions::RuntimeError,
894  "MaskedImage's Variance is NULL"
895  );
896  }
897 
898  return _variance;
899  }
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
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 901 of file MaskedImage.h.

901 { return _image->getWidth(); }
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 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 913 of file MaskedImage.h.

913 { return _image->getX0(); }
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
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 929 of file MaskedImage.h.

929 { return _image->getXY0(); }
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 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 921 of file MaskedImage.h.

921 { return _image->getY0(); }
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 971 of file MaskedImage.h.

974  {
975  return getImage()->indexToPosition(ind, xy);
976  }
ImagePtr getImage(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s image.
Definition: MaskedImage.h:869
template<typename ImagePixelT, typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator*= ( ImagePixelT const  rhs)

Definition at line 499 of file MaskedImage.cc.

499  {
500  *_image *= rhs;
501  *_variance *= rhs*rhs;
502 }
template<typename ImagePixelT, typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator*= ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const &  rhs)

Definition at line 470 of file MaskedImage.cc.

470  {
471  // Must do variance before we modify the image values
472  transform_pixels(_image->_getRawView(), // lhs
473  rhs._image->_getRawView(), // rhs,
474  _variance->_getRawView(), // Var(lhs),
475  rhs._variance->_getRawView(), // Var(rhs)
476  _variance->_getRawView(), // result
477  productVariance<ImagePixelT, VariancePixelT>());
478 
479  *_image *= *rhs.getImage();
480  *_mask |= *rhs.getMask();
481 }
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator*= ( lsst::afw::image::Image< ImagePixelT > const &  rhs)
inline

Definition at line 769 of file MaskedImage.h.

769  {
770  *_image *= rhs;
771  *_variance *= rhs; // yes, multiply twice
772  *_variance *= rhs;
773  }
template<typename ImagePixelT, typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator+= ( ImagePixelT const  rhs)

Add a scalar rhs to a MaskedImage.

Definition at line 414 of file MaskedImage.cc.

414  {
415  *_image += rhs;
416 }
template<typename ImagePixelT, typename MaskPixelT , typename VariancePixelT >
void 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 391 of file MaskedImage.cc.

391  {
392  *_image += *rhs.getImage();
393  *_mask |= *rhs.getMask();
394  *_variance += *rhs.getVariance();
395 }
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator+= ( lsst::afw::image::Image< ImagePixelT > const &  rhs)
inline

Definition at line 749 of file MaskedImage.h.

749  {
750  *_image += rhs;
751  }
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator+= ( lsst::afw::math::Function2< double > const &  function)
inline

Definition at line 752 of file MaskedImage.h.

752  {
753  *_image += function;
754  }
template<typename ImagePixelT, typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator-= ( ImagePixelT const  rhs)

Subtract a scalar rhs from a MaskedImage.

Definition at line 445 of file MaskedImage.cc.

445  {
446  *_image -= rhs;
447 }
template<typename ImagePixelT, typename MaskPixelT , typename VariancePixelT >
void 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 424 of file MaskedImage.cc.

424  {
425  *_image -= *rhs.getImage();
426  *_mask |= *rhs.getMask();
427  *_variance += *rhs.getVariance();
428 }
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator-= ( lsst::afw::image::Image< ImagePixelT > const &  rhs)
inline

Definition at line 759 of file MaskedImage.h.

759  {
760  *_image -= rhs;
761  }
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator-= ( lsst::afw::math::Function2< double > const &  function)
inline

Definition at line 762 of file MaskedImage.h.

762  {
763  *_image -= function;
764  }
template<typename ImagePixelT, typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator/= ( ImagePixelT const  rhs)

Definition at line 556 of file MaskedImage.cc.

556  {
557  *_image /= rhs;
558  *_variance /= rhs*rhs;
559 }
template<typename ImagePixelT, typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator/= ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const &  rhs)

Definition at line 527 of file MaskedImage.cc.

527  {
528  // Must do variance before we modify the image values
529  transform_pixels(_image->_getRawView(), // lhs
530  rhs._image->_getRawView(), // rhs,
531  _variance->_getRawView(), // Var(lhs),
532  rhs._variance->_getRawView(), // Var(rhs)
533  _variance->_getRawView(), // result
534  quotientVariance<ImagePixelT, VariancePixelT>());
535 
536  *_image /= *rhs.getImage();
537  *_mask |= *rhs.getMask();
538 }
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator/= ( lsst::afw::image::Image< ImagePixelT > const &  rhs)
inline

Definition at line 778 of file MaskedImage.h.

778  {
779  *_image /= rhs;
780  *_variance /= rhs; // yes, divide twice
781  *_variance /= rhs;
782  }
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator<<= ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const &  rhs)

Copy the pixels from the rhs to the lhs

Note
operator=() is not equivalent to this command

Definition at line 377 of file MaskedImage.cc.

377  {
378  *_image <<= *rhs.getImage();
379  *_mask <<= *rhs.getMask();
380  *_variance <<= *rhs.getVariance();
381 }
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > & lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::operator= ( image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const &  rhs)

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 operator<<=()

Parameters
rhsRight hand side

Definition at line 328 of file MaskedImage.cc.

329  {}
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
image::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 350 of file MaskedImage.cc.

350  {
351  *_image = rhs.image();
352  *_mask = rhs.mask();
353  *_variance = rhs.variance();
354 
355  return *this;
356 }
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
image::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 363 of file MaskedImage.cc.

363  {
364  *_image = rhs.image();
365  *_mask = rhs.mask();
366  *_variance = rhs.variance();
367 
368  return *this;
369 }
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 983 of file MaskedImage.h.

986  {
987  return getImage()->positionToIndex(pos, xy);
988  }
ImagePtr getImage(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s image.
Definition: MaskedImage.h:869
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
image::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 722 of file MaskedImage.cc.

722  {
723  typename Image::reverse_iterator imageBegin = _image->rbegin();
724  typename Mask::reverse_iterator maskBegin = _mask->rbegin();
725  typename Variance::reverse_iterator varianceBegin = _variance->rbegin();
726 
727  return reverse_iterator(imageBegin, maskBegin, varianceBegin);
728 }
_view_t::reverse_iterator reverse_iterator
An STL compliant reverse iterator.
Definition: Image.h:147
MaskedImageIterator< typename Image::reverse_iterator, typename Mask::reverse_iterator, typename Variance::reverse_iterator > reverse_iterator
Definition: MaskedImage.h:570
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 854 of file MaskedImage.h.

854  {
855  return MaskedImage<ImagePixelT, MaskPixelT, VariancePixelT>(filename);
856  }
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 863 of file MaskedImage.h.

863  {
864  return MaskedImage<ImagePixelT, MaskPixelT, VariancePixelT>(manager);
865  }
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
image::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 732 of file MaskedImage.cc.

732  {
733  typename Image::reverse_iterator imageEnd = getImage()->rend();
734  typename Mask::reverse_iterator maskEnd = getMask()->rend();
735  typename Variance::reverse_iterator varianceEnd = getVariance()->rend();
736 
737  return reverse_iterator(imageEnd, maskEnd, varianceEnd);
738 }
_view_t::reverse_iterator reverse_iterator
An STL compliant reverse iterator.
Definition: Image.h:147
ImagePtr getImage(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s image.
Definition: MaskedImage.h:869
VariancePtr getVariance(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s variance.
Definition: MaskedImage.h:890
MaskPtr getMask(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s mask.
Definition: MaskedImage.h:879
MaskedImageIterator< typename Image::reverse_iterator, typename Mask::reverse_iterator, typename Variance::reverse_iterator > reverse_iterator
Definition: MaskedImage.h:570
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
image::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 742 of file MaskedImage.cc.

742  {
743  typename Image::x_iterator imageBegin = _image->row_begin(y);
744  typename Mask::x_iterator maskBegin = _mask->row_begin(y);
745  typename Variance::x_iterator varianceBegin = _variance->row_begin(y);
746 
747  return x_iterator(imageBegin, maskBegin, varianceBegin);
748 }
int y
_view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
Definition: Image.h:151
MaskedImageIterator< typename Image::x_iterator, typename Mask::x_iterator, typename Variance::x_iterator > x_iterator
An iterator to a row of a MaskedImage.
Definition: MaskedImage.h:578
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
image::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 752 of file MaskedImage.cc.

752  {
753  typename Image::x_iterator imageEnd = getImage()->row_end(y);
754  typename Mask::x_iterator maskEnd = getMask()->row_end(y);
755  typename Variance::x_iterator varianceEnd = getVariance()->row_end(y);
756 
757  return x_iterator(imageEnd, maskEnd, varianceEnd);
758 }
int y
_view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
Definition: Image.h:151
MaskedImageIterator< typename Image::x_iterator, typename Mask::x_iterator, typename Variance::x_iterator > x_iterator
An iterator to a row of a MaskedImage.
Definition: MaskedImage.h:578
ImagePtr getImage(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s image.
Definition: MaskedImage.h:869
VariancePtr getVariance(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s variance.
Definition: MaskedImage.h:890
MaskPtr getMask(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s mask.
Definition: MaskedImage.h:879
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 541 of file MaskedImage.cc.

542  {
543  // Must do variance before we modify the image values
544  transform_pixels(_image->_getRawView(), // lhs
545  rhs._image->_getRawView(), // rhs,
546  _variance->_getRawView(), // Var(lhs),
547  rhs._variance->_getRawView(), // Var(rhs)
548  _variance->_getRawView(), // result
549  scaledQuotientVariance<ImagePixelT, VariancePixelT>(c));
550 
551  (*_image).scaledDivides(c, *rhs.getImage());
552  *_mask |= *rhs._mask;
553 }
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 436 of file MaskedImage.cc.

437  {
438  (*_image).scaledMinus(c, *rhs.getImage());
439  *_mask |= *rhs.getMask();
440  (*_variance).scaledPlus(c*c, *rhs.getVariance());
441 }
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 484 of file MaskedImage.cc.

485  {
486  // Must do variance before we modify the image values
487  transform_pixels(_image->_getRawView(), // lhs
488  rhs._image->_getRawView(), // rhs,
489  _variance->_getRawView(), // Var(lhs),
490  rhs._variance->_getRawView(), // Var(rhs)
491  _variance->_getRawView(), // result
492  scaledProductVariance<ImagePixelT, VariancePixelT>(c));
493 
494  (*_image).scaledMultiplies(c, *rhs.getImage());
495  *_mask |= *rhs.getMask();
496 }
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 405 of file MaskedImage.cc.

406  {
407  (*_image).scaledPlus(c, *rhs.getImage());
408  *_mask |= *rhs.getMask();
409  (*_variance).scaledPlus(c*c, *rhs.getVariance());
410 }
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 939 of file MaskedImage.h.

939  {
941  }
int const x0
Definition: saturated.cc:45
void setXY0(int const x0, int const y0)
Definition: MaskedImage.h:939
int const y0
Definition: saturated.cc:45
template<typename ImagePixelT, typename MaskPixelT = lsst::afw::image::MaskPixel, typename VariancePixelT = lsst::afw::image::VariancePixel>
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::setXY0 ( 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 951 of file MaskedImage.h.

951  {
952  if (_image) {
953  _image->setXY0(origin);
954  }
955 
956  if (_mask) {
957  _mask->setXY0(origin);
958  }
959 
960  if (_variance) {
961  _variance->setXY0(origin);
962  }
963  }
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::swap ( MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > &  rhs)

Definition at line 333 of file MaskedImage.cc.

333  {
334  using std::swap; // See Meyers, Effective C++, Item 25
335 
336  _image.swap(rhs._image);
337  _mask.swap(rhs._mask);
338  _variance.swap(rhs._variance);
339 }
void swap(ImageBase< PixelT > &a, ImageBase< PixelT > &b)
Definition: Image.cc:291
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::writeFits ( std::string const &  fileName,
boost::shared_ptr< daf::base::PropertySet const >  metadata = boost::shared_ptr< daf::base::PropertySet const>(),
boost::shared_ptr< daf::base::PropertySet const >  imageMetadata = boost::shared_ptr< daf::base::PropertySet const>(),
boost::shared_ptr< daf::base::PropertySet const >  maskMetadata = boost::shared_ptr< daf::base::PropertySet const>(),
boost::shared_ptr< daf::base::PropertySet const >  varianceMetadata = boost::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 562 of file MaskedImage.cc.

568  {
569  fits::Fits fitsfile(fileName, "w", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
570  writeFits(fitsfile, metadata, imageMetadata, maskMetadata, varianceMetadata);
571 }
void writeFits(std::string const &fileName, boost::shared_ptr< daf::base::PropertySet const > metadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > imageMetadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > maskMetadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > varianceMetadata=boost::shared_ptr< daf::base::PropertySet const >()) const
Write a MaskedImage to a regular FITS file.
Definition: MaskedImage.cc:562
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::writeFits ( fits::MemFileManager manager,
boost::shared_ptr< daf::base::PropertySet const >  metadata = boost::shared_ptr< daf::base::PropertySet const>(),
boost::shared_ptr< daf::base::PropertySet const >  imageMetadata = boost::shared_ptr< daf::base::PropertySet const>(),
boost::shared_ptr< daf::base::PropertySet const >  maskMetadata = boost::shared_ptr< daf::base::PropertySet const>(),
boost::shared_ptr< daf::base::PropertySet const >  varianceMetadata = boost::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 574 of file MaskedImage.cc.

580  {
581  fits::Fits fitsfile(manager, "w", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
582  writeFits(fitsfile, metadata, imageMetadata, maskMetadata, varianceMetadata);
583 }
void writeFits(std::string const &fileName, boost::shared_ptr< daf::base::PropertySet const > metadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > imageMetadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > maskMetadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > varianceMetadata=boost::shared_ptr< daf::base::PropertySet const >()) const
Write a MaskedImage to a regular FITS file.
Definition: MaskedImage.cc:562
template<typename ImagePixelT , typename MaskPixelT , typename VariancePixelT >
void lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT >::writeFits ( fits::Fits fitsfile,
boost::shared_ptr< daf::base::PropertySet const >  metadata = boost::shared_ptr< daf::base::PropertySet const>(),
boost::shared_ptr< daf::base::PropertySet const >  imageMetadata = boost::shared_ptr< daf::base::PropertySet const>(),
boost::shared_ptr< daf::base::PropertySet const >  maskMetadata = boost::shared_ptr< daf::base::PropertySet const>(),
boost::shared_ptr< daf::base::PropertySet const >  varianceMetadata = boost::shared_ptr< daf::base::PropertySet const>() 
) const

Write a MaskedImage to a FITS RAM 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 604 of file MaskedImage.cc.

610  {
611 
613  if (metadata) {
614  hdr = metadata->deepCopy();
615  } else {
616  hdr.reset(new daf::base::PropertyList());
617  }
618 
619  if (fitsfile.countHdus() != 0) {
620  throw LSST_EXCEPT(
621  pex::exceptions::LogicError,
622  "MaskedImage::writeFits can only write to an empty file"
623  );
624  }
625  if (fitsfile.getHdu() <= 1) {
626  // Don't ever write images to primary; instead we make an empty primary.
627  fitsfile.createEmpty();
628  } else {
629  fitsfile.setHdu(1);
630  }
631  fitsfile.writeMetadata(*hdr);
632 
633  processPlaneMetadata(imageMetadata, hdr, "IMAGE");
634  _image->writeFits(fitsfile, hdr);
635 
636  processPlaneMetadata(maskMetadata, hdr, "MASK");
637  _mask->writeFits(fitsfile, hdr);
638 
639  processPlaneMetadata(varianceMetadata, hdr, "VARIANCE");
640  _variance->writeFits(fitsfile, hdr);
641 }
#define PTR(...)
Definition: base.h:41
lsst::daf::base::PropertyList PropertyList
Definition: Wcs.cc:59
lsst::daf::base::PropertySet PropertySet
Definition: Wcs.cc:58
if(width!=gim.getWidth()||height!=gim.getHeight()||x0!=gim.getX0()||y0!=gim.getY0())
Definition: saturated.cc:47
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
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 1006 of file MaskedImage.h.

1006  {
1007 #if 0
1008  typename Image::x_iterator imageEnd = getImage()->x_at(x, y);
1009  typename Mask::x_iterator maskEnd = getMask()->x_at(x, y);
1010  typename Variance::x_iterator varianceEnd = getVariance()->x_at(x, y);
1011 #else // bypass checks for non-NULL pointers
1012  typename Image::x_iterator imageEnd = _image->x_at(x, y);
1013  typename Mask::x_iterator maskEnd = _mask->x_at(x, y);
1014  typename Variance::x_iterator varianceEnd = _variance->x_at(x, y);
1015 #endif
1016 
1017  return x_iterator(imageEnd, maskEnd, varianceEnd);
1018  }
int y
_view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
Definition: Image.h:151
MaskedImageIterator< typename Image::x_iterator, typename Mask::x_iterator, typename Variance::x_iterator > x_iterator
An iterator to a row of a MaskedImage.
Definition: MaskedImage.h:578
ImagePtr getImage(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s image.
Definition: MaskedImage.h:869
VariancePtr getVariance(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s variance.
Definition: MaskedImage.h:890
MaskPtr getMask(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s mask.
Definition: MaskedImage.h:879
double x
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 1039 of file MaskedImage.h.

1039  {
1040 #if 0
1041  typename Image::xy_locator imageEnd = getImage()->xy_at(x, y);
1042  typename Mask::xy_locator maskEnd = getMask()->xy_at(x, y);
1043  typename Variance::xy_locator varianceEnd = getVariance()->xy_at(x, y);
1044 #else // bypass checks for non-NULL pointers
1045  typename Image::xy_locator imageEnd = _image->xy_at(x, y);
1046  typename Mask::xy_locator maskEnd = _mask->xy_at(x, y);
1047  typename Variance::xy_locator varianceEnd = _variance->xy_at(x, y);
1048 #endif
1049 
1050  return xy_locator(imageEnd, maskEnd, varianceEnd);
1051  }
int y
ImagePtr getImage(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s image.
Definition: MaskedImage.h:869
VariancePtr getVariance(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s variance.
Definition: MaskedImage.h:890
MaskPtr getMask(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s mask.
Definition: MaskedImage.h:879
double x
MaskedImageLocator< typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator > xy_locator
A locator for a MaskedImage.
Definition: MaskedImage.h:594
_view_t::xy_locator xy_locator
An xy_locator.
Definition: Image.h:139
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 1024 of file MaskedImage.h.

1024  {
1025 #if 0
1026  typename Image::y_iterator imageEnd = getImage()->y_at(x, y);
1027  typename Mask::y_iterator maskEnd = getMask()->y_at(x, y);
1028  typename Variance::y_iterator varianceEnd = getVariance()->y_at(x, y);
1029 #else // bypass checks for non-NULL pointers
1030  typename Image::y_iterator imageEnd = _image->y_at(x, y);
1031  typename Mask::y_iterator maskEnd = _mask->y_at(x, y);
1032  typename Variance::y_iterator varianceEnd = _variance->y_at(x, y);
1033 #endif
1034  return y_iterator(imageEnd, maskEnd, varianceEnd);
1035  }
int y
ImagePtr getImage(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s image.
Definition: MaskedImage.h:869
VariancePtr getVariance(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s variance.
Definition: MaskedImage.h:890
MaskedImageIterator< typename Image::y_iterator, typename Mask::y_iterator, typename Variance::y_iterator > y_iterator
An iterator to a column of a MaskedImage.
Definition: MaskedImage.h:587
MaskPtr getMask(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage&#39;s mask.
Definition: MaskedImage.h:879
_view_t::y_iterator y_iterator
An iterator for traversing the pixels in a column.
Definition: Image.h:160
double x

Member Data Documentation

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

Definition at line 1058 of file MaskedImage.h.

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

Definition at line 1059 of file MaskedImage.h.

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

Definition at line 1060 of file MaskedImage.h.


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