LSSTApplications  18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | List of all members
lsst::afw::math::MaskedVector< EntryT > Class Template Reference

#include <MaskedVector.h>

Inheritance diagram for lsst::afw::math::MaskedVector< EntryT >:
lsst::afw::image::MaskedImage< EntryT >

Classes

class  iterator
 

Public Types

typedef lsst::afw::image::MaskedImage< EntryT >::Pixel Pixel
 

Public Member Functions

 MaskedVector (int width=0)
 
 MaskedVector (MaskedVector const &)=default
 
 MaskedVector (MaskedVector &&)=default
 
MaskedVectoroperator= (MaskedVector const &)=default
 
MaskedVectoroperator= (MaskedVector &&)=default
 
 ~MaskedVector () override=default
 
std::shared_ptr< std::vector< EntryT > > getVector (bool const noThrow=false) const
 Return a (Ptr to) the MaskedImage's image. More...
 
Pixeloperator[] (int const i)
 
lsst::afw::image::MaskedImage< EntryT >::Image::Pixelvalue (int const i)
 
lsst::afw::image::MaskedImage< EntryT >::Mask::Pixelmask (int const i)
 
lsst::afw::image::MaskedImage< EntryT >::Variance::Pixelvariance (int const i)
 
lsst::afw::image::MaskedImage< EntryT >::ImagePtr getImage () const
 
lsst::afw::image::MaskedImage< EntryT >::MaskPtr getMask () const
 
lsst::afw::image::MaskedImage< EntryT >::VariancePtr getVariance () const
 
int size ()
 
bool empty ()
 
iterator begin ()
 
iterator end ()
 

Private Types

typedef std::shared_ptr< image::Image< EntryT > > ImagePtr
 shared pointer to the Image More...
 
typedef std::shared_ptr< image::Mask< lsst::afw::image::MaskPixel > > MaskPtr
 shared pointer to the Mask More...
 
typedef std::shared_ptr< image::Image< lsst::afw::image::VariancePixel > > VariancePtr
 shared pointer to the variance Image More...
 
typedef Mask< lsst::afw::image::MaskPixel >::MaskPlaneDict MaskPlaneDict
 The Mask's MaskPlaneDict. More...
 
typedef lsst::afw::image::Image< lsst::afw::image::VariancePixelVariance
 
typedef lsst::afw::image::Image< EntryT > Image
 
typedef lsst::afw::image::Mask< lsst::afw::image::MaskPixelMask
 
typedef detail::MaskedImage_tag image_category
 
typedef lsst::afw::image::pixel::SinglePixel< EntryT, lsst::afw::image::MaskPixel, lsst::afw::image::VariancePixelSinglePixel
 A single Pixel of the same type as those in the MaskedImage. More...
 
typedef MaskedImageIterator< typename Image::iterator, typename Mask::iterator, typename Variance::iteratoriterator
 
typedef const_MaskedImageIterator< typename Image::iterator, typename Mask::iterator, typename Variance::iteratorconst_iterator
 
typedef MaskedImageIterator< typename Image::reverse_iterator, typename Mask::reverse_iterator, typename Variance::reverse_iteratorreverse_iterator
 
typedef MaskedImageIterator< typename Image::x_iterator, typename Mask::x_iterator, typename Variance::x_iteratorx_iterator
 An iterator to a row of a MaskedImage. More...
 
typedef const_MaskedImageIterator< typename Image::x_iterator, typename Mask::x_iterator, typename Variance::x_iteratorconst_x_iterator
 A const_iterator to a row of a MaskedImage. More...
 
typedef x_iterator fast_iterator
 A fast STL compliant iterator for contiguous images N.b. More...
 
typedef MaskedImageIterator< typename Image::y_iterator, typename Mask::y_iterator, typename Variance::y_iteratory_iterator
 An iterator to a column of a MaskedImage. More...
 
typedef const_MaskedImageIterator< typename Image::y_iterator, typename Mask::y_iterator, typename Variance::y_iteratorconst_y_iterator
 A const_iterator to a column of a MaskedImage. More...
 
typedef MaskedImageLocator< typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locatorxy_locator
 A locator for a MaskedImage. More...
 
typedef const_MaskedImageLocator< typename Image::xy_locator, typename Mask::xy_locator, typename Variance::xy_locatorconst_xy_locator
 A const_locator for a MaskedImage. More...
 
typedef 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 More...
 
typedef 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 More...
 

Private Member Functions

void swap (MaskedImage &rhs)
 
MaskedImage subset (lsst::geom::Box2I const &bbox, ImageOrigin origin=PARENT) const
 Return a subimage corresponding to the given box. More...
 
MaskedImage operator[] (lsst::geom::Box2I const &bbox) const
 Return a subimage corresponding to the given box (interpreted as PARENT coordinates). More...
 
MaskedImageoperator<<= (MaskedImage const &rhs)
 Copy the pixels from the rhs to the lhs. More...
 
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. More...
 
MaskedImageoperator+= (EntryT const rhs)
 Add a scalar rhs to a MaskedImage. More...
 
MaskedImageoperator+= (MaskedImage const &rhs)
 Add a MaskedImage rhs to a MaskedImage. More...
 
MaskedImageoperator+= (lsst::afw::image::Image< EntryT > const &rhs)
 
MaskedImageoperator+= (lsst::afw::math::Function2< double > const &function)
 
void scaledPlus (double const c, MaskedImage const &rhs)
 Add a scaled MaskedImage c*rhs to a MaskedImage. More...
 
MaskedImageoperator-= (EntryT const rhs)
 Subtract a scalar rhs from a MaskedImage. More...
 
MaskedImageoperator-= (MaskedImage const &rhs)
 Subtract a MaskedImage rhs from a MaskedImage. More...
 
MaskedImageoperator-= (lsst::afw::image::Image< EntryT > const &rhs)
 
MaskedImageoperator-= (lsst::afw::math::Function2< double > const &function)
 
void scaledMinus (double const c, MaskedImage const &rhs)
 Subtract a scaled MaskedImage c*rhs from a MaskedImage. More...
 
MaskedImageoperator*= (EntryT const rhs)
 
MaskedImageoperator*= (MaskedImage const &rhs)
 
MaskedImageoperator*= (lsst::afw::image::Image< EntryT > const &rhs)
 
void scaledMultiplies (double const c, MaskedImage const &rhs)
 
MaskedImageoperator/= (EntryT const rhs)
 
MaskedImageoperator/= (MaskedImage const &rhs)
 
MaskedImageoperator/= (lsst::afw::image::Image< EntryT > const &rhs)
 
void scaledDivides (double const c, MaskedImage const &rhs)
 
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. More...
 
void writeFits (fits::MemFileManager &manager, 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 FITS RAM file. More...
 
void writeFits (fits::Fits &fitsfile, 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 FITS file. More...
 
void writeFits (std::string const &fileName, fits::ImageWriteOptions const &imageOptions, fits::ImageWriteOptions const &maskOptions, fits::ImageWriteOptions const &varianceOptions, std::shared_ptr< daf::base::PropertySet const > metadata=nullptr, std::shared_ptr< daf::base::PropertySet const > imageMetadata=nullptr, std::shared_ptr< daf::base::PropertySet const > maskMetadata=nullptr, std::shared_ptr< daf::base::PropertySet const > varianceMetadata=nullptr) const
 Write a MaskedImage to a FITS file. More...
 
void writeFits (fits::MemFileManager &manager, fits::ImageWriteOptions const &imageOptions, fits::ImageWriteOptions const &maskOptions, fits::ImageWriteOptions const &varianceOptions, std::shared_ptr< daf::base::PropertySet const > metadata=nullptr, std::shared_ptr< daf::base::PropertySet const > imageMetadata=nullptr, std::shared_ptr< daf::base::PropertySet const > maskMetadata=nullptr, std::shared_ptr< daf::base::PropertySet const > varianceMetadata=nullptr) const
 Write a MaskedImage to a FITS file. More...
 
void writeFits (fits::Fits &fitsfile, fits::ImageWriteOptions const &imageOptions, fits::ImageWriteOptions const &maskOptions, fits::ImageWriteOptions const &varianceOptions, std::shared_ptr< daf::base::PropertySet const > metadata=nullptr, std::shared_ptr< daf::base::PropertySet const > imageMetadata=nullptr, std::shared_ptr< daf::base::PropertySet const > maskMetadata=nullptr, std::shared_ptr< daf::base::PropertySet const > varianceMetadata=nullptr) const
 Write a MaskedImage to a FITS file. More...
 
void setImage (Image const &other)
 Set the image plane's pixel values to those of another Image. More...
 
void setMask (Mask const &other)
 Set the mask plane's pixel values to those of another Mask. More...
 
void setVariance (Variance const &other)
 Set the variance plane's pixel values to those of another Image. More...
 
int getWidth () const
 Return the number of columns in the image. More...
 
int getHeight () const
 Return the number of rows in the image. More...
 
lsst::geom::Extent2I getDimensions () const
 
lsst::geom::Box2I getBBox (ImageOrigin const origin=PARENT) const
 
int getX0 () const
 Return the image's column-origin. More...
 
int getY0 () const
 Return the image's row-origin. More...
 
lsst::geom::Point2I getXY0 () const
 Return the image's origin. More...
 
void setXY0 (int const x0, int const y0)
 Set the MaskedImage's origin. More...
 
void setXY0 (lsst::geom::Point2I const origin)
 Set the MaskedImage's origin. More...
 
double indexToPosition (double ind, lsst::afw::image::xOrY const xy) const
 Convert image index to image position (see Image::indexToPosition) More...
 
std::pair< int, double > positionToIndex (double const pos, lsst::afw::image::xOrY const xy) const
 Convert image position to index (see Image::positionToIndex) More...
 
iterator begin () const
 Return an iterator to the start of the image. More...
 
fast_iterator begin (bool contiguous) const
 Fast iterators to contiguous images. More...
 
iterator end () const
 Return an iterator to the end of the image. More...
 
fast_iterator end (bool contiguous) const
 Return a fast iterator to the end of the image, which must be contiguous Note that the order in which pixels are visited is undefined. More...
 
iterator at (int const x, int const y) const
 Return an iterator at the point (x, y) More...
 
reverse_iterator rbegin () const
 Return a reverse_iterator to the start of the image. More...
 
reverse_iterator rend () const
 Return a reverse_iterator to the end of the image. More...
 
x_iterator row_begin (int y) const
 Return an x_iterator to the start of the image. More...
 
x_iterator row_end (int y) const
 Return an x_iterator to the end of the image. More...
 
x_iterator x_at (int x, int y) const
 Return an x_iterator at the point (x, y) More...
 
y_iterator col_begin (int x) const
 Return an y_iterator to the start of the image. More...
 
y_iterator col_end (int x) const
 Return an y_iterator to the end of the image. More...
 
y_iterator y_at (int x, int y) const
 Return an y_iterator at the point (x, y) More...
 
xy_locator xy_at (int x, int y) const
 Return an xy_locator at the point (x, y) More...
 

Static Private Member Functions

static MaskedImage readFits (std::string const &filename)
 Read a MaskedImage from a regular FITS file. More...
 
static MaskedImage readFits (fits::MemFileManager &manager)
 Read a MaskedImage from a FITS RAM file. More...
 

Detailed Description

template<typename EntryT>
class lsst::afw::math::MaskedVector< EntryT >

Definition at line 37 of file MaskedVector.h.

Member Typedef Documentation

◆ Pixel

template<typename EntryT>
typedef lsst::afw::image::MaskedImage<EntryT>::Pixel lsst::afw::math::MaskedVector< EntryT >::Pixel

Definition at line 41 of file MaskedVector.h.

Constructor & Destructor Documentation

◆ MaskedVector() [1/3]

template<typename EntryT>
lsst::afw::math::MaskedVector< EntryT >::MaskedVector ( int  width = 0)
inlineexplicit

Definition at line 43 of file MaskedVector.h.

44  : //, MaskPlaneDict const& planeDict=MaskPlaneDict()) :
45  lsst::afw::image::MaskedImage<EntryT>(lsst::geom::Extent2I(width, 1)) {} //, planeDict) {}
Extent< int, 2 > Extent2I
Definition: Extent.h:397

◆ MaskedVector() [2/3]

template<typename EntryT>
lsst::afw::math::MaskedVector< EntryT >::MaskedVector ( MaskedVector< EntryT > const &  )
default

◆ MaskedVector() [3/3]

template<typename EntryT>
lsst::afw::math::MaskedVector< EntryT >::MaskedVector ( MaskedVector< EntryT > &&  )
default

◆ ~MaskedVector()

template<typename EntryT>
lsst::afw::math::MaskedVector< EntryT >::~MaskedVector ( )
overridedefault

Member Function Documentation

◆ begin()

template<typename EntryT>
iterator lsst::afw::math::MaskedVector< EntryT >::begin ( )
inline

Definition at line 123 of file MaskedVector.h.

123 { return this->row_begin(0); }
x_iterator row_begin(int y) const
Return an x_iterator to the start of the image.
Definition: MaskedImage.cc:612

◆ empty()

template<typename EntryT>
bool lsst::afw::math::MaskedVector< EntryT >::empty ( )
inline

Definition at line 104 of file MaskedVector.h.

104 { return this->getWidth(0) == 0; }
int getWidth() const
Return the number of columns in the image.
Definition: MaskedImage.h:1093

◆ end()

template<typename EntryT>
iterator lsst::afw::math::MaskedVector< EntryT >::end ( )
inline

Definition at line 124 of file MaskedVector.h.

124 { return this->row_end(0); }
x_iterator row_end(int y) const
Return an x_iterator to the end of the image.
Definition: MaskedImage.cc:622

◆ getImage()

template<typename EntryT>
lsst::afw::image::MaskedImage<EntryT>::ImagePtr lsst::afw::math::MaskedVector< EntryT >::getImage ( ) const
inline

Definition at line 88 of file MaskedVector.h.

88  {
90  }
ImagePtr getImage() const
Return a (shared_ptr to) the MaskedImage&#39;s image.
Definition: MaskedImage.h:1057

◆ getMask()

template<typename EntryT>
lsst::afw::image::MaskedImage<EntryT>::MaskPtr lsst::afw::math::MaskedVector< EntryT >::getMask ( ) const
inline

Definition at line 91 of file MaskedVector.h.

91  {
93  }
MaskPtr getMask() const
Return a (shared_ptr to) the MaskedImage&#39;s mask.
Definition: MaskedImage.h:1069

◆ getVariance()

template<typename EntryT>
lsst::afw::image::MaskedImage<EntryT>::VariancePtr lsst::afw::math::MaskedVector< EntryT >::getVariance ( ) const
inline

Definition at line 94 of file MaskedVector.h.

94  {
96  }
VariancePtr getVariance() const
Return a (shared_ptr to) the MaskedImage&#39;s variance.
Definition: MaskedImage.h:1090

◆ getVector()

template<typename EntryT>
std::shared_ptr<std::vector<EntryT> > lsst::afw::math::MaskedVector< EntryT >::getVector ( bool const  noThrow = false) const
inline

Return a (Ptr to) the MaskedImage's image.

Definition at line 55 of file MaskedVector.h.

55  {
56  if (!this->getImage() && !noThrow) {
57  throw LSST_EXCEPT(lsst::pex::exceptions::RuntimeError, "MaskedVector's Image is NULL");
58  }
59 
61  for (int i_y = 0; i_y < this->getImage()->getHeight(); ++i_y) {
63  ptr != this->getImage()->row_end(i_y); ++ptr) {
64  imgcp->push_back(*ptr);
65  }
66  }
67  return imgcp;
68  }
uint64_t * ptr
Definition: RangeSet.cc:88
_view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
Definition: ImageBase.h:133
lsst::afw::image::MaskedImage< EntryT >::ImagePtr getImage() const
Definition: MaskedVector.h:88
int getHeight() const
Return the number of rows in the image.
Definition: MaskedImage.h:1095
x_iterator row_begin(int y) const
Return an x_iterator to the start of the image.
Definition: MaskedImage.cc:612
x_iterator row_end(int y) const
Return an x_iterator to the end of the image.
Definition: MaskedImage.cc:622
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
STL class.
Reports errors that are due to events beyond the control of the program.
Definition: Runtime.h:104

◆ mask()

template<typename EntryT>
lsst::afw::image::MaskedImage<EntryT>::Mask::Pixel& lsst::afw::math::MaskedVector< EntryT >::mask ( int const  i)
inline

Definition at line 81 of file MaskedVector.h.

81  {
83  }
A class to manipulate images, masks, and variance as a single object.
Definition: MaskedImage.h:73

◆ operator=() [1/2]

template<typename EntryT>
MaskedVector& lsst::afw::math::MaskedVector< EntryT >::operator= ( MaskedVector< EntryT > const &  )
default

◆ operator=() [2/2]

template<typename EntryT>
MaskedVector& lsst::afw::math::MaskedVector< EntryT >::operator= ( MaskedVector< EntryT > &&  )
default

◆ operator[]()

template<typename EntryT>
Pixel& lsst::afw::math::MaskedVector< EntryT >::operator[] ( int const  i)
inline

Definition at line 72 of file MaskedVector.h.

72  {
76  }
A class to manipulate images, masks, and variance as a single object.
Definition: MaskedImage.h:73
lsst::afw::image::MaskedImage< EntryT >::Pixel Pixel
Definition: MaskedVector.h:41

◆ size()

template<typename EntryT>
int lsst::afw::math::MaskedVector< EntryT >::size ( )
inline

Definition at line 103 of file MaskedVector.h.

103 { return this->getWidth(0); }
int getWidth() const
Return the number of columns in the image.
Definition: MaskedImage.h:1093

◆ value()

template<typename EntryT>
lsst::afw::image::MaskedImage<EntryT>::Image::Pixel& lsst::afw::math::MaskedVector< EntryT >::value ( int const  i)
inline

Definition at line 78 of file MaskedVector.h.

78  {
80  }
A class to manipulate images, masks, and variance as a single object.
Definition: MaskedImage.h:73

◆ variance()

template<typename EntryT>
lsst::afw::image::MaskedImage<EntryT>::Variance::Pixel& lsst::afw::math::MaskedVector< EntryT >::variance ( int const  i)
inline

Definition at line 84 of file MaskedVector.h.

84  {
86  }
A class to manipulate images, masks, and variance as a single object.
Definition: MaskedImage.h:73

The documentation for this class was generated from the following file: