LSSTApplications
19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
29 #ifndef LSST_IMAGE_MASKEDIMAGE_H
30 #define LSST_IMAGE_MASKEDIMAGE_H
38 #include "boost/mpl/at.hpp"
39 #include "boost/iterator/zip_iterator.hpp"
40 #include "boost/tuple/tuple.hpp"
91 template <
typename ImagePT = ImagePixelT,
typename MaskPT = MaskPixelT,
typename VarPT = VariancePixelT>
98 template <
typename,
typename,
typename>
101 template <
typename,
typename,
typename>
104 template <
typename,
typename,
typename>
107 template <
typename,
typename,
typename>
116 template <
typename ImageIterator,
typename MaskIterator,
typename VarianceIterator,
117 template <
typename>
class Ref =
Reference>
119 typedef boost::tuple<ImageIterator, MaskIterator, VarianceIterator> IMV_iterator_tuple;
125 typedef typename boost::zip_iterator<IMV_iterator_tuple>::reference
IMV_tuple;
129 template <
typename,
typename,
typename>
136 VarianceIterator
const& var)
177 return &this->
_iter->template get<0>() - &rhs.
_iter->template get<0>();
181 return &this->
_iter->template get<0>() == &rhs.
_iter->template get<0>();
185 return &this->
_iter->template get<0>() != &rhs.
_iter->template get<0>();
189 return &this->
_iter->template get<0>() < &rhs.
_iter->template get<0>();
194 _iter->template get<2>()[0]);
203 typename boost::zip_iterator<IMV_iterator_tuple>
_iter;
207 template <
typename ImageIterator,
typename MaskIterator,
typename VarianceIterator>
211 MaskedImageIteratorBase_t;
226 template <
typename ImageIterator,
typename MaskIterator,
typename VarianceIterator>
227 class const_MaskedImageIterator
228 :
public MaskedImageIteratorBase<typename detail::const_iterator_type<ImageIterator>::type,
229 typename detail::const_iterator_type<MaskIterator>::type,
230 typename detail::const_iterator_type<VarianceIterator>::type,
236 typedef MaskedImageIteratorBase<const_ImageIterator, const_MaskIterator, const_VarianceIterator,
238 MaskedImageIteratorBase_t;
244 const_ImageIterator(
iter.get_iterator_tuple().template get<0>()),
245 const_MaskIterator(
iter.get_iterator_tuple().template get<1>()),
246 const_VarianceIterator(
iter.get_iterator_tuple().template get<2>())) {
259 template <
typename ImageLocator,
typename MaskLocator,
typename VarianceLocator,
260 template <
typename>
class Ref =
Reference>
262 typedef typename boost::tuple<ImageLocator, MaskLocator, VarianceLocator> IMVLocator;
268 template <
template <
typename>
class X_OR_Y>
269 class _x_or_y_iterator {
275 X_OR_Y<ImageLocator>(_mil->_loc.template get<0>())() += di;
276 X_OR_Y<MaskLocator>(_mil->_loc.template get<1>())() += di;
277 X_OR_Y<VarianceLocator>(_mil->_loc.template get<2>())() += di;
281 _x_or_y_iterator& operator++() {
283 ++X_OR_Y<ImageLocator>(_mil->_loc.template get<0>())();
284 ++X_OR_Y<MaskLocator>(_mil->_loc.template get<1>())();
285 ++X_OR_Y<VarianceLocator>(_mil->_loc.template get<2>())();
289 bool operator==(_x_or_y_iterator
const& rhs) {
290 return X_OR_Y<ImageLocator>(_mil->_loc.template get<0>())() ==
291 X_OR_Y<ImageLocator>(rhs._mil->_loc.template get<0>())();
293 bool operator!=(_x_or_y_iterator
const& rhs) {
294 return X_OR_Y<ImageLocator>(_mil->_loc.template get<0>())() !=
295 X_OR_Y<ImageLocator>(rhs._mil->_loc.template get<0>())();
297 bool operator<(_x_or_y_iterator
const& rhs) {
298 return X_OR_Y<ImageLocator>(_mil->_loc.template get<0>())() <
299 X_OR_Y<ImageLocator>(rhs._mil->_loc.template get<0>())();
303 return Pixel((*(X_OR_Y<ImageLocator>(_mil->_loc.template get<0>())()))[0],
304 (*(X_OR_Y<MaskLocator>(_mil->_loc.template get<1>())()))[0],
305 (*(X_OR_Y<VarianceLocator>(_mil->_loc.template get<2>())()))[0]);
311 return (*(X_OR_Y<ImageLocator>(_mil->_loc.template get<0>())()))[0];
314 return (*(X_OR_Y<MaskLocator>(_mil->_loc.template get<1>())()))[0];
317 return (*(X_OR_Y<VarianceLocator>(_mil->_loc.template get<2>())()))[0];
325 template <
typename LocT>
327 typedef typename LocT::x_iterator IterT;
330 apply_x(LocT& loc) :
_loc(loc) {}
337 template <
typename LocT>
339 typedef typename LocT::y_iterator IterT;
342 apply_y(LocT& loc) :
_loc(loc) {}
350 typedef typename boost::tuple<
typename ImageLocator::cached_location_t,
351 typename MaskLocator::cached_location_t,
352 typename VarianceLocator::cached_location_t>
363 template <
typename,
typename,
typename>
378 :
_loc(img, msk, var) {
384 return Pixel(
_loc.template get<0>().x()[0][0],
_loc.template get<1>().x()[0][0],
385 _loc.template get<2>().x()[0][0]);
391 _loc.template get<2>()(
x,
y)[0]);
397 return Pixel(
_loc.template get<0>()[cached_loc.
_imv.template get<0>()][0],
398 _loc.template get<1>()[cached_loc.
_imv.template get<1>()][0],
399 _loc.template get<2>()[cached_loc.
_imv.template get<2>()][0]);
420 typedef typename boost::mpl::vector<ImagePixelT, MaskPixelT, VariancePixelT>
PixelTVec;
422 template <
typename N>
425 return _loc.template get<N::value>()[cached_loc.
_imv.template get<N::value>()][0];
428 template <
typename N>
430 return _loc.template get<N::value>()[0][0];
433 template <
typename N>
435 return _loc.template get<N::value>()(
x,
y)[0];
442 return apply_IMV<boost::mpl::int_<0>>(cached_loc);
451 return apply_IMV<boost::mpl::int_<1>>(cached_loc);
460 return apply_IMV<boost::mpl::int_<2>>(cached_loc);
466 return apply_IMV<boost::mpl::int_<2>>(
x,
y);
471 return _loc.template get<0>() == rhs.
_loc.template get<0>();
477 return _loc.template get<0>() < rhs.
_loc.template get<0>();
482 return operator+=(detail::difference_type(p.first, p.second));
487 _loc.template get<0>() += p;
488 _loc.template get<1>() += p;
489 _loc.template get<2>() += p;
503 template <
typename ImageLocator,
typename MaskLocator,
typename VarianceLocator>
513 template <
typename ImageLocator,
typename MaskLocator,
typename VarianceLocator>
514 class const_MaskedImageLocator
515 :
public MaskedImageLocatorBase<typename detail::const_locator_type<ImageLocator>::type,
516 typename detail::const_locator_type<MaskLocator>::type,
517 typename detail::const_locator_type<VarianceLocator>::type,
523 typedef MaskedImageLocatorBase<const_ImageLocator, const_MaskLocator, const_VarianceLocator,
525 MaskedImageLocatorBase_t;
530 const_MaskLocator(
iter.getLoc().template get<1>()),
531 const_VarianceLocator(
iter.getLoc().template get<2>())) {
548 #if 0 // doesn't compile. I should fix this, but it's low priority. RHL
598 explicit MaskedImage(
unsigned int width,
unsigned int height,
651 bool conformMasks =
false,
bool needAllHdus =
false,
656 bool allowUnsafe =
false);
679 bool conformMasks =
false,
bool needAllHdus =
false,
684 bool allowUnsafe =
false);
707 bool conformMasks =
false,
bool needAllHdus =
false,
712 bool allowUnsafe =
false);
733 bool const deep =
false);
739 template <
typename OtherPixelT>
744 : _image(), _mask(), _variance() {
747 "Only deep copies are permitted for MaskedImages with different pixel types");
1136 _mask->setXY0(origin);
1140 _variance->setXY0(origin);
1213 #else // bypass checks for non-NULL pointers
1219 return x_iterator(imageEnd, maskEnd, varianceEnd);
1233 #else // bypass checks for non-NULL pointers
1238 return y_iterator(imageEnd, maskEnd, varianceEnd);
1247 #else // bypass checks for non-NULL pointers
1253 return xy_locator(imageEnd, maskEnd, varianceEnd);
1257 void conformSizes();
1267 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
1279 template <
typename ImagePixelT1,
typename ImagePixelT2>
1280 bool imagesOverlap(MaskedImage<ImagePixelT1, MaskPixel, VariancePixel>
const& image1,
1281 MaskedImage<ImagePixelT2, MaskPixel, VariancePixel>
const& image2);
1301 template <
typename ImageT,
typename TagT>
1303 typedef ImageT
type;
1307 template <
typename ImageT>
1308 struct GetImage_<ImageT, typename
image::detail::MaskedImage_tag> {
1309 typedef typename ImageT::Image
type;
1314 template <
typename ImageT>
1315 struct GetImage :
public GetImage_<ImageT, typename ImageT::image_category> {};
1320 #endif // LSST_IMAGE_MASKEDIMAGE_H
Ref< typename boost::mpl::at< PixelTVec, N >::type >::type apply_IMV(cached_location_t const &cached_loc)
boost::zip_iterator< IMV_iterator_tuple >::reference IMV_tuple
The underlying iterator tuple.
Ref< VariancePixelT >::type variance(cached_location_t const &cached_loc)
Return a reference to the variance at the offset set when we created the cached_location_t
MaskedImage(MaskedImage< OtherPixelT, MaskPixelT, VariancePixelT > const &rhs, const bool deep)
generalised copy constructor; defined here in the header so that the compiler can instantiate N(N-1)/...
bool operator<(MaskedImageIteratorBase const &rhs)
Return true if the lhs is less than the rhs.
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
boost::zip_iterator< IMV_iterator_tuple > _iter
void swap(MaskedImage &rhs)
detail::MaskedImage_tag image_category
Ref< VariancePixelT >::type variance(int x, int y)
Return a reference to the variance offset by (x, y) from the current position of the locator.
The base class for MaskedImageIterators (const and non-const)
void scaledMultiplies(double const c, MaskedImage const &rhs)
void assign(ImageBase const &rhs, lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT)
Copy pixels from another image to a specified subregion of this image.
x_iterator row_begin(int y) const
Return an x_iterator to the start of the image.
const Pixel operator*() const
Dereference the iterator, returning a const Pixel.
MaskedImage & operator-=(lsst::afw::image::Image< ImagePixelT > const &rhs)
xy_locator xy_at(int x, int y) const
Return an xy_locator at the point (x, y)
iterator begin() const
Return an iterator to the start of the image.
An iterator to the MaskedImage.
Represent a 2-dimensional array of bitmask pixels.
A pixel of a MaskedImage.
Ref< typename boost::mpl::at< PixelTVec, N >::type >::type apply_IMV(int x, int y)
std::shared_ptr< image::Image< ImagePixelT > > ImagePtr
shared pointer to the Image
A const locator for the MaskedImage.
x_iterator row_end(int y) const
Return an x_iterator to the end of the image.
A single pixel of the same type as a MaskedImage.
Pixel operator*()
Dereference the iterator, returning a Pixel.
MaskedImageIterator(ImageIterator &img, MaskIterator &msk, VarianceIterator &var)
Pixel operator*()
Dereference a locator, returning a Pixel.
static MaskedImage readFits(std::string const &filename)
Read a MaskedImage from a regular FITS file.
bool operator<(MaskedImageLocatorBase const &rhs)
Return true iff lhs is less than rhs.
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
Ref< VariancePixelT >::type variance()
Return a reference to the variance at the current position of the locator.
MaskedImage & operator+=(lsst::afw::math::Function2< double > const &function)
MaskedImage & operator+=(lsst::afw::image::Image< ImagePixelT > const &rhs)
double indexToPosition(double ind, lsst::afw::image::xOrY const xy) const
Convert image index to image position (see Image::indexToPosition)
y_iterator y_at(int x, int y) const
Return an y_iterator to the point (x, y) in the image.
MaskedImageIteratorBase operator++(int)
Increment the iterator (postfix)
MaskedImage & operator=(MaskedImage const &rhs)
Make the lhs use the rhs's pixels.
MaskedImage & operator/=(lsst::afw::image::Image< ImagePixelT > const &rhs)
Ref< ImagePixelT >::type image()
Return (a reference to) the image part of the Pixel pointed at by the iterator.
lsst::afw::image::pixel::SinglePixel< ImagePixelT, MaskPixelT, VariancePixelT > SinglePixel
A single Pixel of the same type as those in the MaskedImage.
std::string const compressedFileNoMEF_RE
regexp to identify compressed files that we can't write MEFs to
A templated class to return this classes' type (present in Image/Mask/MaskedImage)
y_iterator y()
Return an iterator that can be used to move (or dereference) a locator.
x_iterator x()
Return an iterator that can be used to move (or dereference) a locator.
MaskedImage & operator-=(lsst::afw::math::Function2< double > const &function)
_view_t::reverse_iterator reverse_iterator
An STL compliant reverse iterator.
double indexToPosition(double ind, lsst::afw::image::xOrY const xy) const
Convert image index to image position.
_view_t::y_iterator y_iterator
An iterator for traversing the pixels in a column.
x_iterator x_at(int x, int y) const
Return an x_iterator at the point (x, y)
lsst::geom::Box2I getBBox(ImageOrigin const origin=PARENT) const
Ref< MaskPixelT >::type mask(int x, int y)
Return a reference to the mask offset by (x, y) from the current position of the locator.
_view_t::xy_locator xy_locator
An xy_locator.
MaskedImage & operator=(MaskedImage &&rhs)
MaskedImage(unsigned int width, unsigned int height, MaskPlaneDict const &planeDict=MaskPlaneDict())
Construct from a supplied dimensions.
MaskedImage< ImagePT, MaskPT, VarPT > type
Return the desired type.
bool operator!=(MaskedImageIteratorBase const &rhs)
Return true if the lhs doesn't equal the rhs.
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)
Ref< MaskPixelT >::type mask()
Return (a reference to) the mask part of the Pixel pointed at by the iterator.
bool operator!=(MaskedImageLocatorBase const &rhs)
Return true iff two locators are not equal.
int getWidth() const
Return the number of columns in the image.
Lifetime-management for memory that goes into FITS memory files.
int getHeight() const
Return the number of rows in the image.
int getHeight() const
Return the number of rows in the image.
std::pair< int, double > positionToIndex(double const pos, lsst::afw::image::xOrY const xy) const
Convert image position to index (see Image::positionToIndex)
const_MaskedImageIterator & operator+(std::ptrdiff_t delta)
Return a const_MaskedImageIterator that's delta beyond this.
Options for writing an image to FITS.
MaskedImage & operator*=(lsst::afw::image::Image< ImagePixelT > const &rhs)
void setMask(Mask const &other)
Set the mask plane's pixel values to those of another Mask.
IMVLocator const & getLoc() const
y_iterator col_end(int x) const
Return an y_iterator to the end of the image.
boost::mpl::vector< ImagePixelT, MaskPixelT, VariancePixelT > PixelTVec
lsst::afw::image::Image< VariancePixelT > Variance
x_iterator x_at(int x, int y) const
Return an x_iterator to the point (x, y) in the image.
MaskedImageIteratorBase & operator++()
Increment the iterator (prefix)
metafunction to extract const reference type from PixelT
metafunction to extract reference type from PixelT
int getY0() const
Return the image's row-origin.
lsst::geom::Point2I getXY0() const
Return the image's origin.
const_MaskedImageLocator(MaskedImageLocator< ImageLocator, MaskLocator, VarianceLocator > const &iter)
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.
A class to manipulate images, masks, and variance as a single object.
std::string const fitsFile_RE
regexp to identify when MaskedImages should be written as MEFs
MaskedImageLocatorBase & operator+=(pair2I const &p)
Increment the locator's x and y positions by p
cached_location_t(IMVLocator const &loc, int x, int y)
Create a cached_location_t that can be used to access pixels (x, y) away from loc
A traits class for MaskedImage.
reverse_iterator rbegin() const
Return a reverse_iterator to the start of the image.
void setXY0(lsst::geom::Point2I const origin)
Set the MaskedImage's origin.
xy_locator xy_at(int x, int y) const
Return an xy_locator at the point (x, y) in the image.
Ref< MaskPixelT >::type mask(cached_location_t const &cached_loc)
Return a reference to the mask at the offset set when we created the cached_location_t
void setImage(Image const &other)
Set the image plane's pixel values to those of another Image.
boost::tuple< typename ImageLocator::cached_location_t, typename MaskLocator::cached_location_t, typename VarianceLocator::cached_location_t > IMVCachedLocation
Ref< ImagePixelT >::type image()
Return a reference to the image at the current position of the locator.
ItemVariant const * other
MaskedImageLocator< typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator > xy_locator
A locator for a MaskedImage.
MaskedImage operator[](lsst::geom::Box2I const &bbox) const
Return a subimage corresponding to the given box (interpreted as PARENT coordinates).
float VariancePixel
default type for MaskedImage variance images
A class used to identify classes that represent MaskedImage pixels.
int getX0() const
Return the image's column-origin.
bool operator==(MaskedImageIteratorBase const &rhs)
Return true if the lhs equals the rhs.
MaskedImage & operator/=(ImagePixelT const rhs)
iterator at(int const x, int const y) const
Return an iterator at the point (x, y)
Mask< MaskPixelT >::MaskPlaneDict MaskPlaneDict
The Mask's MaskPlaneDict.
std::shared_ptr< image::Image< VariancePixelT > > VariancePtr
shared pointer to the variance Image
void scaledPlus(double const c, MaskedImage const &rhs)
Add a scaled MaskedImage c*rhs to a MaskedImage.
afw::table::PointKey< int > dimensions
lsst::afw::image::Mask< MaskPixelT > Mask
std::int32_t MaskPixel
default type for Masks and MaskedImage Masks
MaskedImage & operator+=(ImagePixelT const rhs)
Add a scalar rhs to a MaskedImage.
static MaskedImage readFits(fits::MemFileManager &manager)
Read a MaskedImage from a FITS RAM file.
MaskedImageIteratorBase(ImageIterator const &img, MaskIterator const &msk, VarianceIterator const &var)
Construct a MaskedImageIteratorBase from the image/mask/variance iterators.
void scaledMinus(double const c, MaskedImage const &rhs)
Subtract a scaled MaskedImage c*rhs from a MaskedImage.
virtual ~MaskedImage()=default
cached_location_t cache_location(int x, int y) const
Create a cached_location_t offset by (x, y) from locator.
_view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
iterator end() const
Return an iterator to the end of the image.
MaskedImageIterator< typename Image::reverse_iterator, typename Mask::reverse_iterator, typename Variance::reverse_iterator > reverse_iterator
lsst::afw::image::pixel::Pixel< ImagePixelT, MaskPixelT, VariancePixelT > Pixel
A Pixel in the MaskedImage.
MaskedImageIteratorBase & operator-=(std::ptrdiff_t delta)
Decrement the iterator by delta
const_MaskedImageIterator< typename Image::iterator, typename Mask::iterator, typename Variance::iterator > const_iterator
A base class for image defects.
VariancePtr getVariance() const
Return a (shared_ptr to) the MaskedImage's variance.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
MaskedImageIteratorBase & operator+=(std::ptrdiff_t delta)
Increment the iterator by delta
void scaledDivides(double const c, MaskedImage const &rhs)
std::shared_ptr< image::Mask< MaskPixelT > > MaskPtr
shared pointer to the Mask
const_MaskedImageLocator< typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator > const_xy_locator
A const_locator for a MaskedImage.
A saved relative position, providing efficient access to neighbouring pixels.
Ref< ImagePixelT >::type image(int x, int y)
Return a reference to the image offset by (x, y) from the current position of the locator.
int getX0() const
Return the image's column-origin.
lsst::geom::Extent2I getDimensions() const
Return the image's size; useful for passing to constructors.
MaskedImageLocatorBase & operator+=(detail::difference_type p)
Increment the locator's x and y positions by p
Ref< MaskPixelT >::type mask()
Return a reference to the mask at the current position of the locator.
MaskedImageLocatorBase(ImageLocator const &img, MaskLocator const &msk, VarianceLocator const &var)
Construct a MaskedImageLocator from image/mask/variance locators.
Reports invalid arguments.
std::ptrdiff_t operator-(MaskedImageIteratorBase const &rhs)
Return the distance between two iterators.
x_iterator fast_iterator
A fast STL compliant iterator for contiguous images N.b.
_x_or_y_iterator< apply_y > y_iterator
A y_iterator that provides a view of the xy_locator (i.e. advancing one advances the other)
MaskedImageIterator< typename Image::y_iterator, typename Mask::y_iterator, typename Variance::y_iterator > y_iterator
An iterator to a column of a MaskedImage.
A locator for the MaskedImage.
Ref< VariancePixelT >::type variance()
Return (a reference to) the variance part of the Pixel pointed at by the iterator.
MaskedImageIterator operator+(std::ptrdiff_t delta)
Return a MaskedImageIterator that's delta beyond this.
Pixel operator[](cached_location_t const &cached_loc)
Dereference a locator, returning a Pixel offset by the amount set when we created the cached_location...
_view_t::iterator iterator
An STL compliant iterator.
Pixel type
Type pointed to by the iterator.
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
Ref< ImagePixelT >::type image(cached_location_t const &cached_loc)
Return a reference to the image at the offset set when we created the cached_location_t
An const iterator to the MaskedImage.
An integer coordinate rectangle.
MaskedImageLocator(ImageLocator &img, MaskLocator &msk, VarianceLocator &var)
lsst::geom::Point2I getXY0() const
Return the image's origin.
ImagePtr getImage() const
Return a (shared_ptr to) the MaskedImage's image.
void setXY0(lsst::geom::Point2I const origin)
Set the ImageBase's origin.
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > * makeMaskedImage(typename std::shared_ptr< Image< ImagePixelT >> image, typename std::shared_ptr< Mask< MaskPixelT >> mask=Mask< MaskPixelT >(), typename std::shared_ptr< Image< VariancePixelT >> variance=Image< VariancePixelT >())
A function to return a MaskedImage of the correct type (cf.
int getY0() const
Return the image's row-origin.
MaskedImageIterator< typename Image::iterator, typename Mask::iterator, typename Variance::iterator > iterator
bool imagesOverlap(ImageBase< T1 > const &image1, ImageBase< T2 > const &image2)
Return true if the pixels for two images or masks overlap in memory.
const IMV_iterator_tuple get_iterator_tuple() const
Return the underlying iterator tuple.
void setXY0(int const x0, int const y0)
Set the MaskedImage's origin.
lsst::geom::Box2I getBBox(ImageOrigin origin=PARENT) const
void writeFits(std::string const &fileName, std::shared_ptr< daf::base::PropertySet const > metadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > imageMetadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > maskMetadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > varianceMetadata=std::shared_ptr< daf::base::PropertySet const >()) const
Write a MaskedImage to a regular FITS file.
A class to represent a 2-dimensional array of pixels.
void assign(MaskedImage const &rhs, lsst::geom::Box2I const &bbox=lsst::geom::Box2I(), ImageOrigin origin=PARENT)
Copy pixels from another masked image to a specified subregion of this masked image.
Ref< typename boost::mpl::at< PixelTVec, N >::type >::type apply_IMV()
y_iterator col_begin(int x) const
Return an y_iterator to the start of the image.
MaskPtr getMask() const
Return a (shared_ptr to) the MaskedImage's mask.
void setVariance(Variance const &other)
Set the variance plane's pixel values to those of another Image.
MaskedImage & operator*=(ImagePixelT const rhs)
Pixel operator()(int x, int y)
Dereference a locator, returning a Pixel offset by (x, y) from the locator.
const_MaskedImageIterator(MaskedImageIterator< ImageIterator, MaskIterator, VarianceIterator > const &iter)
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
y_iterator y_at(int x, int y) const
Return an y_iterator at the point (x, y)
MaskedImage & operator-=(ImagePixelT const rhs)
Subtract a scalar rhs from a MaskedImage.
lsst::afw::image::Image< ImagePixelT > Image
lsst::geom::Extent2I getDimensions() const
The base class for MaskedImageLocators (const and non-const)
MaskedImageIterator< typename Image::x_iterator, typename Mask::x_iterator, typename Variance::x_iterator > x_iterator
An iterator to a row of a MaskedImage.
int getWidth() const
Return the number of columns in the image.
MaskedImage subset(lsst::geom::Box2I const &bbox, ImageOrigin origin=PARENT) const
Return a subimage corresponding to the given box.
_x_or_y_iterator< apply_x > x_iterator
An x_iterator that provides a view of the xy_locator (i.e. advancing one advances the other)
bool operator==(MaskedImageLocatorBase const &rhs)
Return true iff two locators are equal.
reverse_iterator rend() const
Return a reverse_iterator to the end of the image.
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.