30 #ifndef LSST_IMAGE_MASKEDIMAGE_H
31 #define LSST_IMAGE_MASKEDIMAGE_H
39 #include "boost/mpl/at.hpp"
40 #include "boost/iterator/zip_iterator.hpp"
41 #include "boost/tuple/tuple.hpp"
69 namespace formatters {
70 template<
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
class MaskedImageFormatter;
88 typedef std::shared_ptr<MaskedImage>
Ptr;
89 typedef std::shared_ptr<const MaskedImage>
ConstPtr;
100 template<
typename ImagePT=ImagePixelT,
typename MaskPT=MaskPixelT,
typename VarPT=VariancePixelT>
116 template<
typename,
typename,
typename>
class const_MaskedImageLocator;
128 template<
typename ImageIterator,
typename MaskIterator,
typename VarianceIterator,
136 typedef typename boost::zip_iterator<IMV_iterator_tuple>::reference
IMV_tuple;
145 _iter(boost::make_zip_iterator(boost::make_tuple(img, msk, var))) {
148 typename Ref<ImagePixelT>::type
image() {
149 return _iter->template get<0>()[0];
153 typename Ref<MaskPixelT>::type
mask() {
154 return _iter->template get<1>()[0];
159 return _iter->template get<2>()[0];
165 return _iter.get_iterator_tuple();
188 return &this->
_iter->template get<0>() - &rhs.
_iter->template get<0>();
192 return &this->
_iter->template get<0>() == &rhs.
_iter->template get<0>();
196 return &this->
_iter->template get<0>() != &rhs.
_iter->template get<0>();
200 return &this->
_iter->template get<0>() < &rhs.
_iter->template get<0>();
205 _iter->template get<1>()[0],
206 _iter->template get<2>()[0]);
219 typename boost::zip_iterator<IMV_iterator_tuple>
_iter;
223 template<
typename ImageIterator,
typename MaskIterator,
typename VarianceIterator>
241 template<
typename ImageIterator,
typename MaskIterator,
typename VarianceIterator>
242 class const_MaskedImageIterator :
243 public MaskedImageIteratorBase<typename detail::const_iterator_type<ImageIterator>::type,
244 typename detail::const_iterator_type<MaskIterator>::type,
245 typename detail::const_iterator_type<VarianceIterator>::type,
273 template<
typename ImageLocator,
typename MaskLocator,
typename VarianceLocator,
276 typedef typename boost::tuple<ImageLocator, MaskLocator, VarianceLocator>
IMVLocator;
282 template<
template<
typename>
class X_OR_Y >
289 X_OR_Y<ImageLocator>(
_mil->
_loc.template get<0>())() += di;
290 X_OR_Y<MaskLocator>(
_mil->
_loc.template get<1>())() += di;
291 X_OR_Y<VarianceLocator>(
_mil->
_loc.template get<2>())() += di;
296 ++X_OR_Y<ImageLocator>(
_mil->
_loc.template get<0>())();
297 ++X_OR_Y<MaskLocator>(
_mil->
_loc.template get<1>())();
298 ++X_OR_Y<VarianceLocator>(
_mil->
_loc.template get<2>())();
303 X_OR_Y<ImageLocator>(
_mil->
_loc.template get<0>())() ==
304 X_OR_Y<ImageLocator>(rhs.
_mil->
_loc.template get<0>())();
309 X_OR_Y<ImageLocator>(
_mil->
_loc.template get<0>())() !=
310 X_OR_Y<ImageLocator>(rhs.
_mil->
_loc.template get<0>())();
315 X_OR_Y<ImageLocator>(
_mil->
_loc.template get<0>())() <
316 X_OR_Y<ImageLocator>(rhs.
_mil->
_loc.template get<0>())();
321 return Pixel((*(X_OR_Y<ImageLocator>(
_mil->
_loc.template get<0>())()))[0],
322 (*(X_OR_Y<MaskLocator>(
_mil->
_loc.template get<1>())()))[0],
323 (*(X_OR_Y<VarianceLocator>(
_mil->
_loc.template get<2>())()))[0]);
326 typename Ref<ImagePixelT>::type
image() {
329 return (*(X_OR_Y<ImageLocator>(
_mil->
_loc.template get<0>())()))[0];
331 typename Ref<MaskPixelT>::type
mask() {
332 return (*(X_OR_Y<MaskLocator>(
_mil->
_loc.template get<1>())()))[0];
335 return (*(X_OR_Y<VarianceLocator>(
_mil->
_loc.template get<2>())()))[0];
342 template<
typename LocT>
344 typedef typename LocT::x_iterator
IterT;
352 template<
typename LocT>
354 typedef typename LocT::y_iterator
IterT;
363 typedef typename boost::tuple<
typename ImageLocator::cached_location_t,
364 typename MaskLocator::cached_location_t,
388 _loc(img, msk, var) {
394 return Pixel(
_loc.template get<0>().x()[0][0],
395 _loc.template get<1>().
x()[0][0],
396 _loc.template get<2>().
x()[0][0]);
401 return Pixel(
_loc.template get<0>()(x, y)[0],
402 _loc.template get<1>()(x, y)[0],
403 _loc.template get<2>()(x, y)[0]);
408 return Pixel(
_loc.template get<0>()[cached_loc._imv.template get<0>()][0],
409 _loc.template get<1>()[cached_loc._imv.template get<1>()][0],
410 _loc.template get<2>()[cached_loc._imv.template get<2>()][0]);
428 return cached_location_t(
_loc, x, y);
435 typedef typename boost::mpl::vector<ImagePixelT, MaskPixelT, VariancePixelT>
PixelTVec;
438 typename Ref<typename boost::mpl::at<PixelTVec, N>::type>::type
apply_IMV(cached_location_t
const& cached_loc) {
439 return _loc.template get<N::value>()[cached_loc._imv.template get<N::value>()][0];
443 typename Ref<typename boost::mpl::at<PixelTVec, N>::type>::type
apply_IMV() {
444 return _loc.template get<N::value>()[0][0];
448 typename Ref<typename boost::mpl::at<PixelTVec, N>::type>::type
apply_IMV(
int x,
int y) {
449 return _loc.template get<N::value>()(x, y)[0];
455 typename Ref<ImagePixelT>::type
image(cached_location_t
const& cached_loc) {
456 return apply_IMV<boost::mpl::int_<0> >(cached_loc);
459 typename Ref<ImagePixelT>::type
image() {
460 return apply_IMV<boost::mpl::int_<0> >();
463 typename Ref<ImagePixelT>::type
image(
int x,
int y) {
464 return apply_IMV<boost::mpl::int_<0> >(
x,
y);
468 typename Ref<MaskPixelT>::type
mask(cached_location_t
const& cached_loc) {
469 return apply_IMV<boost::mpl::int_<1> >(cached_loc);
472 typename Ref<MaskPixelT>::type
mask() {
473 return apply_IMV<boost::mpl::int_<1> >();
476 typename Ref<MaskPixelT>::type
mask(
int x,
int y) {
477 return apply_IMV<boost::mpl::int_<1> >(
x,
y);
481 typename Ref<VariancePixelT>::type
variance(cached_location_t
const& cached_loc) {
482 return apply_IMV<boost::mpl::int_<2> >(cached_loc);
486 return apply_IMV<boost::mpl::int_<2> >();
490 return apply_IMV<boost::mpl::int_<2> >(
x,
y);
495 return _loc.template get<0>() == rhs.
_loc.template get<0>();
499 return !(*
this == rhs);
503 return _loc.template get<0>() < rhs.
_loc.template get<0>();
508 return operator+=(detail::difference_type(p.first, p.second));
513 _loc.template get<0>() += p;
514 _loc.template get<1>() += p;
515 _loc.template get<2>() += p;
529 template<
typename ImageLocator,
typename MaskLocator,
typename VarianceLocator>
540 template<
typename ImageLocator,
typename MaskLocator,
typename VarianceLocator>
541 class const_MaskedImageLocator :
542 public MaskedImageLocatorBase<typename detail::const_locator_type<ImageLocator>::type,
543 typename detail::const_locator_type<MaskLocator>::type,
544 typename detail::const_locator_type<VarianceLocator>::type,
563 #endif // !defined(SWIG)
575 #if 0 // doesn't compile. I should fix this, but it's low priority. RHL
647 std::string
const & fileName,
650 bool conformMasks=
false,
bool needAllHdus=
false,
675 bool conformMasks=
false,
bool needAllHdus=
false,
700 bool conformMasks=
false,
bool needAllHdus=
false,
708 bool const deep=
false
714 bool const deep=
false
720 template<
typename OtherPixelT>
728 throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
729 "Only deep copies are permitted for MaskedImages with different pixel types");
806 std::string
const & fileName,
876 if (!
_image && !noThrow) {
878 lsst::pex::exceptions::RuntimeError,
879 "MaskedImage's Image is NULL"
886 if (!
_mask && !noThrow) {
888 lsst::pex::exceptions::RuntimeError,
889 "MaskedImage's Mask is NULL"
899 lsst::pex::exceptions::RuntimeError,
900 "MaskedImage's Variance is NULL"
963 _mask->setXY0(origin);
981 return getImage()->indexToPosition(ind, xy);
993 return getImage()->positionToIndex(pos, xy);
1017 #else // bypass checks for non-NULL pointers
1023 return x_iterator(imageEnd, maskEnd, varianceEnd);
1035 #else // bypass checks for non-NULL pointers
1040 return y_iterator(imageEnd, maskEnd, varianceEnd);
1050 #else // bypass checks for non-NULL pointers
1056 return xy_locator(imageEnd, maskEnd, varianceEnd);
1072 template<typename ImagePixelT, typename MaskPixelT, typename VariancePixelT>
1074 typename
Image<ImagePixelT>::
Ptr image,
1075 typename
Mask<MaskPixelT>::
Ptr mask = typename
Mask<MaskPixelT>::
Ptr(),
1076 typename
Image<VariancePixelT>::Ptr variance = typename
Image<VariancePixelT>::Ptr()
1098 template<
typename ImageT,
typename TagT>
1100 typedef ImageT type;
1101 static typename type::Ptr
getImage(
typename ImageT::Ptr image) {
1106 template<
typename ImageT>
1107 struct GetImage_<ImageT, typename image::detail::MaskedImage_tag> {
1108 typedef typename ImageT::Image type;
1109 static typename type::Ptr
getImage(
typename ImageT::Ptr image) {
1110 return image->getImage();
1115 template<
typename ImageT>
1116 struct GetImage :
public GetImage_<ImageT, typename ImageT::image_category> {
1121 #endif // LSST_IMAGE_MASKEDIMAGE_H
x_iterator row_begin(int y) const
Return an x_iterator to the start of the image.
MaskedImageLocatorBase & operator+=(detail::difference_type p)
Increment the locator's x and y positions by p.
MaskedImageLocatorBase * _mil
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...
Image< VariancePixelT >::Ptr VariancePtr
shared pointer to the variance Image
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.
void scaledDivides(double const c, MaskedImage const &rhs)
Ref< MaskPixelT >::type mask()
Return (a reference to) the mask part of the Pixel pointed at by the iterator.
MaskedImageIterator(ImageIterator &img, MaskIterator &msk, VarianceIterator &var)
Ref< MaskPixelT >::type mask()
Return a reference to the mask at the current position of the locator.
const_MaskedImageLocator< typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator > const_xy_locator
A const_locator for a MaskedImage.
detail::const_iterator_type< ImageIterator >::type const_ImageIterator
y_iterator y()
Return an iterator that can be used to move (or dereference) a locator.
#define LSST_PERSIST_FORMATTER(formatter...)
Macro used to connect the persistable class with the Formatter and boost::serialization.
MaskedImageIteratorBase(ImageIterator const &img, MaskIterator const &msk, VarianceIterator const &var)
Construct a MaskedImageIteratorBase from the image/mask/variance iterators.
The base class for MaskedImageLocators (const and non-const)
void operator-=(lsst::afw::math::Function2< double > const &function)
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > * makeMaskedImage(typename Image< ImagePixelT >::Ptr image, typename Mask< MaskPixelT >::Ptr mask=typename Mask< MaskPixelT >::Ptr(), typename Image< VariancePixelT >::Ptr variance=typename Image< VariancePixelT >::Ptr())
A function to return a MaskedImage of the correct type (cf.
boost::tuple< ImageLocator, MaskLocator, VarianceLocator > IMVLocator
Citizen(const std::type_info &)
Ref< typename boost::mpl::at< PixelTVec, N >::type >::type apply_IMV(int x, int y)
boost::mpl::vector< ImagePixelT, MaskPixelT, VariancePixelT > PixelTVec
_view_t::reverse_iterator reverse_iterator
An STL compliant reverse iterator.
const_MaskedImageIterator< typename Image::iterator, typename Mask::iterator, typename Variance::iterator > const_iterator
boost::zip_iterator< IMV_iterator_tuple > _iter
Pixel type
Type pointed to by the iterator.
A templated class to return this classes' type (present in Image/Mask/MaskedImage) ...
Pixel operator()(int x, int y)
Dereference a locator, returning a Pixel offset by (x, y) from the locator.
iterator begin() const
Return an iterator to the start of the image.
lsst::afw::image::pixel::Pixel< ImagePixelT, MaskPixelT, VariancePixelT > Pixel
A Pixel in the MaskedImage.
x_iterator fast_iterator
A fast STL compliant iterator for contiguous images N.b.
void operator<<=(MaskedImage const &rhs)
Copy the pixels from the rhs to the lhs.
detail::const_locator_type< MaskLocator >::type const_MaskLocator
void operator/=(ImagePixelT const rhs)
boost::tuple< typename ImageLocator::cached_location_t, typename MaskLocator::cached_location_t, typename VarianceLocator::cached_location_t > IMVCachedLocation
int getHeight() const
Return the number of rows in the image.
int getX0() const
Return the image's column-origin.
void scaledPlus(double const c, MaskedImage const &rhs)
Add a scaled MaskedImage c*rhs to a MaskedImage.
Pixel operator*()
Dereference a locator, returning a Pixel.
void writeFits(std::string const &fileName, boost::shared_ptr< daf::base::PropertySet const > metadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > imageMetadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > maskMetadata=boost::shared_ptr< daf::base::PropertySet const >(), boost::shared_ptr< daf::base::PropertySet const > varianceMetadata=boost::shared_ptr< daf::base::PropertySet const >()) const
Write a MaskedImage to a regular FITS file.
Ref< MaskPixelT >::type mask()
iterator at(int const x, int const y) const
Return an iterator at the point (x, y)
detail::const_iterator_type< VarianceIterator >::type const_VarianceIterator
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...
bool operator==(MaskedImageIteratorBase const &rhs)
Return true if the lhs equals the rhs.
_view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
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...
x_iterator row_end(int y) const
Return an x_iterator to the end of the image.
MaskedImageLocatorBase< ImageLocator, MaskLocator, VarianceLocator > MaskedImageLocatorBase_t
Ref< typename boost::mpl::at< PixelTVec, N >::type >::type apply_IMV(cached_location_t const &cached_loc)
The base class for MaskedImageIterators (const and non-const)
detail::const_iterator_type< MaskIterator >::type const_MaskIterator
geom::Box2I getBBox(ImageOrigin const origin=PARENT) const
detail::MaskPlaneDict MaskPlaneDict
void operator+=(lsst::afw::math::Function2< double > const &function)
MaskedImageIterator< typename Image::x_iterator, typename Mask::x_iterator, typename Variance::x_iterator > x_iterator
An iterator to a row of a MaskedImage.
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.
detail::const_locator_type< ImageLocator >::type const_ImageLocator
Classes to provide utility functions for a "Pixel" to get at image/mask/variance operators.
lsst::afw::image::pixel::SinglePixel< ImagePixelT, MaskPixelT, VariancePixelT > SinglePixel
A single Pixel of the same type as those in the MaskedImage.
ImagePtr getImage(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage's image.
A single pixel of the same type as a MaskedImage.
void setXY0(geom::Point2I const origin)
Set the MaskedImage's origin.
void operator+=(std::ptrdiff_t delta)
Increment the iterator by delta.
void operator++(int)
Increment the iterator (postfix)
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.
void swap(MaskedImage &rhs)
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
lsst::afw::image::Mask< MaskPixelT > Mask
A Function taking two arguments.
void operator+=(lsst::afw::image::Image< ImagePixelT > const &rhs)
geom::Extent2I getDimensions() const
MaskedImage(unsigned int width, unsigned int height, MaskPlaneDict const &planeDict=MaskPlaneDict())
Constructors.
boost::tuple< ImageIterator, MaskIterator, VarianceIterator > IMV_iterator_tuple
void operator-=(ImagePixelT const rhs)
Subtract a scalar rhs from a MaskedImage.
void operator+=(ImagePixelT const rhs)
Add a scalar rhs to a MaskedImage.
MaskedImageIterator< typename Image::iterator, typename Mask::iterator, typename Variance::iterator > iterator
An integer coordinate rectangle.
Ref< VariancePixelT >::type variance()
Return (a reference to) the variance part of the Pixel pointed at by the iterator.
bool operator==(MaskedImageLocatorBase const &rhs)
Return true iff two locators are equal.
Mask< MaskPixelT >::MaskPlaneDict MaskPlaneDict
The Mask's MaskPlaneDict.
xy_locator xy_at(int x, int y) const
Return an xy_locator at the point (x, y)
VariancePtr getVariance(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage's variance.
table::Key< table::Array< Kernel::Pixel > > image
An iterator to the MaskedImage.
bool operator!=(MaskedImageIteratorBase const &rhs)
Return true if the lhs doesn't equal the rhs.
_view_t::iterator iterator
An STL compliant iterator.
void operator+=(const int di)
const_MaskedImageIterator & operator+(std::ptrdiff_t delta)
Return a const_MaskedImageIterator that's delta beyond this.
A locator for the MaskedImage.
_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) ...
double indexToPosition(double ind, lsst::afw::image::xOrY const xy) const
Convert image index to image position (see Image::indexToPosition)
x_iterator x_at(int x, int y) const
Return an x_iterator at the point (x, y)
afw::table::PointKey< int > dimensions
MaskedImageIteratorBase< ImageIterator, MaskIterator, VarianceIterator > MaskedImageIteratorBase_t
MaskedImageLocator(ImageLocator &img, MaskLocator &msk, VarianceLocator &var)
reverse_iterator rbegin() const
Return a reverse_iterator to the start of the image.
Ref< VariancePixelT >::type variance()
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)/...
void ImageT ImageT int float saturatedPixelValue int const width
bool operator<(_x_or_y_iterator const &rhs)
static MaskedImage readFits(fits::MemFileManager &manager)
Read a MaskedImage from a FITS RAM file.
Interface for Persistable base class.
Represent a 2-dimensional array of bitmask pixels.
MaskedImageIterator< typename Image::y_iterator, typename Mask::y_iterator, typename Variance::y_iterator > y_iterator
An iterator to a column of a MaskedImage.
Lifetime-management for memory that goes into FITS memory files.
iterator end() const
Return an 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.
A traits class for MaskedImage.
_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) ...
void operator-=(std::ptrdiff_t delta)
Decrement the iterator by delta.
MaskPtr getMask(bool const noThrow=false) const
Return a (Ptr to) the MaskedImage's mask.
void operator*=(lsst::afw::image::Image< ImagePixelT > const &rhs)
void operator/=(lsst::afw::image::Image< ImagePixelT > const &rhs)
const_MaskedImageIterator(MaskedImageIterator< ImageIterator, MaskIterator, VarianceIterator > const &iter)
A class to manipulate images, masks, and variance as a single object.
_view_t::y_iterator y_iterator
An iterator for traversing the pixels in a column.
IMVLocator const & getLoc() const
MaskedImageIterator< typename Image::reverse_iterator, typename Mask::reverse_iterator, typename Variance::reverse_iterator > reverse_iterator
detail::MaskedImage_tag image_category
MaskedImageLocatorBase< const_ImageLocator, const_MaskLocator, const_VarianceLocator, ConstReference > MaskedImageLocatorBase_t
Ref< ImagePixelT >::type image()
std::shared_ptr< Image< ImagePixelT > > Ptr
void operator++()
Increment the iterator (prefix)
boost::zip_iterator< IMV_iterator_tuple >::reference IMV_tuple
The underlying iterator tuple.
reverse_iterator rend() const
Return a reverse_iterator to the end of the image.
bool operator!=(_x_or_y_iterator const &rhs)
Ref< ImagePixelT >::type image()
Return (a reference to) the image part of the Pixel pointed at by the iterator.
A saved relative position, providing efficient access to neighbouring pixels.
detail::const_locator_type< VarianceLocator >::type const_VarianceLocator
y_iterator col_end(int x) const
Return an y_iterator to the end of the image.
Pixel operator*()
Dereference the iterator, returning a Pixel.
void scaledMultiplies(double const c, MaskedImage const &rhs)
void ImageT ImageT int float saturatedPixelValue int const height
const Pixel operator*() const
Dereference the iterator, returning a const Pixel.
Image< ImagePixelT >::Ptr ImagePtr
shared pointer to the Image
bool operator!=(MaskedImageLocatorBase const &rhs)
Return true iff two locators are not equal.
lsst::afw::image::Image< VariancePixelT > Variance
std::shared_ptr< const MaskedImage > ConstPtr
std::string const compressedFileNoMEF_RE
regexp to identify when MaskedImages should
MaskedImageIterator operator+(std::ptrdiff_t delta)
Return a MaskedImageIterator that's delta beyond this.
std::shared_ptr< MaskedImage > Ptr
shared pointer to a MaskedImage
std::shared_ptr< Mask > Ptr
std::ptrdiff_t operator-(MaskedImageIteratorBase const &rhs)
Return the distance between two iterators.
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Ref< ImagePixelT >::type image()
Return a reference to the image at the current position of the locator.
x_iterator x()
Return an iterator that can be used to move (or dereference) a locator.
A pixel of a MaskedImage.
Mask< MaskPixelT >::Ptr MaskPtr
shared pointer to the Mask
An const iterator to the MaskedImage.
std::string const fitsFile_RE
cached_location_t cache_location(int x, int y) const
Create a cached_location_t offset by (x, y) from locator.
void assign(MaskedImage const &rsh, geom::Box2I const &bbox=geom::Box2I(), ImageOrigin origin=PARENT)
Copy pixels from another masked image to a specified subregion of this masked image.
void setXY0(int const x0, int const y0)
Set the MaskedImage's origin.
geom::Point2I getXY0() const
Return the image's origin.
bool operator<(MaskedImageLocatorBase const &rhs)
Return true iff lhs is less than rhs.
Class for storing generic metadata.
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.
Ref< VariancePixelT >::type variance()
Return a reference to the variance at the current position of the locator.
int getWidth() const
Return the number of columns in the image.
int getY0() const
Return the image's row-origin.
const IMV_iterator_tuple get_iterator_tuple() const
Return the underlying iterator tuple.
void operator*=(ImagePixelT const rhs)
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
static MaskedImage readFits(std::string const &filename)
Read a MaskedImage from a regular FITS file.
MaskedImage< ImagePT, MaskPT, VarPT > type
Return the desired type.
y_iterator col_begin(int x) const
Return an y_iterator to the start of the image.
Base class for all persistable classes.
MaskedImageIteratorBase< const_ImageIterator, const_MaskIterator, const_VarianceIterator, ConstReference > MaskedImageIteratorBase_t
lsst::afw::image::Image< ImagePixelT > Image
MaskedImageLocator< typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locator > xy_locator
A locator for a MaskedImage.
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
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
#define CONST_PTR(...)
A shared pointer to a const object.
void operator-=(lsst::afw::image::Image< ImagePixelT > const &rhs)
bool operator<(MaskedImageIteratorBase const &rhs)
Return true if the lhs is less than the rhs.
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.
float VariancePixel
! default type for Masks and MaskedImage Masks
A class used to identify classes that represent MaskedImage pixels.
MaskedImageLocatorBase(ImageLocator const &img, MaskLocator const &msk, VarianceLocator const &var)
Construct a MaskedImageLocator from image/mask/variance locators.
_view_t::xy_locator xy_locator
An xy_locator.
y_iterator y_at(int x, int y) const
Return an y_iterator at the point (x, y)
MaskedImage & operator=(MaskedImage const &rhs)
Make the lhs use the rhs's pixels.
Definition of default types for Masks and Variance Images.
bool operator==(_x_or_y_iterator const &rhs)
MaskedImageLocatorBase & operator+=(pair2I const &p)
Increment the locator's x and y positions by p.
const_MaskedImageLocator(MaskedImageLocator< ImageLocator, MaskLocator, VarianceLocator > const &iter)
void scaledMinus(double const c, MaskedImage const &rhs)
Subtract a scaled MaskedImage c*rhs from a MaskedImage.
_x_or_y_iterator(MaskedImageLocatorBase *mil)
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.
std::pair< int, double > positionToIndex(double const pos, lsst::afw::image::xOrY const xy) const
Convert image position to index (see Image::positionToIndex)
A const locator for the MaskedImage.
metafunction to extract reference type from PixelT
Ref< typename boost::mpl::at< PixelTVec, N >::type >::type apply_IMV()
metafunction to extract const reference type from PixelT