30 #ifndef LSST_AFW_IMAGE_MASK_H
31 #define LSST_AFW_IMAGE_MASK_H
37 #include "boost/cstdint.hpp"
38 #include "boost/shared_ptr.hpp"
51 namespace formatters {
52 template<
typename>
class MaskFormatter;
92 template<
typename MaskPixelT=lsst::afw::image::MaskPixel>
95 typedef boost::shared_ptr<Mask>
Ptr;
96 typedef boost::shared_ptr<const Mask>
ConstPtr;
102 template<
typename MaskPT=MaskPixelT>
116 unsigned int width,
unsigned int height,
117 MaskPixelT initialValue,
126 MaskPixelT initialValue,
153 std::string
const & fileName,
int hdu=0,
157 bool conformMasks=
false
183 bool conformMasks=
false
206 bool conformMasks=
false
210 template<
typename OtherPixelT>
215 Mask(
const Mask& src,
const bool deep=
false);
220 const bool deep=
false
237 static MaskPixelT
getPlaneBitMask(
const std::vector<std::string> &names);
258 std::string
const& fileName,
260 std::string
const& mode=
"w"
273 std::string
const& mode=
"w"
310 static std::string
interpret(MaskPixelT value);
370 #endif // LSST_AFW_IMAGE_MASK_H
static std::string interpret(MaskPixelT value)
Interpret a mask value as a comma-separated list of mask plane names.
void _initializePlanes(MaskPlaneDict const &planeDefs)
Initialise mask planes; called by constructors.
static void clearMaskPlaneDict()
Reset the maskPlane dictionary.
table::Key< std::string > name
static MaskPixelT getBitMaskNoThrow(int plane)
Return the bitmask corresponding to a plane ID, or 0 if invalid.
void writeFits(std::string const &fileName, boost::shared_ptr< lsst::daf::base::PropertySet const > metadata=boost::shared_ptr< lsst::daf::base::PropertySet >(), std::string const &mode="w") const
Write a mask to a regular FITS file.
static int getMaskPlane(const std::string &name)
Return the mask plane number corresponding to a plane name.
Include files required for standard LSST Exception handling.
Mask(Mask< OtherPixelT > const &rhs, const bool deep)
boost::shared_ptr< const Mask > ConstPtr
void operator|=(Mask const &rhs)
OR a Mask into a Mask.
void operator&=(Mask const &rhs)
AND a Mask into a Mask.
std::map< std::string, int > MaskPlaneDict
Mask & operator=(MaskPixelT const rhs)
std::string getAsString(int x, int y)
static int _setMaskPlaneDict(MaskPlaneDict const &mpd)
detail::MaskPlaneDict MaskPlaneDict
static int getNumPlanesUsed()
Reset the maskPlane dictionary.
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, ...)
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; optionall...
Mask< MaskPT > type
Return the desired type.
static int getMaskPlaneNoThrow(const std::string &name)
Return the mask plane number corresponding to a plane name, or -1 if not found.
static const std::string maskPlanePrefix
ImageBase< MaskPixelT >::PixelReference operator()(int x, int y)
get a reference to the specified pixel
An integer coordinate rectangle.
void operator^=(Mask const &rhs)
XOR a Mask into a Mask.
table::Key< table::Array< Kernel::Pixel > > image
Mask(unsigned int width, unsigned int height, MaskPlaneDict const &planeDefs=MaskPlaneDict())
Construct a Mask initialized to 0x0.
afw::table::PointKey< int > dimensions
void ImageT ImageT int float saturatedPixelValue int const width
static MaskPixelT getBitMask(int plane)
Return the bitmask corresponding to plane ID.
Represent a 2-dimensional array of bitmask pixels.
detail::Mask_tag image_category
Lifetime-management for memory that goes into FITS memory files.
_view_t _getRawView() const
void 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)
static MaskPlaneDict parseMaskPlaneMetadata(boost::shared_ptr< lsst::daf::base::PropertySet const >)
Given a PropertySet that contains the MaskPlane assignments, setup the MaskPlanes.
A class used to request that array accesses be checked.
static MaskPixelT getPlaneBitMask(const std::vector< std::string > &names)
Return the bitmask corresponding to a vector of plane names OR'd together.
void ImageT ImageT int float saturatedPixelValue int const height
Interface for Persistable base class.
boost::shared_ptr< Mask > Ptr
A multidimensional strided array.
static void removeMaskPlane(const std::string &name)
static void addMaskPlanesToMetadata(boost::shared_ptr< lsst::daf::base::PropertySet >)
Given a PropertySet, replace any existing MaskPlane assignments with the current ones.
static int getNumPlanesMax()
void checkMaskDictionaries(Mask const &other)
MaskPlaneDict const & getMaskPlaneDict() const
Class for storing generic metadata.
static Mask readFits(fits::MemFileManager &manager, int hdu=0)
Read a Mask from a FITS RAM file.
afw::table::Key< double > b
Interface for PropertySet class.
void conformMaskPlanes(const MaskPlaneDict &masterPlaneDict)
Adjust this mask to conform to the standard Mask class's mask plane dictionary, adding any new mask p...
static Mask readFits(std::string const &filename, int hdu=0)
Read a Mask from a regular FITS file.
A templated class to return this classes' type (present in Image/Mask/MaskedImage) ...
boost::shared_ptr< detail::MaskDict > _maskDict
void clearMaskPlane(int plane)
Clear the specified bit in all pixels.
void printMaskPlanes() const
print the mask plane dictionary to std::cout
Definition of default types for Masks and Variance Images.
void clearAllMaskPlanes()
Clear all the pixels.
static int addMaskPlane(const std::string &name)
static boost::shared_ptr< detail::MaskDict > _maskPlaneDict()