lsst.afw  14.0-34-g2d9284d60+1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | List of all members
lsst::afw::image::Mask< MaskPixelT > Class Template Reference

Represent a 2-dimensional array of bitmask pixels. More...

#include <Mask.h>

Inheritance diagram for lsst::afw::image::Mask< MaskPixelT >:
lsst::afw::image::ImageBase< MaskPixelT > lsst::daf::base::Persistable lsst::daf::base::Citizen

Classes

struct  ImageTypeFactory
 A templated class to return this classes' type (present in Image/Mask/MaskedImage) More...
 

Public Types

typedef detail::MaskPlaneDict MaskPlaneDict
 
typedef detail::Mask_tag image_category
 
typedef MaskPixelT SinglePixel
 A single Pixel of the same type as those in the ImageBase. More...
 
typedef MaskPixelT Pixel
 A pixel in this ImageBase. More...
 
typedef Reference< MaskPixelT >::type PixelReference
 A Reference to a PixelT. More...
 
typedef ConstReference< MaskPixelT >::type PixelConstReference
 A ConstReference to a PixelT. More...
 
typedef _view_t::xy_locator xy_locator
 An xy_locator. More...
 
typedef _view_t::xy_locator::const_t const_xy_locator
 A const_xy_locator. More...
 
typedef _view_t::iterator iterator
 An STL compliant iterator. More...
 
typedef _const_view_t::iterator const_iterator
 An STL compliant const iterator. More...
 
typedef _view_t::reverse_iterator reverse_iterator
 An STL compliant reverse iterator. More...
 
typedef _const_view_t::reverse_iterator const_reverse_iterator
 An STL compliant const reverse iterator. More...
 
typedef _view_t::x_iterator x_iterator
 An iterator for traversing the pixels in a row. More...
 
typedef x_iterator fast_iterator
 A fast STL compliant iterator for contiguous images N.b. More...
 
typedef _view_t::x_iterator xy_x_iterator
 An iterator for traversing the pixels in a row, created from an xy_locator. More...
 
typedef _const_view_t::x_iterator const_x_iterator
 A const iterator for traversing the pixels in a row. More...
 
typedef _view_t::y_iterator y_iterator
 An iterator for traversing the pixels in a column. More...
 
typedef _view_t::y_iterator xy_y_iterator
 An iterator for traversing the pixels in a row, created from an xy_locator. More...
 
typedef _const_view_t::y_iterator const_y_iterator
 A const iterator for traversing the pixels in a column. More...
 
typedef ndarray::Array< MaskPixelT, 2, 1 > Array
 A mutable ndarray representation of the image. More...
 
typedef ndarray::Array< MaskPixelT const, 2, 1 > ConstArray
 An immutable ndarray representation of the image. More...
 
typedef std::shared_ptr< Persistable > Ptr
 
typedef unsigned long memId
 
typedef memId(* memNewCallback) (const memId cid)
 
typedef memId(* memCallback) (const Citizen *ptr)
 

Public Member Functions

 Mask (unsigned int width, unsigned int height, MaskPlaneDict const &planeDefs=MaskPlaneDict())
 Construct a Mask initialized to 0x0. More...
 
 Mask (unsigned int width, unsigned int height, MaskPixelT initialValue, MaskPlaneDict const &planeDefs=MaskPlaneDict())
 Construct a Mask initialized to a specified value. More...
 
 Mask (geom::Extent2I const &dimensions=geom::Extent2I(), MaskPlaneDict const &planeDefs=MaskPlaneDict())
 Construct a Mask initialized to 0x0. More...
 
 Mask (geom::Extent2I const &dimensions, MaskPixelT initialValue, MaskPlaneDict const &planeDefs=MaskPlaneDict())
 Construct a Mask initialized to a specified value. More...
 
 Mask (geom::Box2I const &bbox, MaskPlaneDict const &planeDefs=MaskPlaneDict())
 Construct a Mask initialized to 0x0. More...
 
 Mask (geom::Box2I const &bbox, MaskPixelT initialValue, MaskPlaneDict const &planeDefs=MaskPlaneDict())
 Construct a Mask initialized to a specified value. More...
 
 Mask (std::string const &fileName, int hdu=fits::DEFAULT_HDU, std::shared_ptr< lsst::daf::base::PropertySet > metadata=std::shared_ptr< lsst::daf::base::PropertySet >(), geom::Box2I const &bbox=geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false)
 Construct a Mask by reading a regular FITS file. More...
 
 Mask (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU, std::shared_ptr< lsst::daf::base::PropertySet > metadata=std::shared_ptr< lsst::daf::base::PropertySet >(), geom::Box2I const &bbox=geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false)
 Construct a Mask by reading a FITS image in memory. More...
 
 Mask (fits::Fits &fitsfile, std::shared_ptr< lsst::daf::base::PropertySet > metadata=std::shared_ptr< lsst::daf::base::PropertySet >(), geom::Box2I const &bbox=geom::Box2I(), ImageOrigin origin=PARENT, bool conformMasks=false)
 Construct a Mask from an already-open FITS object. More...
 
template<typename OtherPixelT >
 Mask (Mask< OtherPixelT > const &rhs, const bool deep)
 
 Mask (const Mask &src, const bool deep=false)
 Construct a Mask from another Mask. More...
 
 Mask (const Mask &src, const geom::Box2I &bbox, ImageOrigin const origin=PARENT, const bool deep=false)
 Construct a Mask from a subregion of another Mask. More...
 
 Mask (ndarray::Array< MaskPixelT, 2, 1 > const &array, bool deep=false, geom::Point2I const &xy0=geom::Point2I())
 
void swap (Mask &rhs)
 
Mask & operator= (MaskPixelT const rhs)
 
Mask & operator= (const Mask &rhs)
 
Mask & operator|= (Mask const &rhs)
 OR a Mask into a Mask. More...
 
Mask & operator|= (MaskPixelT const rhs)
 OR a bitmask into a Mask. More...
 
Mask & operator &= (Mask const &rhs)
 AND a Mask into a Mask. More...
 
Mask & operator &= (MaskPixelT const rhs)
 AND a bitmask into a Mask. More...
 
Mask & operator^= (Mask const &rhs)
 XOR a Mask into a Mask. More...
 
Mask & operator^= (MaskPixelT const rhs)
 XOR a bitmask into a Mask. More...
 
ImageBase< MaskPixelT >::PixelReference operator() (int x, int y)
 get a reference to the specified pixel More...
 
ImageBase< MaskPixelT >::PixelConstReference operator() (int x, int y) const
 get the specified pixel (const version) More...
 
bool operator() (int x, int y, int plane) const
 is the specified mask plane set in the specified pixel? More...
 
ImageBase< MaskPixelT >::PixelReference operator() (int x, int y, CheckIndices const &check)
 get a reference to the specified pixel checking array bounds More...
 
ImageBase< MaskPixelT >::PixelConstReference operator() (int x, int y, CheckIndices const &check) const
 get the specified pixel with array checking (const version) More...
 
bool operator() (int x, int y, int plane, CheckIndices const &check) const
 is the specified mask plane set in the specified pixel, checking array bounds? More...
 
void writeFits (std::string const &fileName, std::shared_ptr< lsst::daf::base::PropertySet const > metadata=std::shared_ptr< lsst::daf::base::PropertySet >(), std::string const &mode="w") const
 Write a mask to a regular FITS file. More...
 
void writeFits (fits::MemFileManager &manager, std::shared_ptr< lsst::daf::base::PropertySet const > metadata=std::shared_ptr< lsst::daf::base::PropertySet >(), std::string const &mode="w") const
 Write a mask to a FITS RAM file. More...
 
void writeFits (fits::Fits &fitsfile, std::shared_ptr< lsst::daf::base::PropertySet const > metadata=std::shared_ptr< lsst::daf::base::PropertySet const >()) const
 Write a mask to an open FITS file object. More...
 
void writeFits (std::string const &filename, fits::ImageWriteOptions const &options, std::string const &mode="w", std::shared_ptr< daf::base::PropertySet const > header=nullptr) const
 Write a mask to a regular FITS file. More...
 
void writeFits (fits::MemFileManager &manager, fits::ImageWriteOptions const &options, std::string const &mode="w", std::shared_ptr< daf::base::PropertySet const > header=nullptr) const
 Write a mask to a FITS RAM file. More...
 
void writeFits (fits::Fits &fitsfile, fits::ImageWriteOptions const &options, std::shared_ptr< daf::base::PropertySet const > header=nullptr) const
 Write a mask to an open FITS file object. More...
 
std::string getAsString (int x, int y)
 
void clearAllMaskPlanes ()
 Clear all the pixels. More...
 
void clearMaskPlane (int plane)
 Clear the specified bit in all pixels. More...
 
void setMaskPlaneValues (const int plane, const int x0, const int x1, const int y)
 Set the bit specified by "planeId" for pixels (x0, y) ... More...
 
void removeAndClearMaskPlane (const std::string &name, bool const removeFromDefault=false)
 Clear all pixels of the specified mask and remove the plane from the mask plane dictionary; optionally remove the plane from the default dictionary too. More...
 
MaskPlaneDict const & getMaskPlaneDict () const
 Return the Mask's maskPlaneDict. More...
 
void printMaskPlanes () const
 print the mask plane dictionary to std::cout More...
 
void conformMaskPlanes (const MaskPlaneDict &masterPlaneDict)
 Adjust this mask to conform to the standard Mask class's mask plane dictionary, adding any new mask planes to the standard. More...
 
ImageBase & operator<<= (const ImageBase &rhs)
 Set the lhs's pixel values to equal the rhs's. More...
 
void assign (ImageBase const &rhs, geom::Box2I const &bbox=geom::Box2I(), ImageOrigin origin=PARENT)
 Copy pixels from another image to a specified subregion of this image. More...
 
PixelConstReference get0 (int x, int y) const
 
PixelConstReference get0 (int x, int y, CheckIndices const &check) const
 
void set0 (int x, int y, const MaskPixelT v)
 
void set0 (int x, int y, const MaskPixelT v, CheckIndices const &check)
 
int getWidth () const
 Return the number of columns in the image. More...
 
int getHeight () const
 Return the number of rows in the image. More...
 
int getX0 () const
 Return the image's column-origin. More...
 
int getY0 () const
 Return the image's row-origin. More...
 
geom::Point2I getXY0 () const
 Return the image's origin. More...
 
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) More...
 
double indexToPosition (double ind, lsst::afw::image::xOrY const xy) const
 Convert image index to image position. More...
 
geom::Extent2I getDimensions () const
 Return the image's size; useful for passing to constructors. More...
 
void swap (ImageBase &rhs)
 
Array getArray ()
 
ConstArray getArray () const
 
iterator begin () const
 Return an STL compliant iterator to the start of the image. More...
 
fast_iterator begin (bool contiguous) const
 Return a fast STL compliant iterator to the start of the image which must be contiguous. More...
 
iterator end () const
 Return an STL compliant iterator to the end of the image. More...
 
fast_iterator end (bool contiguous) const
 Return a fast STL compliant iterator to the end of the image which must be contiguous. More...
 
reverse_iterator rbegin () const
 Return an STL compliant reverse iterator to the start of the image. More...
 
reverse_iterator rend () const
 Return an STL compliant reverse iterator to the end of the image. More...
 
iterator at (int x, int y) const
 Return an STL compliant iterator at the point (x, y) More...
 
x_iterator row_begin (int y) const
 Return an x_iterator to the start of the y'th row. More...
 
x_iterator row_end (int y) const
 Return an x_iterator to the end of the y'th row. More...
 
x_iterator x_at (int x, int y) const
 Return an x_iterator to the point (x, y) in the image. More...
 
y_iterator col_begin (int x) const
 Return an y_iterator to the start of the y'th row. More...
 
y_iterator col_end (int x) const
 Return an y_iterator to the start of the y'th row. More...
 
y_iterator y_at (int x, int y) const
 Return an y_iterator to the point (x, y) in the image. More...
 
xy_locator xy_at (int x, int y) const
 Return an xy_locator at the point (x, y) in the image. More...
 
void setXY0 (geom::Point2I const origin)
 Set the ImageBase's origin. More...
 
void setXY0 (int const x0, int const y0)
 Set the ImageBase's origin. More...
 
geom::Box2I getBBox (ImageOrigin origin=PARENT) const
 
void serialize (Archive &, unsigned int const)
 
std::string repr () const
 
void markPersistent (void)
 
memId getId () const
 

Static Public Member Functions

static MaskPixelT getPlaneBitMask (const std::vector< std::string > &names)
 Return the bitmask corresponding to a vector of plane names OR'd together. More...
 
static Mask readFits (std::string const &filename, int hdu=fits::DEFAULT_HDU)
 Read a Mask from a regular FITS file. More...
 
static Mask readFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU)
 Read a Mask from a FITS RAM file. More...
 
static std::string interpret (MaskPixelT value)
 Interpret a mask value as a comma-separated list of mask plane names. More...
 
static MaskPlaneDict parseMaskPlaneMetadata (std::shared_ptr< lsst::daf::base::PropertySet const > metadata)
 Given a PropertySet that contains the MaskPlane assignments, setup the MaskPlanes. More...
 
static void clearMaskPlaneDict ()
 Reset the maskPlane dictionary. More...
 
static int addMaskPlane (const std::string &name)
 
static void removeMaskPlane (const std::string &name)
 
static int getMaskPlane (const std::string &name)
 Return the mask plane number corresponding to a plane name. More...
 
static MaskPixelT getPlaneBitMask (const std::string &name)
 Return the bitmask corresponding to a plane name. More...
 
static int getNumPlanesMax ()
 
static int getNumPlanesUsed ()
 
static void addMaskPlanesToMetadata (std::shared_ptr< lsst::daf::base::PropertySet >)
 Given a PropertySet, replace any existing MaskPlane assignments with the current ones. More...
 
static SinglePixel PixelCast (SinglePixelT rhs)
 Convert a type to our SinglePixel type. More...
 
static bool hasBeenCorrupted ()
 
static memId getNextMemId ()
 
static int init ()
 
static int census (int, memId startingMemId=0)
 
static void census (std::ostream &stream, memId startingMemId=0)
 
static const std::vector< const Citizen *> * census ()
 
static int census (int, memId startingMemId=0)
 
static void census (std::ostream &stream, memId startingMemId=0)
 
static const std::vector< const Citizen *> * census ()
 
static memId setNewCallbackId (memId id)
 
static memId setNewCallbackId (memId id)
 
static memId setDeleteCallbackId (memId id)
 
static memId setDeleteCallbackId (memId id)
 
static memNewCallback setNewCallback (memNewCallback func)
 
static memCallback setDeleteCallback (memCallback func)
 
static memCallback setCorruptionCallback (memCallback func)
 

Public Attributes

 magicSentinel
 

Protected Member Functions

_view_t _getRawView () const
 
bool isContiguous () const
 

Static Protected Member Functions

static _view_t _allocateView (geom::Extent2I const &dimensions, Manager::Ptr &manager)
 
static _view_t _makeSubView (geom::Extent2I const &dimensions, geom::Extent2I const &offset, const _view_t &view)
 

Detailed Description

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
class lsst::afw::image::Mask< MaskPixelT >

Represent a 2-dimensional array of bitmask pixels.

Some mask planes are always defined (although you can add more with Mask::addMaskPlane):

Definition at line 84 of file Mask.h.

Member Typedef Documentation

◆ Array

typedef ndarray::Array<MaskPixelT , 2, 1> lsst::afw::image::ImageBase< MaskPixelT >::Array
inherited

A mutable ndarray representation of the image.

Definition at line 153 of file ImageBase.h.

◆ const_iterator

typedef _const_view_t::iterator lsst::afw::image::ImageBase< MaskPixelT >::const_iterator
inherited

An STL compliant const iterator.

Definition at line 131 of file ImageBase.h.

◆ const_reverse_iterator

typedef _const_view_t::reverse_iterator lsst::afw::image::ImageBase< MaskPixelT >::const_reverse_iterator
inherited

An STL compliant const reverse iterator.

Definition at line 135 of file ImageBase.h.

◆ const_x_iterator

typedef _const_view_t::x_iterator lsst::afw::image::ImageBase< MaskPixelT >::const_x_iterator
inherited

A const iterator for traversing the pixels in a row.

Definition at line 145 of file ImageBase.h.

◆ const_xy_locator

typedef _view_t::xy_locator::const_t lsst::afw::image::ImageBase< MaskPixelT >::const_xy_locator
inherited

A const_xy_locator.

Definition at line 127 of file ImageBase.h.

◆ const_y_iterator

typedef _const_view_t::y_iterator lsst::afw::image::ImageBase< MaskPixelT >::const_y_iterator
inherited

A const iterator for traversing the pixels in a column.

Definition at line 151 of file ImageBase.h.

◆ ConstArray

typedef ndarray::Array<MaskPixelT const, 2, 1> lsst::afw::image::ImageBase< MaskPixelT >::ConstArray
inherited

An immutable ndarray representation of the image.

Definition at line 155 of file ImageBase.h.

◆ fast_iterator

typedef x_iterator lsst::afw::image::ImageBase< MaskPixelT >::fast_iterator
inherited

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

The order of pixel access is undefined

Definition at line 141 of file ImageBase.h.

◆ image_category

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
typedef detail::Mask_tag lsst::afw::image::Mask< MaskPixelT >::image_category

Definition at line 88 of file Mask.h.

◆ iterator

typedef _view_t::iterator lsst::afw::image::ImageBase< MaskPixelT >::iterator
inherited

An STL compliant iterator.

Definition at line 129 of file ImageBase.h.

◆ MaskPlaneDict

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
typedef detail::MaskPlaneDict lsst::afw::image::Mask< MaskPixelT >::MaskPlaneDict

Definition at line 86 of file Mask.h.

◆ Pixel

typedef MaskPixelT lsst::afw::image::ImageBase< MaskPixelT >::Pixel
inherited

A pixel in this ImageBase.

Definition at line 119 of file ImageBase.h.

◆ PixelConstReference

typedef ConstReference<MaskPixelT >::type lsst::afw::image::ImageBase< MaskPixelT >::PixelConstReference
inherited

A ConstReference to a PixelT.

Definition at line 123 of file ImageBase.h.

◆ PixelReference

typedef Reference<MaskPixelT >::type lsst::afw::image::ImageBase< MaskPixelT >::PixelReference
inherited

A Reference to a PixelT.

Definition at line 121 of file ImageBase.h.

◆ reverse_iterator

typedef _view_t::reverse_iterator lsst::afw::image::ImageBase< MaskPixelT >::reverse_iterator
inherited

An STL compliant reverse iterator.

Definition at line 133 of file ImageBase.h.

◆ SinglePixel

typedef MaskPixelT lsst::afw::image::ImageBase< MaskPixelT >::SinglePixel
inherited

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

Definition at line 117 of file ImageBase.h.

◆ x_iterator

typedef _view_t::x_iterator lsst::afw::image::ImageBase< MaskPixelT >::x_iterator
inherited

An iterator for traversing the pixels in a row.

Definition at line 137 of file ImageBase.h.

◆ xy_locator

typedef _view_t::xy_locator lsst::afw::image::ImageBase< MaskPixelT >::xy_locator
inherited

An xy_locator.

Definition at line 125 of file ImageBase.h.

◆ xy_x_iterator

typedef _view_t::x_iterator lsst::afw::image::ImageBase< MaskPixelT >::xy_x_iterator
inherited

An iterator for traversing the pixels in a row, created from an xy_locator.

Definition at line 143 of file ImageBase.h.

◆ xy_y_iterator

typedef _view_t::y_iterator lsst::afw::image::ImageBase< MaskPixelT >::xy_y_iterator
inherited

An iterator for traversing the pixels in a row, created from an xy_locator.

Definition at line 149 of file ImageBase.h.

◆ y_iterator

typedef _view_t::y_iterator lsst::afw::image::ImageBase< MaskPixelT >::y_iterator
inherited

An iterator for traversing the pixels in a column.

Definition at line 147 of file ImageBase.h.

Constructor & Destructor Documentation

◆ Mask() [1/13]

template<typename MaskPixelT >
lsst::afw::image::Mask< MaskPixelT >::Mask ( unsigned int  width,
unsigned int  height,
MaskPlaneDict const &  planeDefs = MaskPlaneDict() 
)
explicit

Construct a Mask initialized to 0x0.

Parameters
widthnumber of columns
heightnumber of rows
planeDefsdesired mask planes

Definition at line 355 of file Mask.cc.

◆ Mask() [2/13]

template<typename MaskPixelT>
lsst::afw::image::Mask< MaskPixelT >::Mask ( unsigned int  width,
unsigned int  height,
MaskPixelT  initialValue,
MaskPlaneDict const &  planeDefs = MaskPlaneDict() 
)
explicit

Construct a Mask initialized to a specified value.

Parameters
widthnumber of columns
heightnumber of rows
initialValueInitial value
planeDefsdesired mask planes

Definition at line 362 of file Mask.cc.

◆ Mask() [3/13]

template<typename MaskPixelT>
lsst::afw::image::Mask< MaskPixelT >::Mask ( geom::Extent2I const &  dimensions = geom::Extent2I(),
MaskPlaneDict const &  planeDefs = MaskPlaneDict() 
)
explicit

Construct a Mask initialized to 0x0.

Parameters
dimensionsNumber of columns, rows
planeDefsdesired mask planes

Definition at line 370 of file Mask.cc.

◆ Mask() [4/13]

template<typename MaskPixelT>
lsst::afw::image::Mask< MaskPixelT >::Mask ( geom::Extent2I const &  dimensions,
MaskPixelT  initialValue,
MaskPlaneDict const &  planeDefs = MaskPlaneDict() 
)
explicit

Construct a Mask initialized to a specified value.

Parameters
dimensionsNumber of columns, rows
initialValueInitial value
planeDefsdesired mask planes

Definition at line 377 of file Mask.cc.

◆ Mask() [5/13]

template<typename MaskPixelT>
lsst::afw::image::Mask< MaskPixelT >::Mask ( geom::Box2I const &  bbox,
MaskPlaneDict const &  planeDefs = MaskPlaneDict() 
)
explicit

Construct a Mask initialized to 0x0.

Parameters
bboxDesired number of columns/rows and origin
planeDefsdesired mask planes

Definition at line 385 of file Mask.cc.

◆ Mask() [6/13]

template<typename MaskPixelT>
lsst::afw::image::Mask< MaskPixelT >::Mask ( geom::Box2I const &  bbox,
MaskPixelT  initialValue,
MaskPlaneDict const &  planeDefs = MaskPlaneDict() 
)
explicit

Construct a Mask initialized to a specified value.

Parameters
bboxDesired number of columns/rows and origin
initialValueInitial value
planeDefsdesired mask planes

Definition at line 392 of file Mask.cc.

◆ Mask() [7/13]

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
lsst::afw::image::Mask< MaskPixelT >::Mask ( std::string const &  fileName,
int  hdu = fits::DEFAULT_HDU,
std::shared_ptr< lsst::daf::base::PropertySet >  metadata = std::shared_ptr< lsst::daf::base::PropertySet >(),
geom::Box2I const &  bbox = geom::Box2I(),
ImageOrigin  origin = PARENT,
bool  conformMasks = false 
)
explicit

Construct a Mask by reading a regular FITS file.

Parameters
[in]fileNameFile to read.
[in]hduHDU to read, 0-indexed (i.e. 0=Primary HDU). The special value of afw::fits::DEFAULT_HDU reads the Primary HDU unless it is empty, in which case it reads the first extension HDU.
[in,out]metadataMetadata read from the header (may be null).
[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.

The meaning of the bitplanes is given in the header. If conformMasks is false (default), the bitvalues will be changed to match those in Mask's plane dictionary. If it's true, the bitvalues will be left alone, but Mask's dictionary will be modified to match the on-disk version.

◆ Mask() [8/13]

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
lsst::afw::image::Mask< MaskPixelT >::Mask ( fits::MemFileManager &  manager,
int  hdu = fits::DEFAULT_HDU,
std::shared_ptr< lsst::daf::base::PropertySet >  metadata = std::shared_ptr< lsst::daf::base::PropertySet >(),
geom::Box2I const &  bbox = geom::Box2I(),
ImageOrigin  origin = PARENT,
bool  conformMasks = false 
)
explicit

Construct a Mask by reading a FITS image in memory.

Parameters
[in]managerAn object that manages the memory buffer to read.
[in]hduHDU to read, 0-indexed (i.e. 0=Primary HDU). The special value of afw::fits::DEFAULT_HDU reads the Primary HDU unless it is empty, in which case it reads the first extension HDU.
[in,out]metadataMetadata read from the header (may be null).
[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.

The meaning of the bitplanes is given in the header. If conformMasks is false (default), the bitvalues will be changed to match those in Mask's plane dictionary. If it's true, the bitvalues will be left alone, but Mask's dictionary will be modified to match the on-disk version.

◆ Mask() [9/13]

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
lsst::afw::image::Mask< MaskPixelT >::Mask ( fits::Fits &  fitsfile,
std::shared_ptr< lsst::daf::base::PropertySet >  metadata = std::shared_ptr< lsst::daf::base::PropertySet >(),
geom::Box2I const &  bbox = geom::Box2I(),
ImageOrigin  origin = PARENT,
bool  conformMasks = false 
)
explicit

Construct a Mask from an already-open FITS object.

Parameters
[in]fitsfileA FITS object to read from, already at the desired HDU.
[in,out]metadataMetadata read from the header (may be null).
[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.

The meaning of the bitplanes is given in the header. If conformMasks is false (default), the bitvalues will be changed to match those in Mask's plane dictionary. If it's true, the bitvalues will be left alone, but Mask's dictionary will be modified to match the on-disk version.

◆ Mask() [10/13]

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

Definition at line 220 of file Mask.h.

◆ Mask() [11/13]

template<typename MaskPixelT>
lsst::afw::image::Mask< MaskPixelT >::Mask ( const Mask< MaskPixelT > &  src,
const bool  deep = false 
)

Construct a Mask from another Mask.

Parameters
srcmask to copy
deepdeep copy? (construct a view with shared pixels if false)

Definition at line 403 of file Mask.cc.

◆ Mask() [12/13]

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

Construct a Mask from a subregion of another Mask.

Parameters
srcmask to copy
bboxsubregion to copy
origincoordinate system of the bbox
deepdeep copy? (construct a view with shared pixels if false)

Definition at line 399 of file Mask.cc.

◆ Mask() [13/13]

template<typename MaskPixelT>
lsst::afw::image::Mask< MaskPixelT >::Mask ( ndarray::Array< MaskPixelT, 2, 1 > const &  array,
bool  deep = false,
geom::Point2I const &  xy0 = geom::Point2I() 
)
explicit

Definition at line 407 of file Mask.cc.

Member Function Documentation

◆ _allocateView()

ImageBase< MaskPixelT >::_view_t lsst::afw::image::ImageBase< MaskPixelT >::_allocateView ( geom::Extent2I const &  dimensions,
Manager::Ptr &  manager 
)
staticprotectedinherited

Definition at line 51 of file Image.cc.

◆ _getRawView()

_view_t lsst::afw::image::ImageBase< MaskPixelT >::_getRawView ( ) const
inlineprotectedinherited

Definition at line 466 of file ImageBase.h.

◆ _makeSubView()

ImageBase< MaskPixelT >::_view_t lsst::afw::image::ImageBase< MaskPixelT >::_makeSubView ( geom::Extent2I const &  dimensions,
geom::Extent2I const &  offset,
const _view_t &  view 
)
staticprotectedinherited

Definition at line 71 of file Image.cc.

◆ addMaskPlane()

template<typename MaskPixelT >
int lsst::afw::image::Mask< MaskPixelT >::addMaskPlane ( const std::string &  name)
static

Definition at line 587 of file Mask.cc.

◆ addMaskPlanesToMetadata()

template<typename MaskPixelT >
void lsst::afw::image::Mask< MaskPixelT >::addMaskPlanesToMetadata ( std::shared_ptr< lsst::daf::base::PropertySet >  metadata)
static

Given a PropertySet, replace any existing MaskPlane assignments with the current ones.

Definition at line 896 of file Mask.cc.

◆ assign()

void lsst::afw::image::ImageBase< MaskPixelT >::assign ( ImageBase< MaskPixelT > const &  rhs,
geom::Box2I const &  bbox = geom::Box2I(),
ImageOrigin  origin = PARENT 
)
inherited

Copy pixels from another image to a specified subregion of this 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 160 of file Image.cc.

◆ at()

ImageBase< MaskPixelT >::iterator lsst::afw::image::ImageBase< MaskPixelT >::at ( int  x,
int  y 
) const
inherited

Return an STL compliant iterator at the point (x, y)

Definition at line 255 of file Image.cc.

◆ begin() [1/2]

ImageBase< MaskPixelT >::iterator lsst::afw::image::ImageBase< MaskPixelT >::begin ( void  ) const
inherited

Return an STL compliant iterator to the start of the image.

Note that this isn't especially efficient; see imageIterators for a discussion

Definition at line 235 of file Image.cc.

◆ begin() [2/2]

ImageBase< MaskPixelT >::fast_iterator lsst::afw::image::ImageBase< MaskPixelT >::begin ( bool  contiguous) const
inherited

Return a fast STL compliant iterator to the start of the image which must be contiguous.

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 260 of file Image.cc.

◆ clearAllMaskPlanes()

template<typename MaskPixelT >
void lsst::afw::image::Mask< MaskPixelT >::clearAllMaskPlanes ( )

Clear all the pixels.

Definition at line 718 of file Mask.cc.

◆ clearMaskPlane()

template<typename MaskPixelT >
void lsst::afw::image::Mask< MaskPixelT >::clearMaskPlane ( int  plane)

Clear the specified bit in all pixels.

Definition at line 723 of file Mask.cc.

◆ clearMaskPlaneDict()

template<typename MaskPixelT >
void lsst::afw::image::Mask< MaskPixelT >::clearMaskPlaneDict ( )
static

Reset the maskPlane dictionary.

Definition at line 713 of file Mask.cc.

◆ col_begin()

y_iterator lsst::afw::image::ImageBase< MaskPixelT >::col_begin ( int  x) const
inlineinherited

Return an y_iterator to the start of the y'th row.

Incrementing an y_iterator moves it up the column

Definition at line 414 of file ImageBase.h.

◆ col_end()

y_iterator lsst::afw::image::ImageBase< MaskPixelT >::col_end ( int  x) const
inlineinherited

Return an y_iterator to the start of the y'th row.

Definition at line 417 of file ImageBase.h.

◆ conformMaskPlanes()

template<typename MaskPixelT >
void lsst::afw::image::Mask< MaskPixelT >::conformMaskPlanes ( const MaskPlaneDict &  masterPlaneDict)

Adjust this mask to conform to the standard Mask class's mask plane dictionary, adding any new mask planes to the standard.

Ensures that this mask (presumably from some external source) has the same plane assignments as the Mask class. If a change in plane assignments is needed, the bits within each pixel are permuted as required. The provided masterPlaneDict describes the true state of the bits in this Mask's pixels and overrides its current MaskDict

Any new mask planes found in this mask are added to unused slots in the Mask class's mask plane dictionary.

Parameters
masterPlaneDictmask plane dictionary currently in use for this mask

Definition at line 728 of file Mask.cc.

◆ end() [1/2]

ImageBase< MaskPixelT >::iterator lsst::afw::image::ImageBase< MaskPixelT >::end ( void  ) const
inherited

Return an STL compliant iterator to the end of the image.

Definition at line 240 of file Image.cc.

◆ end() [2/2]

ImageBase< MaskPixelT >::fast_iterator lsst::afw::image::ImageBase< MaskPixelT >::end ( bool  contiguous) const
inherited

Return a fast STL compliant iterator to the end of the image which must be contiguous.

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 272 of file Image.cc.

◆ get0() [1/2]

PixelConstReference lsst::afw::image::ImageBase< MaskPixelT >::get0 ( int  x,
int  y 
) const
inlineinherited

Definition at line 287 of file ImageBase.h.

◆ get0() [2/2]

PixelConstReference lsst::afw::image::ImageBase< MaskPixelT >::get0 ( int  x,
int  y,
CheckIndices const &  check 
) const
inlineinherited

Definition at line 288 of file ImageBase.h.

◆ getArray() [1/2]

ImageBase< MaskPixelT >::Array lsst::afw::image::ImageBase< MaskPixelT >::getArray ( )
inherited

Definition at line 478 of file ImageBase.h.

◆ getArray() [2/2]

ImageBase< MaskPixelT >::ConstArray lsst::afw::image::ImageBase< MaskPixelT >::getArray ( ) const
inherited

Definition at line 486 of file ImageBase.h.

◆ getAsString()

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
std::string lsst::afw::image::Mask< MaskPixelT >::getAsString ( int  x,
int  y 
)
inline

Definition at line 422 of file Mask.h.

◆ getBBox()

geom::Box2I lsst::afw::image::ImageBase< MaskPixelT >::getBBox ( ImageOrigin  origin = PARENT) const
inlineinherited

Definition at line 446 of file ImageBase.h.

◆ getDimensions()

geom::Extent2I lsst::afw::image::ImageBase< MaskPixelT >::getDimensions ( ) const
inlineinherited

Return the image's size; useful for passing to constructors.

Definition at line 357 of file ImageBase.h.

◆ getHeight()

int lsst::afw::image::ImageBase< MaskPixelT >::getHeight ( ) const
inlineinherited

Return the number of rows in the image.

Definition at line 299 of file ImageBase.h.

◆ getMaskPlane()

template<typename MaskPixelT >
int lsst::afw::image::Mask< MaskPixelT >::getMaskPlane ( const std::string &  name)
static

Return the mask plane number corresponding to a plane name.

Exceptions
lsst::pex::exceptions::InvalidParameterErrorif plane is invalid

Definition at line 677 of file Mask.cc.

◆ getMaskPlaneDict()

template<typename MaskPixelT >
detail::MaskPlaneDict const & lsst::afw::image::Mask< MaskPixelT >::getMaskPlaneDict ( ) const

Return the Mask's maskPlaneDict.

Definition at line 620 of file Mask.cc.

◆ getNumPlanesMax()

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
static int lsst::afw::image::Mask< MaskPixelT >::getNumPlanesMax ( )
inlinestatic

Definition at line 472 of file Mask.h.

◆ getNumPlanesUsed()

template<typename MaskPixelT >
int lsst::afw::image::Mask< MaskPixelT >::getNumPlanesUsed ( )
static

Definition at line 708 of file Mask.cc.

◆ getPlaneBitMask() [1/2]

template<typename MaskPixelT >
MaskPixelT lsst::afw::image::Mask< MaskPixelT >::getPlaneBitMask ( const std::vector< std::string > &  names)
static

Return the bitmask corresponding to a vector of plane names OR'd together.

Exceptions
lsst::pex::exceptions::InvalidParameterErrorif plane is invalid

Definition at line 699 of file Mask.cc.

◆ getPlaneBitMask() [2/2]

template<typename MaskPixelT >
MaskPixelT lsst::afw::image::Mask< MaskPixelT >::getPlaneBitMask ( const std::string &  name)
static

Return the bitmask corresponding to a plane name.

Exceptions
lsst::pex::exceptions::InvalidParameterErrorif plane is invalid

Definition at line 694 of file Mask.cc.

◆ getWidth()

int lsst::afw::image::ImageBase< MaskPixelT >::getWidth ( ) const
inlineinherited

Return the number of columns in the image.

Definition at line 297 of file ImageBase.h.

◆ getX0()

int lsst::afw::image::ImageBase< MaskPixelT >::getX0 ( ) const
inlineinherited

Return the image's column-origin.

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

Definition at line 307 of file ImageBase.h.

◆ getXY0()

geom::Point2I lsst::afw::image::ImageBase< MaskPixelT >::getXY0 ( ) const
inlineinherited

Return the image's origin.

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

Definition at line 324 of file ImageBase.h.

◆ getY0()

int lsst::afw::image::ImageBase< MaskPixelT >::getY0 ( ) const
inlineinherited

Return the image's row-origin.

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

Definition at line 315 of file ImageBase.h.

◆ indexToPosition()

double lsst::afw::image::ImageBase< MaskPixelT >::indexToPosition ( double  ind,
lsst::afw::image::xOrY const  xy 
) const
inlineinherited

Convert image index to image position.

The LSST indexing convention is:

  • the index of the bottom left pixel is 0,0
  • the position of the center of the bottom left pixel is PixelZeroPos, PixelZeroPos
Returns
image position
Parameters
indimage index
xyIs this a column or row coordinate?

Definition at line 350 of file ImageBase.h.

◆ interpret()

template<typename MaskPixelT>
std::string lsst::afw::image::Mask< MaskPixelT >::interpret ( MaskPixelT  value)
static

Interpret a mask value as a comma-separated list of mask plane names.

Definition at line 572 of file Mask.cc.

◆ isContiguous()

bool lsst::afw::image::ImageBase< MaskPixelT >::isContiguous ( ) const
inlineprotectedinherited

Definition at line 468 of file ImageBase.h.

◆ operator &=() [1/2]

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
Mask& lsst::afw::image::Mask< MaskPixelT >::operator&= ( Mask< MaskPixelT > const &  rhs)

AND a Mask into a Mask.

◆ operator &=() [2/2]

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
Mask& lsst::afw::image::Mask< MaskPixelT >::operator&= ( MaskPixelT const  rhs)

AND a bitmask into a Mask.

◆ operator()() [1/6]

template<typename MaskPixelT >
ImageBase< MaskPixelT >::PixelReference lsst::afw::image::Mask< MaskPixelT >::operator() ( int  x,
int  y 
)

get a reference to the specified pixel

Parameters
xx index
yy index

Definition at line 784 of file Mask.cc.

◆ operator()() [2/6]

template<typename MaskPixelT >
ImageBase< MaskPixelT >::PixelConstReference lsst::afw::image::Mask< MaskPixelT >::operator() ( int  x,
int  y 
) const

get the specified pixel (const version)

Parameters
xx index
yy index

Definition at line 795 of file Mask.cc.

◆ operator()() [3/6]

template<typename MaskPixelT >
bool lsst::afw::image::Mask< MaskPixelT >::operator() ( int  x,
int  y,
int  plane 
) const

is the specified mask plane set in the specified pixel?

Parameters
xx index
yy index
planeplane ID

Definition at line 806 of file Mask.cc.

◆ operator()() [4/6]

template<typename MaskPixelT >
ImageBase< MaskPixelT >::PixelReference lsst::afw::image::Mask< MaskPixelT >::operator() ( int  x,
int  y,
CheckIndices const &  check 
)

get a reference to the specified pixel checking array bounds

Parameters
xx index
yy index
checkCheck array bounds?

Definition at line 789 of file Mask.cc.

◆ operator()() [5/6]

template<typename MaskPixelT >
ImageBase< MaskPixelT >::PixelConstReference lsst::afw::image::Mask< MaskPixelT >::operator() ( int  x,
int  y,
CheckIndices const &  check 
) const

get the specified pixel with array checking (const version)

Parameters
xx index
yy index
checkCheck array bounds?

Definition at line 800 of file Mask.cc.

◆ operator()() [6/6]

template<typename MaskPixelT >
bool lsst::afw::image::Mask< MaskPixelT >::operator() ( int  x,
int  y,
int  plane,
CheckIndices const &  check 
) const

is the specified mask plane set in the specified pixel, checking array bounds?

Parameters
xx index
yy index
planeplane ID
checkCheck array bounds?

Definition at line 812 of file Mask.cc.

◆ operator<<=()

ImageBase< MaskPixelT > & lsst::afw::image::ImageBase< MaskPixelT >::operator<<= ( const ImageBase< MaskPixelT > &  rhs)
inherited

Set the lhs's pixel values to equal the rhs's.

Deprecated:
use assign(rhs) instead

Definition at line 154 of file Image.cc.

◆ operator=() [1/2]

template<typename MaskPixelT>
Mask< MaskPixelT > & lsst::afw::image::Mask< MaskPixelT >::operator= ( MaskPixelT const  rhs)

Definition at line 432 of file Mask.cc.

◆ operator=() [2/2]

template<typename MaskPixelT>
Mask< MaskPixelT > & lsst::afw::image::Mask< MaskPixelT >::operator= ( const Mask< MaskPixelT > &  rhs)

Definition at line 424 of file Mask.cc.

◆ operator^=() [1/2]

template<typename MaskPixelT >
Mask< MaskPixelT > & lsst::afw::image::Mask< MaskPixelT >::operator^= ( Mask< MaskPixelT > const &  rhs)

XOR a Mask into a Mask.

Definition at line 873 of file Mask.cc.

◆ operator^=() [2/2]

template<typename MaskPixelT>
Mask< MaskPixelT > & lsst::afw::image::Mask< MaskPixelT >::operator^= ( MaskPixelT const  rhs)

XOR a bitmask into a Mask.

Definition at line 866 of file Mask.cc.

◆ operator|=() [1/2]

template<typename MaskPixelT >
Mask< MaskPixelT > & lsst::afw::image::Mask< MaskPixelT >::operator|= ( Mask< MaskPixelT > const &  rhs)

OR a Mask into a Mask.

Definition at line 832 of file Mask.cc.

◆ operator|=() [2/2]

template<typename MaskPixelT>
Mask< MaskPixelT > & lsst::afw::image::Mask< MaskPixelT >::operator|= ( MaskPixelT const  rhs)

OR a bitmask into a Mask.

Definition at line 825 of file Mask.cc.

◆ parseMaskPlaneMetadata()

template<typename MaskPixelT >
Mask< MaskPixelT >::MaskPlaneDict lsst::afw::image::Mask< MaskPixelT >::parseMaskPlaneMetadata ( std::shared_ptr< lsst::daf::base::PropertySet const >  metadata)
static

Given a PropertySet that contains the MaskPlane assignments, setup the MaskPlanes.

Parameters
metadatametadata from a Mask
Returns
a dictionary of mask plane name: plane ID

Definition at line 924 of file Mask.cc.

◆ PixelCast()

static SinglePixel lsst::afw::image::ImageBase< MaskPixelT >::PixelCast ( SinglePixelT  rhs)
inlinestaticinherited

Convert a type to our SinglePixel type.

Definition at line 162 of file ImageBase.h.

◆ positionToIndex()

std::pair<int, double> lsst::afw::image::ImageBase< MaskPixelT >::positionToIndex ( double const  pos,
lsst::afw::image::xOrY const  xy 
) const
inlineinherited

Convert image position to index (nearest integer and fractional parts)

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

Definition at line 331 of file ImageBase.h.

◆ printMaskPlanes()

template<typename MaskPixelT >
void lsst::afw::image::Mask< MaskPixelT >::printMaskPlanes ( ) const

print the mask plane dictionary to std::cout

Definition at line 965 of file Mask.cc.

◆ rbegin()

ImageBase< MaskPixelT >::reverse_iterator lsst::afw::image::ImageBase< MaskPixelT >::rbegin ( ) const
inherited

Return an STL compliant reverse iterator to the start of the image.

Definition at line 245 of file Image.cc.

◆ readFits() [1/2]

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
static Mask lsst::afw::image::Mask< MaskPixelT >::readFits ( std::string const &  filename,
int  hdu = fits::DEFAULT_HDU 
)
inlinestatic

Read a Mask from a regular FITS file.

Parameters
[in]filenameName of the file to read.
[in]hduNumber of the "header-data unit" to read (where 0 is the Primary HDU). The default value of afw::fits::DEFAULT_HDU is interpreted as "the first HDU with NAXIS != 0".

Definition at line 404 of file Mask.h.

◆ readFits() [2/2]

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
static Mask lsst::afw::image::Mask< MaskPixelT >::readFits ( fits::MemFileManager &  manager,
int  hdu = fits::DEFAULT_HDU 
)
inlinestatic

Read a Mask from a FITS RAM file.

Parameters
[in]managerObject that manages the memory to be read.
[in]hduNumber of the "header-data unit" to read (where 0 is the Primary HDU). The default value of afw::fits::DEFAULT_HDU is interpreted as "the first HDU with NAXIS != 0".

Definition at line 416 of file Mask.h.

◆ removeAndClearMaskPlane()

template<typename MaskPixelT >
void lsst::afw::image::Mask< MaskPixelT >::removeAndClearMaskPlane ( const std::string &  name,
bool const  removeFromDefault = false 
)

Clear all pixels of the specified mask and remove the plane from the mask plane dictionary; optionally remove the plane from the default dictionary too.

Parameters
nameof maskplane
removeFromDefaultremove from default mask plane dictionary too
Exceptions
lsst::pex::exceptions::InvalidParameterErrorif plane is invalid

Definition at line 636 of file Mask.cc.

◆ removeMaskPlane()

template<typename MaskPixelT >
void lsst::afw::image::Mask< MaskPixelT >::removeMaskPlane ( const std::string &  name)
static

Definition at line 625 of file Mask.cc.

◆ rend()

ImageBase< MaskPixelT >::reverse_iterator lsst::afw::image::ImageBase< MaskPixelT >::rend ( ) const
inherited

Return an STL compliant reverse iterator to the end of the image.

Definition at line 250 of file Image.cc.

◆ row_begin()

x_iterator lsst::afw::image::ImageBase< MaskPixelT >::row_begin ( int  y) const
inlineinherited

Return an x_iterator to the start of the y'th row.

Incrementing an x_iterator moves it across the row

Definition at line 402 of file ImageBase.h.

◆ row_end()

x_iterator lsst::afw::image::ImageBase< MaskPixelT >::row_end ( int  y) const
inlineinherited

Return an x_iterator to the end of the y'th row.

Definition at line 405 of file ImageBase.h.

◆ set0() [1/2]

void lsst::afw::image::ImageBase< MaskPixelT >::set0 ( int  x,
int  y,
const MaskPixelT  v 
)
inlineinherited

Definition at line 291 of file ImageBase.h.

◆ set0() [2/2]

void lsst::afw::image::ImageBase< MaskPixelT >::set0 ( int  x,
int  y,
const MaskPixelT  v,
CheckIndices const &  check 
)
inlineinherited

Definition at line 292 of file ImageBase.h.

◆ setMaskPlaneValues()

template<typename MaskPixelT >
void lsst::afw::image::Mask< MaskPixelT >::setMaskPlaneValues ( const int  plane,
const int  x0,
const int  x1,
const int  y 
)

Set the bit specified by "planeId" for pixels (x0, y) ...

(x1, y)

Definition at line 887 of file Mask.cc.

◆ setXY0() [1/2]

void lsst::afw::image::ImageBase< MaskPixelT >::setXY0 ( geom::Point2I const  origin)
inlineinherited

Set the ImageBase'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 435 of file ImageBase.h.

◆ setXY0() [2/2]

void lsst::afw::image::ImageBase< MaskPixelT >::setXY0 ( int const  x0,
int const  y0 
)
inlineinherited

Set the ImageBase'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 444 of file ImageBase.h.

◆ swap() [1/2]

template<typename PixelT >
void lsst::afw::image::Mask< PixelT >::swap ( Mask< MaskPixelT > &  rhs)

Definition at line 411 of file Mask.cc.

◆ swap() [2/2]

void lsst::afw::image::ImageBase< MaskPixelT >::swap ( ImageBase< MaskPixelT > &  rhs)
inherited

Definition at line 218 of file Image.cc.

◆ writeFits() [1/6]

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
void lsst::afw::image::Mask< MaskPixelT >::writeFits ( std::string const &  fileName,
std::shared_ptr< lsst::daf::base::PropertySet const >  metadata = std::shared_ptr< lsst::daf::base::PropertySet >(),
std::string const &  mode = "w" 
) const

Write a mask to a regular FITS file.

Parameters
[in]fileNameName of the file to write.
[in]metadataAdditional values to write to the header (may be null).
[in]mode"w"=Create a new file; "a"=Append a new HDU.

◆ writeFits() [2/6]

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
void lsst::afw::image::Mask< MaskPixelT >::writeFits ( fits::MemFileManager &  manager,
std::shared_ptr< lsst::daf::base::PropertySet const >  metadata = std::shared_ptr< lsst::daf::base::PropertySet >(),
std::string const &  mode = "w" 
) const

Write a mask to a FITS RAM file.

Parameters
[in]managerManager object for the memory block to write to.
[in]metadataAdditional values to write to the header (may be null).
[in]mode"w"=Create a new file; "a"=Append a new HDU.

◆ writeFits() [3/6]

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
void lsst::afw::image::Mask< MaskPixelT >::writeFits ( fits::Fits &  fitsfile,
std::shared_ptr< lsst::daf::base::PropertySet const >  metadata = std::shared_ptr< lsst::daf::base::PropertySet const >() 
) const

Write a mask to an open FITS file object.

Parameters
[in]fitsfileA FITS file already open to the desired HDU.
[in]metadataAdditional values to write to the header (may be null).

◆ writeFits() [4/6]

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
void lsst::afw::image::Mask< MaskPixelT >::writeFits ( std::string const &  filename,
fits::ImageWriteOptions const &  options,
std::string const &  mode = "w",
std::shared_ptr< daf::base::PropertySet const >  header = nullptr 
) const

Write a mask to a regular FITS file.

Parameters
[in]filenameName of the file to write.
[in]optionsOptions controlling writing of FITS image.
[in]mode"w"=Create a new file; "a"=Append a new HDU.
[in]headerAdditional values to write to the header (may be null).

◆ writeFits() [5/6]

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
void lsst::afw::image::Mask< MaskPixelT >::writeFits ( fits::MemFileManager &  manager,
fits::ImageWriteOptions const &  options,
std::string const &  mode = "w",
std::shared_ptr< daf::base::PropertySet const >  header = nullptr 
) const

Write a mask to a FITS RAM file.

Parameters
[in]managerManager object for the memory block to write to.
[in]optionsOptions controlling writing of FITS image.
[in]mode"w"=Create a new file; "a"=Append a new HDU.
[in]headerAdditional values to write to the header (may be null).

◆ writeFits() [6/6]

template<typename MaskPixelT = lsst::afw::image::MaskPixel>
void lsst::afw::image::Mask< MaskPixelT >::writeFits ( fits::Fits &  fitsfile,
fits::ImageWriteOptions const &  options,
std::shared_ptr< daf::base::PropertySet const >  header = nullptr 
) const

Write a mask to an open FITS file object.

Parameters
[in]fitsfileA FITS file already open to the desired HDU.
[in]optionsOptions controlling writing of FITS image.
[in]headerAdditional values to write to the header (may be null).

◆ x_at()

x_iterator lsst::afw::image::ImageBase< MaskPixelT >::x_at ( int  x,
int  y 
) const
inlineinherited

Return an x_iterator to the point (x, y) in the image.

Definition at line 408 of file ImageBase.h.

◆ xy_at()

xy_locator lsst::afw::image::ImageBase< MaskPixelT >::xy_at ( int  x,
int  y 
) const
inlineinherited

Return an xy_locator at the point (x, y) in the image.

Locators may be used to access a patch in an image

Definition at line 426 of file ImageBase.h.

◆ y_at()

y_iterator lsst::afw::image::ImageBase< MaskPixelT >::y_at ( int  x,
int  y 
) const
inlineinherited

Return an y_iterator to the point (x, y) in the image.

Definition at line 420 of file ImageBase.h.


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