LSST Applications g063fba187b+cac8b7c890,g0f08755f38+6aee506743,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+b4475c5878,g1dcb35cd9c+8f9bc1652e,g20f6ffc8e0+6aee506743,g217e2c1bcf+73dee94bd0,g28da252d5a+1f19c529b9,g2bbee38e9b+3f2625acfc,g2bc492864f+3f2625acfc,g3156d2b45e+6e55a43351,g32e5bea42b+1bb94961c2,g347aa1857d+3f2625acfc,g35bb328faa+a8ce1bb630,g3a166c0a6a+3f2625acfc,g3e281a1b8c+c5dd892a6c,g3e8969e208+a8ce1bb630,g414038480c+5927e1bc1e,g41af890bb2+8a9e676b2a,g7af13505b9+809c143d88,g80478fca09+6ef8b1810f,g82479be7b0+f568feb641,g858d7b2824+6aee506743,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+2903d499ea,gb58c049af0+d64f4d3760,gc28159a63d+3f2625acfc,gcab2d0539d+b12535109e,gcf0d15dbbd+46a3f46ba9,gda6a2b7d83+46a3f46ba9,gdaeeff99f8+1711a396fd,ge79ae78c31+3f2625acfc,gef2f8181fd+0a71e47438,gf0baf85859+c1f95f4921,gfa517265be+6aee506743,gfa999e8aa5+17cd334064,w.2024.51
LSST Data Management Base Package
Loading...
Searching...
No Matches
Mask.cc
Go to the documentation of this file.
1// -*- lsst-c++ -*-
2
3/*
4 * LSST Data Management System
5 * Copyright 2008-2016 AURA/LSST.
6 *
7 * This product includes software developed by the
8 * LSST Project (http://www.lsst.org/).
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the LSST License Statement and
21 * the GNU General Public License along with this program. If not,
22 * see <http://www.lsstcorp.org/LegalNotices/>.
23 */
24
25/*
26 * The fundamental type defined here is Mask; a 2-d array of pixels. Each of
27 * these pixels should be thought of as a set of bits, and the names of these
28 * bits are given by MaskPlaneDict (which is implemented as a std::map)
29 */
30
31#include <functional>
32#include <list>
33#include <string>
34#include "boost/format.hpp"
35
36#include "lsst/daf/base.h"
37#include "lsst/geom.h"
38#include "lsst/pex/exceptions.h"
39#include "lsst/log/Log.h"
40#include "lsst/afw/image/Mask.h"
44
45namespace dafBase = lsst::daf::base;
47
48namespace lsst {
49namespace afw {
50namespace image {
51
52namespace {} // namespace
53
54template <typename MaskPixelT>
55void Mask<MaskPixelT>::_initializePlanes(MaskPlaneDict const& planeDefs) {
56 LOGL_DEBUG("lsst.afw.image.Mask", "Number of mask planes: %d", getNumPlanesMax());
57
58 _maskDict = detail::MaskDict::copyOrGetDefault(planeDefs);
59}
60
61template <typename MaskPixelT>
62Mask<MaskPixelT>::Mask(unsigned int width, unsigned int height, MaskPlaneDict const& planeDefs)
63 : ImageBase<MaskPixelT>(lsst::geom::ExtentI(width, height)) {
64 _initializePlanes(planeDefs);
65 *this = 0x0;
66}
67
68template <typename MaskPixelT>
69Mask<MaskPixelT>::Mask(unsigned int width, unsigned int height, MaskPixelT initialValue,
71 : ImageBase<MaskPixelT>(lsst::geom::ExtentI(width, height)) {
72 _initializePlanes(planeDefs);
73 *this = initialValue;
74}
75
76template <typename MaskPixelT>
78 : ImageBase<MaskPixelT>(dimensions) {
79 _initializePlanes(planeDefs);
80 *this = 0x0;
81}
82
83template <typename MaskPixelT>
86 : ImageBase<MaskPixelT>(dimensions) {
87 _initializePlanes(planeDefs);
88 *this = initialValue;
89}
90
91template <typename MaskPixelT>
93 : ImageBase<MaskPixelT>(bbox) {
94 _initializePlanes(planeDefs);
95 *this = 0x0;
96}
97
98template <typename MaskPixelT>
100 : ImageBase<MaskPixelT>(bbox) {
101 _initializePlanes(planeDefs);
102 *this = initialValue;
104
105template <typename MaskPixelT>
107 bool const deep)
108 : ImageBase<MaskPixelT>(rhs, bbox, origin, deep), _maskDict(rhs._maskDict) {}
109
110template <typename MaskPixelT>
112 : ImageBase<MaskPixelT>(rhs, deep), _maskDict(rhs._maskDict) {}
113// Delegate to copy-constructor for backwards compatibility
114template <typename MaskPixelT>
116
117template <typename MaskPixelT>
118Mask<MaskPixelT>::~Mask() = default;
119
120template <typename MaskPixelT>
121Mask<MaskPixelT>::Mask(ndarray::Array<MaskPixelT, 2, 1> const& array, bool deep,
123 : image::ImageBase<MaskPixelT>(array, deep, xy0), _maskDict(detail::MaskDict::getDefault()) {}
124
125template <typename PixelT>
127 using std::swap; // See Meyers, Effective C++, Item 25
128
130 swap(_maskDict, rhs._maskDict);
131}
132
133template <typename PixelT>
135 a.swap(b);
136}
138template <typename MaskPixelT>
140 Mask tmp(rhs);
141 swap(tmp); // See Meyers, Effective C++, Item 11
142
143 return *this;
144}
145// Delegate to copy-assignment for backwards compatibility
146template <typename MaskPixelT>
148 return *this = rhs;
149}
150
151template <typename MaskPixelT>
153 fill_pixels(_getRawView(), rhs);
154
155 return *this;
156}
157
158#ifndef DOXYGEN // doc for this section is already in header
159
160template <typename MaskPixelT>
162 lsst::geom::Box2I const& bbox, ImageOrigin origin, bool conformMasks, bool allowUnsafe)
163 : ImageBase<MaskPixelT>(), _maskDict(detail::MaskDict::getDefault()) {
165 *this = reader.read<MaskPixelT>(bbox, origin, conformMasks, allowUnsafe);
166 if (metadata) {
167 metadata->combine(*reader.readMetadata());
168 }
169}
170
171template <typename MaskPixelT>
172Mask<MaskPixelT>::Mask(fits::MemFileManager& manager, int hdu,
174 ImageOrigin origin, bool conformMasks, bool allowUnsafe)
175 : ImageBase<MaskPixelT>(), _maskDict(detail::MaskDict::getDefault()) {
176 MaskFitsReader reader(manager, hdu);
177 *this = reader.read<MaskPixelT>(bbox, origin, conformMasks, allowUnsafe);
178 if (metadata) {
179 metadata->combine(*reader.readMetadata());
180 }
181}
182
183template <typename MaskPixelT>
185 lsst::geom::Box2I const& bbox, ImageOrigin const origin, bool const conformMasks,
186 bool allowUnsafe)
187 : ImageBase<MaskPixelT>(), _maskDict(detail::MaskDict::getDefault()) {
189 *this = reader.read<MaskPixelT>(bbox, origin, conformMasks, allowUnsafe);
190 if (metadata) {
191 metadata->combine(*reader.readMetadata());
192 }
193}
194
195template <typename MaskPixelT>
196void Mask<MaskPixelT>::writeFits(std::string const& fileName,
197 daf::base::PropertySet const * metadata_i,
198 std::string const& mode) const {
199 fits::Fits fitsfile(fileName, mode, fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
200 writeFits(fitsfile, metadata_i);
201}
202
203
204template <typename MaskPixelT>
205void Mask<MaskPixelT>::writeFits(fits::MemFileManager& manager,
206 daf::base::PropertySet const * metadata_i,
207 std::string const& mode) const {
208 fits::Fits fitsfile(manager, mode, fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
209 writeFits(fitsfile, metadata_i);
210}
211
212
213template <typename MaskPixelT>
214void Mask<MaskPixelT>::writeFits(fits::Fits& fitsfile,
215 daf::base::PropertySet const * metadata) const {
216 writeFits(fitsfile, fits::ImageWriteOptions(*this), metadata);
217}
218
219template <typename MaskPixelT>
220void Mask<MaskPixelT>::writeFits(std::string const& filename, fits::ImageWriteOptions const& options,
221 std::string const& mode,
222 daf::base::PropertySet const * header) const {
223 fits::Fits fitsfile(filename, mode, fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
224 writeFits(fitsfile, options, header);
225}
226
227
228template <typename MaskPixelT>
229void Mask<MaskPixelT>::writeFits(fits::MemFileManager& manager, fits::ImageWriteOptions const& options,
230 std::string const& mode,
231 daf::base::PropertySet const * header) const {
232 fits::Fits fitsfile(manager, mode, fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
233 writeFits(fitsfile, options, header);
236
237template <typename MaskPixelT>
239 daf::base::PropertySet const * header) const {
241 header ? header->deepCopy() : std::make_shared<dafBase::PropertySet>();
242 addMaskPlanesToMetadata(useHeader);
243 fitsfile.writeImage(*this, options, useHeader.get());
244}
246#endif // !DOXYGEN
247
248template <typename MaskPixelT>
250 std::string result = "";
251 MaskPlaneDict const& mpd = _maskPlaneDict()->getMaskPlaneDict();
252 for (auto const &iter : mpd) {
253 if (value & getBitMask(iter.second)) {
254 if (result.size() > 0) {
255 result += ",";
257 result += iter.first;
258 }
260 return result;
262
263template <typename MaskPixelT>
265 int id = getMaskPlaneNoThrow(name); // see if the plane is already available
267 if (id < 0) { // doesn't exist
268 id = _maskPlaneDict()->getUnusedPlane();
269 }
270
271 // build new entry, adding the plane to all Masks where this is no contradiction
272
273 if (id >= getNumPlanesMax()) { // Max number of planes is already allocated
275 str(boost::format("Max number of planes (%1%) already used") % getNumPlanesMax()));
276 }
277
279
280 return id;
281}
282
283template <typename MaskPixelT>
284int Mask<MaskPixelT>::addMaskPlane(std::string name, int planeId) {
285 if (planeId < 0 || planeId >= getNumPlanesMax()) {
286 throw LSST_EXCEPT(
288 str(boost::format("mask plane ID must be between 0 and %1%") % (getNumPlanesMax() - 1)));
289 }
290
291 _maskPlaneDict()->add(name, planeId);
292
293 return planeId;
294}
296template <typename MaskPixelT>
298 return _maskDict->getMaskPlaneDict();
299}
301template <typename MaskPixelT>
303 if (detail::MaskDict::getDefault()->getMaskPlane(name) < 0) {
305 str(boost::format("Plane %s doesn't exist in the default Mask") % name));
306 }
307
308 detail::MaskDict::detachDefault(); // leave current Masks alone
309 _maskPlaneDict()->erase(name);
310}
311
312template <typename MaskPixelT>
314
315) {
316 clearMaskPlane(getMaskPlane(name)); // clear this bits in this Mask
317
318 if (_maskDict == detail::MaskDict::getDefault() && removeFromDefault) { // we are the default
319 ;
320 } else {
321 _maskDict = _maskDict->clone();
322 }
324 _maskDict->erase(name);
325
326 if (removeFromDefault && detail::MaskDict::getDefault()->getMaskPlane(name) >= 0) {
327 removeMaskPlane(name);
328 }
329}
330
331template <typename MaskPixelT>
333 return (planeId >= 0 && planeId < getNumPlanesMax()) ? (1 << planeId) : 0;
334}
335
336template <typename MaskPixelT>
337MaskPixelT Mask<MaskPixelT>::getBitMask(int planeId) {
338 MaskPlaneDict const& mpd = _maskPlaneDict()->getMaskPlaneDict();
340 for (auto const &i : mpd) {
341 if (planeId == i.second) {
342 MaskPixelT const bitmask = getBitMaskNoThrow(planeId);
343 if (bitmask == 0) { // failed
344 break;
345 }
346 return bitmask;
347 }
348 }
350 str(boost::format("Invalid mask plane ID: %d") % planeId));
351}
352
353template <typename MaskPixelT>
355 int const plane = getMaskPlaneNoThrow(name);
356
357 if (plane < 0) {
359 str(boost::format("Invalid mask plane name: %s") % name));
360 } else {
361 return plane;
362 }
363}
364
365template <typename MaskPixelT>
367 return _maskPlaneDict()->getMaskPlane(name);
368}
369
370template <typename MaskPixelT>
372 return getBitMask(getMaskPlane(name));
373}
374
375template <typename MaskPixelT>
377 MaskPixelT mpix = 0x0;
378 for (auto const &it : name) {
379 mpix |= getBitMask(getMaskPlane(it));
380 }
381 return mpix;
382}
383
384template <typename MaskPixelT>
386 return _maskPlaneDict()->size();
387}
388
389template <typename MaskPixelT>
391 _maskPlaneDict()->clear();
392}
393
394template <typename MaskPixelT>
396 *this = 0;
397}
398
399template <typename MaskPixelT>
401 *this &= ~getBitMask(planeId);
402}
403
404template <typename MaskPixelT>
407
408 if (*_maskDict == *currentMD) {
409 if (*detail::MaskDict::getDefault() == *_maskDict) {
410 return; // nothing to do
411 }
412 } else {
413 //
414 // Find out which planes need to be permuted
415 //
416 MaskPixelT keepBitmask = 0; // mask of bits to keep
417 MaskPixelT canonicalMask[sizeof(MaskPixelT) * 8]; // bits in lsst::afw::image::Mask that should be
418 MaskPixelT currentMask[sizeof(MaskPixelT) * 8]; // mapped to these bits
419 int numReMap = 0;
420
421 for (auto const &i : currentPlaneDict) {
422 std::string const name = i.first; // name of mask plane
423 int const currentPlaneNumber = i.second; // plane number currently in use
424 int canonicalPlaneNumber = getMaskPlaneNoThrow(name); // plane number in lsst::afw::image::Mask
425
426 if (canonicalPlaneNumber < 0) { // no such plane; add it
427 canonicalPlaneNumber = addMaskPlane(name);
428 }
429
431 keepBitmask |= getBitMask(canonicalPlaneNumber); // bit is unchanged, so preserve it
432 } else {
434 currentMask[numReMap] = getBitMaskNoThrow(currentPlaneNumber);
435 numReMap++;
436 }
437 }
438
439 // Now loop over all pixels in Mask
440 if (numReMap > 0) {
441 for (int r = 0; r != this->getHeight(); ++r) { // "this->": Meyers, Effective C++, Item 43
442 for (typename Mask::x_iterator ptr = this->row_begin(r), end = this->row_end(r); ptr != end;
443 ++ptr) {
444 MaskPixelT const pixel = *ptr;
445
446 MaskPixelT newPixel = pixel & keepBitmask; // value of invariant mask bits
447 for (int i = 0; i < numReMap; i++) {
448 if (pixel & currentMask[i]) newPixel |= canonicalMask[i];
449 }
450
451 *ptr = newPixel;
452 }
453 }
455 }
456 // We've made the planes match the current mask dictionary
457 _maskDict = detail::MaskDict::getDefault();
458}
459
460template <typename MaskPixelT>
464
465template <typename MaskPixelT>
467 CheckIndices const& check) {
468 return this->ImageBase<MaskPixelT>::operator()(x, y, check);
469}
470
471template <typename MaskPixelT>
475
476template <typename MaskPixelT>
478 int x, int y, CheckIndices const& check) const {
479 return this->ImageBase<MaskPixelT>::operator()(x, y, check);
480}
481
482template <typename MaskPixelT>
483bool Mask<MaskPixelT>::operator()(int x, int y, int planeId) const {
484 // !! converts an int to a bool
485 return !!(this->ImageBase<MaskPixelT>::operator()(x, y) & getBitMask(planeId));
486}
487
488template <typename MaskPixelT>
489bool Mask<MaskPixelT>::operator()(int x, int y, int planeId, CheckIndices const& check) const {
490 // !! converts an int to a bool
491 return !!(this->ImageBase<MaskPixelT>::operator()(x, y, check) & getBitMask(planeId));
492}
493
494template <typename MaskPixelT>
496 if (*_maskDict != *other._maskDict) {
497 throw LSST_EXCEPT(pexExcept::RuntimeError, "Mask dictionaries do not match");
498 }
499}
501template <typename MaskPixelT>
503 transform_pixels(_getRawView(), _getRawView(),
504 [&val](MaskPixelT const& l) -> MaskPixelT { return l | val; });
505 return *this;
507
508template <typename MaskPixelT>
510 checkMaskDictionaries(rhs);
512 if (this->getDimensions() != rhs.getDimensions()) {
514 str(boost::format("Images are of different size, %dx%d v %dx%d") %
515 this->getWidth() % this->getHeight() % rhs.getWidth() % rhs.getHeight()));
516 }
517 transform_pixels(_getRawView(), rhs._getRawView(), _getRawView(),
518 [](MaskPixelT const& l, MaskPixelT const& r) -> MaskPixelT { return l | r; });
519 return *this;
520}
521
522template <typename MaskPixelT>
524 transform_pixels(_getRawView(), _getRawView(), [&val](MaskPixelT const& l) { return l & val; });
525 return *this;
526}
527
528template <typename MaskPixelT>
530 checkMaskDictionaries(rhs);
531
532 if (this->getDimensions() != rhs.getDimensions()) {
534 str(boost::format("Images are of different size, %dx%d v %dx%d") %
535 this->getWidth() % this->getHeight() % rhs.getWidth() % rhs.getHeight()));
536 }
537 transform_pixels(_getRawView(), rhs._getRawView(), _getRawView(),
538 [](MaskPixelT const& l, MaskPixelT const& r) -> MaskPixelT { return l & r; });
539 return *this;
540}
541
542template <typename MaskPixelT>
544 transform_pixels(_getRawView(), _getRawView(),
545 [&val](MaskPixelT const& l) -> MaskPixelT { return l ^ val; });
546 return *this;
547}
548
549template <typename MaskPixelT>
551 checkMaskDictionaries(rhs);
552
553 if (this->getDimensions() != rhs.getDimensions()) {
555 str(boost::format("Images are of different size, %dx%d v %dx%d") %
556 this->getWidth() % this->getHeight() % rhs.getWidth() % rhs.getHeight()));
557 }
558 transform_pixels(_getRawView(), rhs._getRawView(), _getRawView(),
559 [](MaskPixelT const& l, MaskPixelT const& r) -> MaskPixelT { return l ^ r; });
560 return *this;
561}
562
563template <typename MaskPixelT>
564void Mask<MaskPixelT>::setMaskPlaneValues(int const planeId, int const x0, int const x1, int const y) {
565 MaskPixelT const bitMask = getBitMask(planeId);
566
567 for (int x = x0; x <= x1; x++) {
568 operator()(x, y) = operator()(x, y) | bitMask;
569 }
570}
571
572template <typename MaskPixelT>
574 if (!metadata) {
575 throw LSST_EXCEPT(pexExcept::InvalidParameterError, "Null std::shared_ptr<PropertySet>");
576 }
577
578 // First, clear existing MaskPlane metadata
580 NameList paramNames = metadata->paramNames(false);
581 for (auto const &paramName : paramNames) {
582 if (paramName.compare(0, maskPlanePrefix.size(), maskPlanePrefix) == 0) {
583 metadata->remove(paramName);
584 }
585 }
586
587 MaskPlaneDict const& mpd = _maskPlaneDict()->getMaskPlaneDict();
588
589 // Add new MaskPlane metadata
590 for (auto const &i : mpd) {
591 std::string const& planeName = i.first;
592 int const planeNumber = i.second;
593
594 if (planeName != "") {
595 metadata->add(maskPlanePrefix + planeName, planeNumber);
596 }
597 }
598}
599
600template <typename MaskPixelT>
604
605 // First, clear existing MaskPlane metadata
607 NameList paramNames = metadata->paramNames(false);
608 int numPlanesUsed = 0; // number of planes used
609
610 // Iterate over childless properties with names starting with maskPlanePrefix
611 for (auto const &paramName : paramNames) {
612 if (paramName.compare(0, maskPlanePrefix.size(), maskPlanePrefix) == 0) {
613 // split off maskPlanePrefix to obtain plane name
614 std::string planeName = paramName.substr(maskPlanePrefix.size());
615 int const planeId = metadata->getAsInt(paramName);
616
617 MaskPlaneDict::const_iterator plane = newDict.find(planeName);
618 if (plane != newDict.end() && planeId != plane->second) {
619 throw LSST_EXCEPT(pexExcept::RuntimeError, "File specifies plane " + planeName + " twice");
620 }
621 for (MaskPlaneDict::const_iterator j = newDict.begin(); j != newDict.end(); ++j) {
622 if (planeId == j->second) {
624 str(boost::format("File specifies plane %s has same value (%d) as %s") %
625 planeName % planeId % j->first));
626 }
627 }
628 // build new entry
629 if (numPlanesUsed >= getNumPlanesMax()) {
630 // Max number of planes already allocated
631 throw LSST_EXCEPT(
633 str(boost::format("Max number of planes (%1%) already used") % getNumPlanesMax()));
634 }
636 }
637 }
638 return newDict;
639}
640
641template <typename MaskPixelT>
643 _maskDict->print();
644}
645
646/*
647 * Static members of Mask
648 */
649template <typename MaskPixelT>
651
652template <typename MaskPixelT>
655}
656
657//
658// Explicit instantiations
659//
660template class Mask<MaskPixel>;
661} // namespace image
662} // namespace afw
663} // namespace lsst
py::object result
Definition _schema.cc:429
table::Key< std::string > name
Definition Amplifier.cc:116
AmpInfoBoxKey bbox
Definition Amplifier.cc:117
int end
table::Key< int > id
Definition Detector.cc:162
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48
LSST DM logging module built on log4cxx.
#define LOGL_DEBUG(logger, message...)
Log a debug-level message using a varargs/printf style interface.
Definition Log.h:515
std::uint64_t * ptr
Definition RangeSet.cc:95
int y
Definition SpanSet.cc:48
table::Key< int > b
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
Definition fits.h:308
A class used to request that array accesses be checked.
Definition ImageBase.h:74
The base class for all image classed (Image, Mask, MaskedImage, ...)
Definition ImageBase.h:102
typename Reference< PixelT >::type PixelReference
A Reference to a PixelT.
Definition ImageBase.h:117
PixelReference operator()(int x, int y)
Return a reference to the pixel (x, y) in LOCAL coordinates.
Definition Image.cc:171
int getWidth() const
Return the number of columns in the image.
Definition ImageBase.h:294
lsst::geom::Extent2I getDimensions() const
Return the image's size; useful for passing to constructors.
Definition ImageBase.h:356
typename ndarray::Array< PixelT, 2, 1 > Array
A mutable ndarray representation of the image.
Definition ImageBase.h:149
int getHeight() const
Return the number of rows in the image.
Definition ImageBase.h:296
_view_t _getRawView() const
Definition ImageBase.h:465
void swap(ImageBase &rhs)
Definition Image.cc:233
typename ConstReference< PixelT >::type PixelConstReference
A ConstReference to a PixelT.
Definition ImageBase.h:119
A FITS reader class for Masks.
Represent a 2-dimensional array of bitmask pixels.
Definition Mask.h:82
friend class MaskFitsReader
Definition Mask.h:531
static int getMaskPlane(const std::string &name)
Return the mask plane number corresponding to a plane name.
Definition Mask.cc:354
MaskPlaneDict const & getMaskPlaneDict() const
Return the Mask's maskPlaneDict.
Definition Mask.cc:297
static void addAllMasksPlane(std::string const &name, int bitId)
Definition MaskDict.cc:118
static std::shared_ptr< MaskDict > detachDefault()
Definition MaskDict.cc:116
static std::shared_ptr< MaskDict > getDefault()
Definition MaskDict.cc:112
static std::shared_ptr< MaskDict > copyOrGetDefault(MaskPlaneDict const &dict)
Definition MaskDict.cc:108
Class for storing generic metadata.
Definition PropertySet.h:66
An integer coordinate rectangle.
Definition Box.h:55
Reports invalid arguments.
Definition Runtime.h:66
Reports attempts to exceed implementation-defined length limits for some classes.
Definition Runtime.h:76
Reports when the result of an operation cannot be represented by the destination type.
Definition Runtime.h:115
Reports errors that are due to events beyond the control of the program.
Definition Runtime.h:104
void swap(Image< PixelT > &a, Image< PixelT > &b)
Definition Image.cc:443
writeFits(filename, stamps, metadata, type_name, write_mask, write_variance, write_archive=False)
Definition stamps.py:40
ImageT val
Definition CR.cc:146
Options for writing an image to FITS.
Definition fits.h:223
T substr(T... args)
T swap(T... args)
g2d::python::Image< bool > Mask
Definition test_image.cc:16