29 #ifndef LSST_AFW_IMAGE_MASK_H 30 #define LSST_AFW_IMAGE_MASK_H 77 template <
typename MaskPixelT = lsst::afw::image::MaskPixel>
85 template <
typename MaskPT = MaskPixelT>
99 explicit Mask(
unsigned int width,
unsigned int height, MaskPlaneDict
const& planeDefs =
MaskPlaneDict());
108 explicit Mask(
unsigned int width,
unsigned int height, MaskPixelT initialValue,
168 bool conformMasks =
false,
bool allowUnsafe=
false);
194 bool conformMasks =
false,
bool allowUnsafe=
false);
217 bool conformMasks =
false,
bool allowUnsafe=
false);
220 template <
typename OtherPixelT>
222 :
image::
ImageBase<MaskPixelT>(rhs, deep), _maskDict(rhs._maskDict) {}
242 const bool deep =
false);
244 explicit Mask(ndarray::Array<MaskPixelT, 2, 1>
const& array,
bool deep =
false,
250 Mask& operator=(MaskPixelT
const rhs);
257 Mask& operator|=(MaskPixelT
const rhs);
262 Mask& operator&=(MaskPixelT
const rhs);
278 return Mask(*
this, bbox, origin,
false);
298 Mask& operator^=(MaskPixelT
const rhs);
321 bool operator()(
int x,
int y,
int plane)
const;
347 bool operator()(
int x,
int y,
int plane,
CheckIndices const& check)
const;
447 void clearAllMaskPlanes();
449 void clearMaskPlane(
int plane);
453 void setMaskPlaneValues(
const int plane,
const int x0,
const int x1,
const int y);
465 static void clearMaskPlaneDict();
467 static void removeMaskPlane(
const std::string& name);
477 void removeAndClearMaskPlane(
const std::string& name,
bool const removeFromDefault =
false);
490 static MaskPixelT getPlaneBitMask(
const std::string& name);
493 static int getNumPlanesUsed();
497 MaskPlaneDict
const& getMaskPlaneDict()
const;
499 void printMaskPlanes()
const;
521 void conformMaskPlanes(
const MaskPlaneDict& masterPlaneDict);
530 static int _setMaskPlaneDict(MaskPlaneDict
const& mpd);
541 static int addMaskPlane(
std::string name,
int plane);
544 static int getMaskPlaneNoThrow(
const std::string& name);
546 static MaskPixelT getBitMaskNoThrow(
int plane);
552 static MaskPixelT getBitMask(
int plane);
557 void _initializePlanes(MaskPlaneDict
const& planeDefs);
570 void checkMaskDictionaries(
Mask const&
other);
573 template <
typename PixelT>
579 #endif // LSST_AFW_IMAGE_MASK_H
A FITS reader class for Masks.
afw::table::PointKey< int > dimensions
Mask(Mask< OtherPixelT > const &rhs, const bool deep)
std::map< std::string, int > MaskPlaneDict
Options for writing an image to FITS.
std::string getAsString(int x, int y)
static Mask readFits(std::string const &filename, int hdu=fits::DEFAULT_HDU)
Read a Mask from a regular FITS file.
detail::MaskPlaneDict MaskPlaneDict
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
The base class for all image classed (Image, Mask, MaskedImage, ...)
Mask< MaskPT > type
Return the desired type.
A base class for image defects.
Mask operator[](lsst::geom::Box2I const &bbox) const
Return a subimage corresponding to the given box (interpreted as PARENT coordinates).
Represent a 2-dimensional array of bitmask pixels.
detail::Mask_tag image_category
Lifetime-management for memory that goes into FITS memory files.
A class used to request that array accesses be checked.
std::shared_ptr< RecordT > src
void swap(Image< PixelT > &a, Image< PixelT > &b)
static int getNumPlanesMax()
ItemVariant const * other
Mask subset(lsst::geom::Box2I const &bbox, ImageOrigin origin=PARENT) const
Return a subimage corresponding to the given box.
A templated class to return this classes' type (present in Image/Mask/MaskedImage) ...
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects...
static Mask readFits(fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU)
Read a Mask from a FITS RAM file.
An integer coordinate rectangle.
const int DEFAULT_HDU
Specify that the default HDU should be read.