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
|
The base class for all image classed (Image, Mask, MaskedImage, ...) More...
#include <ImageBase.h>
Public Types | |
typedef detail::basic_tag | image_category |
trait class to identify type of image More... | |
typedef PixelT | SinglePixel |
A single Pixel of the same type as those in the ImageBase. More... | |
typedef PixelT | Pixel |
A pixel in this ImageBase. More... | |
typedef Reference< PixelT >::type | PixelReference |
A Reference to a PixelT. More... | |
typedef ConstReference< PixelT >::type | PixelConstReference |
A ConstReference to a PixelT. More... | |
typedef _view_t::xy_locator | xy_locator |
An xy_locator. More... | |
typedef _view_t::xy_locator::const_t | const_xy_locator |
A const_xy_locator. More... | |
typedef _view_t::iterator | iterator |
An STL compliant iterator. More... | |
typedef _const_view_t::iterator | const_iterator |
An STL compliant const iterator. More... | |
typedef _view_t::reverse_iterator | reverse_iterator |
An STL compliant reverse iterator. More... | |
typedef _const_view_t::reverse_iterator | const_reverse_iterator |
An STL compliant const reverse iterator. More... | |
typedef _view_t::x_iterator | x_iterator |
An iterator for traversing the pixels in a row. More... | |
typedef x_iterator | fast_iterator |
A fast STL compliant iterator for contiguous images N.b. More... | |
typedef _view_t::x_iterator | xy_x_iterator |
An iterator for traversing the pixels in a row, created from an xy_locator. More... | |
typedef _const_view_t::x_iterator | const_x_iterator |
A const iterator for traversing the pixels in a row. More... | |
typedef _view_t::y_iterator | y_iterator |
An iterator for traversing the pixels in a column. More... | |
typedef _view_t::y_iterator | xy_y_iterator |
An iterator for traversing the pixels in a row, created from an xy_locator. More... | |
typedef _const_view_t::y_iterator | const_y_iterator |
A const iterator for traversing the pixels in a column. More... | |
typedef ndarray::Array< PixelT, 2, 1 > | Array |
A mutable ndarray representation of the image. More... | |
typedef ndarray::Array< PixelT const, 2, 1 > | ConstArray |
An immutable ndarray representation of the image. More... | |
Public Member Functions | |
ImageBase (const lsst::geom::Extent2I &dimensions=lsst::geom::Extent2I()) | |
Allocator Constructor. More... | |
ImageBase (const lsst::geom::Box2I &bbox) | |
Allocator Constructor. More... | |
ImageBase (const ImageBase &src, const bool deep=false) | |
Copy constructor. More... | |
ImageBase (ImageBase &&src) | |
ImageBase (const ImageBase &src, const lsst::geom::Box2I &bbox, const ImageOrigin origin=PARENT, const bool deep=false) | |
Copy constructor to make a copy of part of an image. More... | |
template<typename OtherPixelT > | |
ImageBase (const ImageBase< OtherPixelT > &rhs, const bool deep) | |
generalised copy constructor More... | |
ImageBase (Array const &array, bool deep=false, lsst::geom::Point2I const &xy0=lsst::geom::Point2I()) | |
Construction from ndarray::Array and NumPy. More... | |
virtual | ~ImageBase ()=default |
ImageBase & | operator= (const ImageBase &rhs) |
Shallow assignment operator. More... | |
ImageBase & | operator= (ImageBase &&rhs) |
ImageBase & | operator= (const PixelT rhs) |
Set the image's pixels to rhs. More... | |
ImageBase & | operator<<= (const ImageBase &rhs) |
Set the lhs's pixel values to equal the rhs's. More... | |
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. More... | |
PixelReference | operator() (int x, int y) |
Return a reference to the pixel (x, y) in LOCAL coordinates. More... | |
PixelReference | operator() (int x, int y, CheckIndices const &) |
Return a reference to the pixel (x, y) in LOCAL coordinates with bounds checking. More... | |
PixelConstReference | operator() (int x, int y) const |
Return a const reference to the pixel (x, y) in LOCAL coordinates. More... | |
PixelConstReference | operator() (int x, int y, CheckIndices const &) const |
Return a const reference to the pixel (x, y) in LOCAL coordinates with bounds checking. More... | |
PixelReference | get (lsst::geom::Point2I const &index, ImageOrigin origin) |
Return a reference to a single pixel (with no bounds check). More... | |
PixelConstReference | get (lsst::geom::Point2I const &index, ImageOrigin origin) const |
Return a const reference to a single pixel (with no bounds check). More... | |
PixelReference | operator[] (lsst::geom::Point2I const &index) |
Return a reference to a single pixel in PARENT coordinates (with no bounds check). More... | |
PixelConstReference | operator[] (lsst::geom::Point2I const &index) const |
Return a reference to a single pixel in PARENT coordinates (with no bounds check). 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... | |
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... | |
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) More... | |
double | indexToPosition (double ind, lsst::afw::image::xOrY const xy) const |
Convert image index to image position. More... | |
lsst::geom::Extent2I | getDimensions () const |
Return the image's size; useful for passing to constructors. More... | |
void | swap (ImageBase &rhs) |
Array | getArray () |
ConstArray | getArray () const |
iterator | begin () const |
Return an STL compliant iterator to the start of the image. More... | |
iterator | end () const |
Return an STL compliant iterator to the end of the image. More... | |
reverse_iterator | rbegin () const |
Return an STL compliant reverse iterator to the start of the image. More... | |
reverse_iterator | rend () const |
Return an STL compliant reverse iterator to the end of the image. More... | |
iterator | at (int x, int y) const |
Return an STL compliant iterator at the point (x, y) More... | |
fast_iterator | begin (bool contiguous) const |
Return a fast STL compliant iterator to the start of the image which must be contiguous. More... | |
fast_iterator | end (bool contiguous) const |
Return a fast STL compliant iterator to the end of the image which must be contiguous. More... | |
x_iterator | row_begin (int y) const |
Return an x_iterator to the start of the y 'th row. More... | |
x_iterator | row_end (int y) const |
Return an x_iterator to the end of the y 'th row. More... | |
x_iterator | x_at (int x, int y) const |
Return an x_iterator to the point (x, y) in the image. More... | |
y_iterator | col_begin (int x) const |
Return an y_iterator to the start of the y 'th row. More... | |
y_iterator | col_end (int x) const |
Return an y_iterator to the start of the y 'th row. More... | |
y_iterator | y_at (int x, int y) const |
Return an y_iterator to the point (x, y) in the image. More... | |
xy_locator | xy_at (int x, int y) const |
Return an xy_locator at the point (x, y) in the image. More... | |
void | setXY0 (lsst::geom::Point2I const origin) |
Set the ImageBase's origin. More... | |
void | setXY0 (int const x0, int const y0) |
Set the ImageBase's origin. More... | |
lsst::geom::Box2I | getBBox (ImageOrigin origin=PARENT) const |
instead To be removed after PixelConstReference | get0 (int x, int y) const |
provides unchecked lookup To be removed after PixelConstReference | get0 (int x, int y, CheckIndices const &check) const |
instead To be removed after void | set0 (int x, int y, const PixelT v) |
provides unchecked lookup To be removed after void | set0 (int x, int y, const PixelT v, CheckIndices const &check) |
Static Public Member Functions | |
template<typename SinglePixelT > | |
static SinglePixel | PixelCast (SinglePixelT rhs) |
Convert a type to our SinglePixel type. More... | |
Protected Member Functions | |
_view_t | _getRawView () const |
bool | isContiguous () const |
Static Protected Member Functions | |
static _view_t | _allocateView (lsst::geom::Extent2I const &dimensions, Manager::Ptr &manager) |
static _view_t | _makeSubView (lsst::geom::Extent2I const &dimensions, lsst::geom::Extent2I const &offset, const _view_t &view) |
Friends | |
template<typename OtherPixelT > | |
class | ImageBase |
template<typename > | |
class | DecoratedImage |
template<typename , typename , typename > | |
class | MaskedImage |
The base class for all image classed (Image, Mask, MaskedImage, ...)
Definition at line 102 of file ImageBase.h.
typedef ndarray::Array<PixelT, 2, 1> lsst::afw::image::ImageBase< PixelT >::Array |
A mutable ndarray representation of the image.
Definition at line 149 of file ImageBase.h.
typedef _const_view_t::iterator lsst::afw::image::ImageBase< PixelT >::const_iterator |
An STL compliant const iterator.
Definition at line 127 of file ImageBase.h.
typedef _const_view_t::reverse_iterator lsst::afw::image::ImageBase< PixelT >::const_reverse_iterator |
An STL compliant const reverse iterator.
Definition at line 131 of file ImageBase.h.
typedef _const_view_t::x_iterator lsst::afw::image::ImageBase< PixelT >::const_x_iterator |
A const iterator for traversing the pixels in a row.
Definition at line 141 of file ImageBase.h.
typedef _view_t::xy_locator::const_t lsst::afw::image::ImageBase< PixelT >::const_xy_locator |
A const_xy_locator.
Definition at line 123 of file ImageBase.h.
typedef _const_view_t::y_iterator lsst::afw::image::ImageBase< PixelT >::const_y_iterator |
A const iterator for traversing the pixels in a column.
Definition at line 147 of file ImageBase.h.
typedef ndarray::Array<PixelT const, 2, 1> lsst::afw::image::ImageBase< PixelT >::ConstArray |
An immutable ndarray representation of the image.
Definition at line 151 of file ImageBase.h.
typedef x_iterator lsst::afw::image::ImageBase< PixelT >::fast_iterator |
A fast STL compliant iterator for contiguous images N.b.
The order of pixel access is undefined
Definition at line 137 of file ImageBase.h.
typedef detail::basic_tag lsst::afw::image::ImageBase< PixelT >::image_category |
trait class to identify type of image
Definition at line 110 of file ImageBase.h.
typedef _view_t::iterator lsst::afw::image::ImageBase< PixelT >::iterator |
An STL compliant iterator.
Definition at line 125 of file ImageBase.h.
typedef PixelT lsst::afw::image::ImageBase< PixelT >::Pixel |
A pixel in this ImageBase.
Definition at line 115 of file ImageBase.h.
typedef ConstReference<PixelT>::type lsst::afw::image::ImageBase< PixelT >::PixelConstReference |
A ConstReference to a PixelT.
Definition at line 119 of file ImageBase.h.
typedef Reference<PixelT>::type lsst::afw::image::ImageBase< PixelT >::PixelReference |
A Reference to a PixelT.
Definition at line 117 of file ImageBase.h.
typedef _view_t::reverse_iterator lsst::afw::image::ImageBase< PixelT >::reverse_iterator |
An STL compliant reverse iterator.
Definition at line 129 of file ImageBase.h.
typedef PixelT lsst::afw::image::ImageBase< PixelT >::SinglePixel |
A single Pixel of the same type as those in the ImageBase.
Definition at line 113 of file ImageBase.h.
typedef _view_t::x_iterator lsst::afw::image::ImageBase< PixelT >::x_iterator |
An iterator for traversing the pixels in a row.
Definition at line 133 of file ImageBase.h.
typedef _view_t::xy_locator lsst::afw::image::ImageBase< PixelT >::xy_locator |
An xy_locator.
Definition at line 121 of file ImageBase.h.
typedef _view_t::x_iterator lsst::afw::image::ImageBase< PixelT >::xy_x_iterator |
An iterator for traversing the pixels in a row, created from an xy_locator.
Definition at line 139 of file ImageBase.h.
typedef _view_t::y_iterator lsst::afw::image::ImageBase< PixelT >::xy_y_iterator |
An iterator for traversing the pixels in a row, created from an xy_locator.
Definition at line 145 of file ImageBase.h.
typedef _view_t::y_iterator lsst::afw::image::ImageBase< PixelT >::y_iterator |
An iterator for traversing the pixels in a column.
Definition at line 143 of file ImageBase.h.
|
explicit |
Allocator Constructor.
allocate a new image with the specified dimensions. Sets origin at (0,0)
Definition at line 96 of file Image.cc.
|
explicit |
Allocator Constructor.
allocate a new image with the specified dimensions and origin
Definition at line 100 of file Image.cc.
lsst::afw::image::ImageBase< PixelT >::ImageBase | ( | const ImageBase< PixelT > & | src, |
const bool | deep = false |
||
) |
Copy constructor.
src | Right-hand-side image |
deep | If false, new ImageBase shares storage with src ; if true make a new, standalone, ImageBase |
deep
is true
, the new image will share the old image's pixels; this may not be what you want. See also assign(rhs) to copy pixels between Images Definition at line 104 of file Image.cc.
lsst::afw::image::ImageBase< PixelT >::ImageBase | ( | ImageBase< PixelT > && | src | ) |
|
explicit |
Copy constructor to make a copy of part of an image.
The bbox ignores X0/Y0 if origin == LOCAL, and uses it if origin == PARENT.
src | Right-hand-side image |
bbox | Specify desired region |
origin | Specify the coordinate system of the bbox |
deep | If false, new ImageBase shares storage with src ; if true make a new, standalone, ImageBase |
deep
is true
, the new image will share the old image's pixels; this is probably what you want Definition at line 119 of file Image.cc.
|
inline |
generalised copy constructor
defined here in the header so that the compiler can instantiate N(N-1) conversions between N ImageBase types.
Definition at line 217 of file ImageBase.h.
|
explicit |
Construction from ndarray::Array and NumPy.
Unless deep is true, the new image will share memory with the array if the the dimension is contiguous in memory. If the last dimension is not contiguous, the array will be deep-copied in Python, but the constructor will fail to compile in pure C++.
Definition at line 134 of file Image.cc.
|
virtualdefault |
|
staticprotected |
Definition at line 58 of file Image.cc.
|
inlineprotected |
Definition at line 502 of file ImageBase.h.
|
staticprotected |
Definition at line 78 of file Image.cc.
void lsst::afw::image::ImageBase< PixelT >::assign | ( | ImageBase< PixelT > 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.
[in] | rhs | source image whose pixels are to be copied into this image (the destination) |
[in] | bbox | subregion of this image to set; if empty (the default) then all pixels are set |
[in] | origin | origin of bbox: if PARENT then the lower left pixel of this image is at xy0 if LOCAL then the lower left pixel of this image is at 0,0 |
lsst::pex::exceptions::LengthError | if the dimensions of rhs and the specified subregion of this image do not match. |
Definition at line 166 of file Image.cc.
ImageBase< PixelT >::iterator lsst::afw::image::ImageBase< PixelT >::at | ( | int | x, |
int | y | ||
) | const |
ImageBase< PixelT >::iterator lsst::afw::image::ImageBase< PixelT >::begin | ( | ) | const |
Return an STL compliant iterator to the start of the image.
Note that this isn't especially efficient; see imageIterators for a discussion
ImageBase< PixelT >::fast_iterator lsst::afw::image::ImageBase< PixelT >::begin | ( | bool | contiguous | ) | const |
Return a fast STL compliant iterator to the start of the image which must be contiguous.
contiguous | Pixels are contiguous (must be true) |
lsst::pex::exceptions::RuntimeError | Argument contiguous is false, or the pixels are not in fact contiguous |
Definition at line 288 of file Image.cc.
|
inline |
Return an y_iterator
to the start of the y
'th row.
Incrementing an y_iterator
moves it up the column
Definition at line 450 of file ImageBase.h.
|
inline |
ImageBase< PixelT >::iterator lsst::afw::image::ImageBase< PixelT >::end | ( | ) | const |
ImageBase< PixelT >::fast_iterator lsst::afw::image::ImageBase< PixelT >::end | ( | bool | contiguous | ) | const |
Return a fast STL compliant iterator to the end of the image which must be contiguous.
contiguous | Pixels are contiguous (must be true) |
lsst::pex::exceptions::RuntimeError | Argument contiguous is false, or the pixels are not in fact contiguous |
Definition at line 300 of file Image.cc.
ImageBase< PixelT >::PixelReference lsst::afw::image::ImageBase< PixelT >::get | ( | lsst::geom::Point2I const & | index, |
ImageOrigin | origin | ||
) |
Return a reference to a single pixel (with no bounds check).
Definition at line 222 of file Image.cc.
ImageBase< PixelT >::PixelConstReference lsst::afw::image::ImageBase< PixelT >::get | ( | lsst::geom::Point2I const & | index, |
ImageOrigin | origin | ||
) | const |
Return a const reference to a single pixel (with no bounds check).
Definition at line 234 of file Image.cc.
|
inline |
To be removed after 20.0.0. Replaced by get(Point2I, ImageOrigin).
Definition at line 296 of file ImageBase.h.
|
inline |
To be removed after 20.0.0. Replaced by get(Point2I, ImageOrigin).
Definition at line 303 of file ImageBase.h.
ImageBase< PixelT >::Array lsst::afw::image::ImageBase< PixelT >::getArray | ( | ) |
Definition at line 513 of file ImageBase.h.
ImageBase< PixelT >::ConstArray lsst::afw::image::ImageBase< PixelT >::getArray | ( | ) | const |
Definition at line 521 of file ImageBase.h.
|
inline |
Definition at line 482 of file ImageBase.h.
|
inline |
Return the image's size; useful for passing to constructors.
Definition at line 393 of file ImageBase.h.
|
inline |
Return the number of rows in the image.
Definition at line 335 of file ImageBase.h.
|
inline |
Return the number of columns in the image.
Definition at line 333 of file ImageBase.h.
|
inline |
Return the image's column-origin.
This will usually be 0 except for images created using the ImageBase(fileName, hdu, BBox, mode)
ctor or ImageBase(ImageBase, BBox)
cctor The origin can be reset with setXY0
Definition at line 343 of file ImageBase.h.
|
inline |
Return the image's origin.
This will usually be (0, 0) except for images created using the ImageBase(fileName, hdu, BBox, mode)
ctor or ImageBase(ImageBase, BBox)
cctor The origin can be reset with setXY0
Definition at line 360 of file ImageBase.h.
|
inline |
Return the image's row-origin.
This will usually be 0 except for images created using the ImageBase(fileName, hdu, BBox, mode)
ctor or ImageBase(ImageBase, BBox)
cctor The origin can be reset with setXY0
Definition at line 351 of file ImageBase.h.
|
inline |
Convert image index to image position.
The LSST indexing convention is:
ind | image index |
xy | Is this a column or row coordinate? |
Definition at line 386 of file ImageBase.h.
|
inlineprotected |
Definition at line 504 of file ImageBase.h.
ImageBase< PixelT >::PixelReference lsst::afw::image::ImageBase< PixelT >::operator() | ( | int | x, |
int | y | ||
) |
Return a reference to the pixel (x, y)
in LOCAL coordinates.
Definition at line 184 of file Image.cc.
ImageBase< PixelT >::PixelReference lsst::afw::image::ImageBase< PixelT >::operator() | ( | int | x, |
int | y, | ||
CheckIndices const & | check | ||
) |
Return a reference to the pixel (x, y)
in LOCAL coordinates with bounds checking.
Definition at line 190 of file Image.cc.
ImageBase< PixelT >::PixelConstReference lsst::afw::image::ImageBase< PixelT >::operator() | ( | int | x, |
int | y | ||
) | const |
ImageBase< PixelT >::PixelConstReference lsst::afw::image::ImageBase< PixelT >::operator() | ( | int | x, |
int | y, | ||
CheckIndices const & | check | ||
) | const |
Return a const reference to the pixel (x, y)
in LOCAL coordinates with bounds checking.
Definition at line 209 of file Image.cc.
ImageBase< PixelT > & lsst::afw::image::ImageBase< PixelT >::operator<<= | ( | const ImageBase< PixelT > & | rhs | ) |
Set the lhs's pixel values to equal the rhs's.
Definition at line 160 of file Image.cc.
ImageBase< PixelT > & lsst::afw::image::ImageBase< PixelT >::operator= | ( | const ImageBase< PixelT > & | rhs | ) |
Shallow assignment operator.
Definition at line 147 of file Image.cc.
ImageBase< PixelT > & lsst::afw::image::ImageBase< PixelT >::operator= | ( | ImageBase< PixelT > && | rhs | ) |
ImageBase< PixelT > & lsst::afw::image::ImageBase< PixelT >::operator= | ( | const PixelT | rhs | ) |
|
inline |
Return a reference to a single pixel in PARENT coordinates (with no bounds check).
Definition at line 327 of file ImageBase.h.
|
inline |
Return a reference to a single pixel in PARENT coordinates (with no bounds check).
Definition at line 330 of file ImageBase.h.
|
inlinestatic |
Convert a type to our SinglePixel type.
Definition at line 158 of file ImageBase.h.
|
inline |
Convert image position to index (nearest integer and fractional parts)
pos | image position |
xy | Is this a column or row coordinate? |
Definition at line 367 of file ImageBase.h.
ImageBase< PixelT >::reverse_iterator lsst::afw::image::ImageBase< PixelT >::rbegin | ( | ) | const |
ImageBase< PixelT >::reverse_iterator lsst::afw::image::ImageBase< PixelT >::rend | ( | ) | const |
|
inline |
Return an x_iterator
to the start of the y
'th row.
Incrementing an x_iterator
moves it across the row
Definition at line 438 of file ImageBase.h.
|
inline |
|
inline |
To be removed after 20.0.0. Replaced by get(Point2I, ImageOrigin).
Definition at line 308 of file ImageBase.h.
|
inline |
To be removed after 20.0.0. Replaced by get(Point2I, ImageOrigin).
Definition at line 315 of file ImageBase.h.
|
inline |
Set the ImageBase's origin.
The origin is usually set by the constructor, so you shouldn't need this function
Definition at line 471 of file ImageBase.h.
|
inline |
Set the ImageBase's origin.
The origin is usually set by the constructor, so you shouldn't need this function
Definition at line 480 of file ImageBase.h.
void lsst::afw::image::ImageBase< PixelT >::swap | ( | ImageBase< PixelT > & | rhs | ) |
|
inline |
|
inline |
Return an xy_locator
at the point (x, y)
in the image.
Locators may be used to access a patch in an image
Definition at line 462 of file ImageBase.h.
|
inline |
Definition at line 154 of file ImageBase.h.
Definition at line 166 of file ImageBase.h.
Definition at line 168 of file ImageBase.h.