LSST Applications g063fba187b+cac8b7c890,g0f08755f38+6aee506743,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+b4475c5878,g1dcb35cd9c+8f9bc1652e,g20f6ffc8e0+6aee506743,g217e2c1bcf+73dee94bd0,g28da252d5a+1f19c529b9,g2bbee38e9b+3f2625acfc,g2bc492864f+3f2625acfc,g3156d2b45e+6e55a43351,g32e5bea42b+1bb94961c2,g347aa1857d+3f2625acfc,g35bb328faa+a8ce1bb630,g3a166c0a6a+3f2625acfc,g3e281a1b8c+c5dd892a6c,g3e8969e208+a8ce1bb630,g414038480c+5927e1bc1e,g41af890bb2+8a9e676b2a,g7af13505b9+809c143d88,g80478fca09+6ef8b1810f,g82479be7b0+f568feb641,g858d7b2824+6aee506743,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+2903d499ea,gb58c049af0+d64f4d3760,gc28159a63d+3f2625acfc,gcab2d0539d+b12535109e,gcf0d15dbbd+46a3f46ba9,gda6a2b7d83+46a3f46ba9,gdaeeff99f8+1711a396fd,ge79ae78c31+3f2625acfc,gef2f8181fd+0a71e47438,gf0baf85859+c1f95f4921,gfa517265be+6aee506743,gfa999e8aa5+17cd334064,w.2024.51
LSST Data Management Base Package
|
The base class for all image classed (Image, Mask, MaskedImage, ...) More...
#include <ImageBase.h>
Public Types | |
using | image_category = detail::basic_tag |
trait class to identify type of image | |
using | SinglePixel = PixelT |
A single Pixel of the same type as those in the ImageBase. | |
using | Pixel = PixelT |
A pixel in this ImageBase. | |
using | PixelReference = typename Reference<PixelT>::type |
A Reference to a PixelT. | |
using | PixelConstReference = typename ConstReference<PixelT>::type |
A ConstReference to a PixelT. | |
using | xy_locator = typename _view_t::xy_locator |
An xy_locator. | |
using | const_xy_locator = typename _view_t::xy_locator::const_t |
A const_xy_locator. | |
using | iterator = typename _view_t::iterator |
An STL compliant iterator. | |
using | const_iterator = typename _const_view_t::iterator |
An STL compliant const iterator. | |
using | reverse_iterator = typename _view_t::reverse_iterator |
An STL compliant reverse iterator. | |
using | const_reverse_iterator = typename _const_view_t::reverse_iterator |
An STL compliant const reverse iterator. | |
using | x_iterator = typename _view_t::x_iterator |
An iterator for traversing the pixels in a row. | |
using | fast_iterator = x_iterator |
A fast STL compliant iterator for contiguous images N.b. | |
using | xy_x_iterator = typename _view_t::x_iterator |
An iterator for traversing the pixels in a row, created from an xy_locator. | |
using | const_x_iterator = typename _const_view_t::x_iterator |
A const iterator for traversing the pixels in a row. | |
using | y_iterator = typename _view_t::y_iterator |
An iterator for traversing the pixels in a column. | |
using | xy_y_iterator = typename _view_t::y_iterator |
An iterator for traversing the pixels in a row, created from an xy_locator. | |
using | const_y_iterator = typename _const_view_t::y_iterator |
A const iterator for traversing the pixels in a column. | |
using | Array = typename ndarray::Array<PixelT, 2, 1> |
A mutable ndarray representation of the image. | |
using | ConstArray = typename ndarray::Array<const PixelT, 2, 1> |
An immutable ndarray representation of the image. | |
Public Member Functions | |
ImageBase (const lsst::geom::Extent2I &dimensions=lsst::geom::Extent2I()) | |
Allocator Constructor. | |
ImageBase (const lsst::geom::Box2I &bbox) | |
Allocator Constructor. | |
ImageBase (const ImageBase &src, const bool deep=false) | |
Copy constructor. | |
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. | |
template<typename OtherPixelT > | |
ImageBase (const ImageBase< OtherPixelT > &rhs, const bool deep) | |
generalised copy constructor | |
ImageBase (Array const &array, bool deep=false, lsst::geom::Point2I const &xy0=lsst::geom::Point2I()) | |
Construction from ndarray::Array and NumPy. | |
virtual | ~ImageBase ()=default |
ImageBase & | operator= (const ImageBase &rhs) |
Shallow assignment operator. | |
ImageBase & | operator= (ImageBase &&rhs) |
ImageBase & | operator= (const PixelT rhs) |
Set the image's pixels to 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. | |
PixelReference | operator() (int x, int y) |
Return a reference to the pixel (x, y) in LOCAL coordinates. | |
PixelReference | operator() (int x, int y, CheckIndices const &) |
Return a reference to the pixel (x, y) in LOCAL coordinates with bounds checking. | |
PixelConstReference | operator() (int x, int y) const |
Return a const reference to the pixel (x, y) in LOCAL coordinates. | |
PixelConstReference | operator() (int x, int y, CheckIndices const &) const |
Return a const reference to the pixel (x, y) in LOCAL coordinates with bounds checking. | |
PixelReference | get (lsst::geom::Point2I const &index, ImageOrigin origin) |
Return a reference to a single pixel (with no bounds check). | |
PixelConstReference | get (lsst::geom::Point2I const &index, ImageOrigin origin) const |
Return a const reference to a single pixel (with no bounds check). | |
PixelReference | operator[] (lsst::geom::Point2I const &index) |
Return a reference to a single pixel in PARENT coordinates (with no bounds check). | |
PixelConstReference | operator[] (lsst::geom::Point2I const &index) const |
Return a reference to a single pixel in PARENT coordinates (with no bounds check). | |
int | getWidth () const |
Return the number of columns in the image. | |
int | getHeight () const |
Return the number of rows in the image. | |
int | getArea () const |
Return the area of the image. | |
int | getX0 () const |
Return the image's column-origin. | |
int | getY0 () const |
Return the image's row-origin. | |
lsst::geom::Point2I | getXY0 () const |
Return the image's origin. | |
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) | |
double | indexToPosition (double ind, lsst::afw::image::xOrY const xy) const |
Convert image index to image position. | |
lsst::geom::Extent2I | getDimensions () const |
Return the image's size; useful for passing to constructors. | |
void | swap (ImageBase &rhs) |
Array | getArray () |
ConstArray | getArray () const |
iterator | begin () const |
Return an STL compliant iterator to the start of the image. | |
iterator | end () const |
Return an STL compliant iterator to the end of the image. | |
reverse_iterator | rbegin () const |
Return an STL compliant reverse iterator to the start of the image. | |
reverse_iterator | rend () const |
Return an STL compliant reverse iterator to the end of the image. | |
iterator | at (int x, int y) const |
Return an STL compliant iterator at the point (x, y) | |
fast_iterator | begin (bool contiguous) const |
Return a fast STL compliant iterator to the start of the image which must be contiguous. | |
fast_iterator | end (bool contiguous) const |
Return a fast STL compliant iterator to the end of the image which must be contiguous. | |
x_iterator | row_begin (int y) const |
Return an x_iterator to the start of the y 'th row. | |
x_iterator | row_end (int y) const |
Return an x_iterator to the end of the y 'th row. | |
x_iterator | x_at (int x, int y) const |
Return an x_iterator to the point (x, y) in the image. | |
y_iterator | col_begin (int x) const |
Return an y_iterator to the start of the y 'th row. | |
y_iterator | col_end (int x) const |
Return an y_iterator to the start of the y 'th row. | |
y_iterator | y_at (int x, int y) const |
Return an y_iterator to the point (x, y) in the image. | |
xy_locator | xy_at (int x, int y) const |
Return an xy_locator at the point (x, y) in the image. | |
void | setXY0 (lsst::geom::Point2I const origin) |
Set the ImageBase's origin. | |
void | setXY0 (int const x0, int const y0) |
Set the ImageBase's origin. | |
lsst::geom::Box2I | getBBox (ImageOrigin origin=PARENT) const |
Static Public Member Functions | |
template<typename SinglePixelT > | |
static SinglePixel | PixelCast (SinglePixelT rhs) |
Convert a type to our SinglePixel type. | |
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.
using lsst::afw::image::ImageBase< PixelT >::Array = typename ndarray::Array<PixelT, 2, 1> |
A mutable ndarray representation of the image.
Definition at line 149 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::const_iterator = typename _const_view_t::iterator |
An STL compliant const iterator.
Definition at line 127 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::const_reverse_iterator = typename _const_view_t::reverse_iterator |
An STL compliant const reverse iterator.
Definition at line 131 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::const_x_iterator = typename _const_view_t::x_iterator |
A const iterator for traversing the pixels in a row.
Definition at line 141 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::const_xy_locator = typename _view_t::xy_locator::const_t |
A const_xy_locator.
Definition at line 123 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::const_y_iterator = typename _const_view_t::y_iterator |
A const iterator for traversing the pixels in a column.
Definition at line 147 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::ConstArray = typename ndarray::Array<const PixelT, 2, 1> |
An immutable ndarray representation of the image.
Definition at line 151 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::fast_iterator = x_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.
using lsst::afw::image::ImageBase< PixelT >::image_category = detail::basic_tag |
trait class to identify type of image
Definition at line 110 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::iterator = typename _view_t::iterator |
An STL compliant iterator.
Definition at line 125 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::Pixel = PixelT |
A pixel in this ImageBase.
Definition at line 115 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::PixelConstReference = typename ConstReference<PixelT>::type |
A ConstReference to a PixelT.
Definition at line 119 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::PixelReference = typename Reference<PixelT>::type |
A Reference to a PixelT.
Definition at line 117 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::reverse_iterator = typename _view_t::reverse_iterator |
An STL compliant reverse iterator.
Definition at line 129 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::SinglePixel = PixelT |
A single Pixel of the same type as those in the ImageBase.
Definition at line 113 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::x_iterator = typename _view_t::x_iterator |
An iterator for traversing the pixels in a row.
Definition at line 133 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::xy_locator = typename _view_t::xy_locator |
An xy_locator.
Definition at line 121 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::xy_x_iterator = typename _view_t::x_iterator |
An iterator for traversing the pixels in a row, created from an xy_locator.
Definition at line 139 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::xy_y_iterator = typename _view_t::y_iterator |
An iterator for traversing the pixels in a row, created from an xy_locator.
Definition at line 145 of file ImageBase.h.
using lsst::afw::image::ImageBase< PixelT >::y_iterator = typename _view_t::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 89 of file Image.cc.
|
explicit |
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 97 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 112 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++.
|
virtualdefault |
|
staticprotected |
Definition at line 45 of file Image.cc.
|
inlineprotected |
Definition at line 465 of file ImageBase.h.
|
staticprotected |
Definition at line 65 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 153 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 Image Iterators for a discussion
Definition at line 250 of file Image.cc.
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 275 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 413 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 287 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 209 of file Image.cc.
ImageBase< PixelT >::PixelConstReference lsst::afw::image::ImageBase< PixelT >::get | ( | lsst::geom::Point2I const & | index, |
ImageOrigin | origin ) const |
|
inline |
Return the area of the image.
Definition at line 298 of file ImageBase.h.
ImageBase< PixelT >::Array lsst::afw::image::ImageBase< PixelT >::getArray | ( | ) |
Definition at line 476 of file ImageBase.h.
ImageBase< PixelT >::ConstArray lsst::afw::image::ImageBase< PixelT >::getArray | ( | ) | const |
Definition at line 491 of file ImageBase.h.
|
inline |
Definition at line 445 of file ImageBase.h.
|
inline |
Return the image's size; useful for passing to constructors.
Definition at line 356 of file ImageBase.h.
|
inline |
Return the number of rows in the image.
Definition at line 296 of file ImageBase.h.
|
inline |
Return the number of columns in the image.
Definition at line 294 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 306 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 323 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 314 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 349 of file ImageBase.h.
|
inlineprotected |
Definition at line 467 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 171 of file Image.cc.
ImageBase< PixelT >::PixelConstReference lsst::afw::image::ImageBase< PixelT >::operator() | ( | int | x, |
int | y ) const |
ImageBase< PixelT >::PixelReference lsst::afw::image::ImageBase< PixelT >::operator() | ( | int | x, |
int | y, | ||
CheckIndices const & | check ) |
ImageBase< PixelT >::PixelConstReference lsst::afw::image::ImageBase< PixelT >::operator() | ( | int | x, |
int | y, | ||
CheckIndices const & | check ) const |
ImageBase< PixelT > & lsst::afw::image::ImageBase< PixelT >::operator= | ( | const ImageBase< PixelT > & | rhs | ) |
Shallow assignment operator.
ImageBase< PixelT > & lsst::afw::image::ImageBase< PixelT >::operator= | ( | const PixelT | rhs | ) |
Set the image's pixels to rhs.
ImageBase< PixelT > & lsst::afw::image::ImageBase< PixelT >::operator= | ( | ImageBase< PixelT > && | rhs | ) |
|
inline |
Return a reference to a single pixel in PARENT coordinates (with no bounds check).
Definition at line 288 of file ImageBase.h.
|
inline |
Return a reference to a single pixel in PARENT coordinates (with no bounds check).
Definition at line 291 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 330 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 401 of file ImageBase.h.
|
inline |
|
inline |
Set the ImageBase's origin.
The origin is usually set by the constructor, so you shouldn't need this function
Definition at line 443 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 434 of file ImageBase.h.
void lsst::afw::image::ImageBase< PixelT >::swap | ( | ImageBase< PixelT > & | rhs | ) |
|
inline |
Return an x_iterator
to the point (x, y)
in the image.
Definition at line 407 of file ImageBase.h.
|
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 425 of file ImageBase.h.
|
inline |
Return an y_iterator
to the point (x, y)
in the image.
Definition at line 419 of file ImageBase.h.
Definition at line 154 of file ImageBase.h.
Definition at line 166 of file ImageBase.h.
|
friend |
Definition at line 168 of file ImageBase.h.