LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
LSST Data Management Base Package
|
A class to specify a slice of an image. More...
#include <ImageSlice.h>
Public Types | |
enum | ImageSliceType { ROW , COLUMN } |
using | image_category = detail::Image_tag |
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 | |
ImageSlice (Image< PixelT > const &img) | |
Constructor for ImageSlice. | |
~ImageSlice () override | |
ImageSliceType | getImageSliceType () const |
Image | subset (lsst::geom::Box2I const &bbox, ImageOrigin origin=PARENT) const |
Return a subimage corresponding to the given box. | |
Image | operator[] (lsst::geom::Box2I const &bbox) const |
Return a subimage corresponding to the given box (interpreted as PARENT coordinates). | |
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). | |
void | writeFits (std::string const &fileName, daf::base::PropertySet const *metadata=nullptr, std::string const &mode="w") const |
Write an image to a regular FITS file. | |
void | writeFits (fits::MemFileManager &manager, daf::base::PropertySet const *metadata=nullptr, std::string const &mode="w") const |
Write an image to a FITS RAM file. | |
void | writeFits (fits::Fits &fitsfile, daf::base::PropertySet const *metadata=nullptr) const |
Write an image to an open FITS file object. | |
void | writeFits (std::string const &filename, fits::ImageWriteOptions const &options, std::string const &mode="w", daf::base::PropertySet const *header=nullptr, Mask< MaskPixel > const *mask=nullptr) const |
Write an image to a regular FITS file. | |
void | writeFits (fits::MemFileManager &manager, fits::ImageWriteOptions const &options, std::string const &mode="w", daf::base::PropertySet const *header=nullptr, Mask< MaskPixel > const *mask=nullptr) const |
Write an image to a FITS RAM file. | |
void | writeFits (fits::Fits &fitsfile, fits::ImageWriteOptions const &options, daf::base::PropertySet const *header=nullptr, Mask< MaskPixel > const *mask=nullptr) const |
Write an image to an open FITS file object. | |
void | swap (Image &rhs) |
void | swap (ImageBase &rhs) |
Image & | operator+= (PixelT const rhs) |
Add scalar rhs to lhs. | |
virtual Image & | operator+= (Image< PixelT > const &rhs) |
Add Image rhs to lhs. | |
Image & | operator+= (lsst::afw::math::Function2< double > const &function) |
Add a Function2(x, y) to an Image. | |
void | scaledPlus (PixelT const c, Image< PixelT > const &rhs) |
Add Image c*rhs to lhs. | |
Image & | operator-= (PixelT const rhs) |
Subtract scalar rhs from lhs. | |
Image & | operator-= (Image< PixelT > const &rhs) |
Subtract Image rhs from lhs. | |
Image & | operator-= (lsst::afw::math::Function2< double > const &function) |
Subtract a Function2(x, y) from an Image. | |
void | scaledMinus (PixelT const c, Image< PixelT > const &rhs) |
Subtract Image c*rhs from lhs. | |
Image & | operator*= (PixelT const rhs) |
Multiply lhs by scalar rhs. | |
Image & | operator*= (Image< PixelT > const &rhs) |
Multiply lhs by Image rhs (i.e. pixel-by-pixel multiplication) | |
void | scaledMultiplies (PixelT const c, Image< PixelT > const &rhs) |
Multiply lhs by Image c*rhs (i.e. pixel-by-pixel multiplication) | |
Image & | operator/= (PixelT const rhs) |
Divide lhs by scalar rhs. | |
Image & | operator/= (Image< PixelT > const &rhs) |
Divide lhs by Image rhs (i.e. pixel-by-pixel division) | |
Image< double > & | operator/= (double const rhs) |
Image< float > & | operator/= (float const rhs) |
void | scaledDivides (PixelT const c, Image< PixelT > const &rhs) |
Divide lhs by Image c*rhs (i.e. pixel-by-pixel division) | |
void | sqrt () |
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). | |
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. | |
Array | getArray () |
ConstArray | getArray () const |
iterator | begin () const |
Return an STL compliant iterator to the start of the image. | |
fast_iterator | begin (bool contiguous) const |
Return a fast STL compliant iterator to the start of the image which must be contiguous. | |
iterator | end () const |
Return an STL compliant iterator to the end of the image. | |
fast_iterator | end (bool contiguous) const |
Return a fast STL compliant iterator to the end of the image which must be contiguous. | |
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) | |
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 | |
static Image | readFits (std::string const &filename, int hdu=fits::DEFAULT_HDU) |
Read an Image from a regular FITS file. | |
static Image | readFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU) |
Read an Image from a FITS RAM file. | |
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) |
A class to specify a slice of an image.
Definition at line 46 of file ImageSlice.h.
|
inherited |
A mutable ndarray representation of the image.
Definition at line 149 of file ImageBase.h.
|
inherited |
An STL compliant const iterator.
Definition at line 127 of file ImageBase.h.
|
inherited |
An STL compliant const reverse iterator.
Definition at line 131 of file ImageBase.h.
|
inherited |
A const iterator for traversing the pixels in a row.
Definition at line 141 of file ImageBase.h.
|
inherited |
A const_xy_locator.
Definition at line 123 of file ImageBase.h.
|
inherited |
A const iterator for traversing the pixels in a column.
Definition at line 147 of file ImageBase.h.
|
inherited |
An immutable ndarray representation of the image.
Definition at line 151 of file ImageBase.h.
|
inherited |
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.
|
inherited |
|
inherited |
An STL compliant iterator.
Definition at line 125 of file ImageBase.h.
|
inherited |
A pixel in this ImageBase.
Definition at line 115 of file ImageBase.h.
|
inherited |
A ConstReference to a PixelT.
Definition at line 119 of file ImageBase.h.
|
inherited |
A Reference to a PixelT.
Definition at line 117 of file ImageBase.h.
|
inherited |
An STL compliant reverse iterator.
Definition at line 129 of file ImageBase.h.
|
inherited |
A single Pixel of the same type as those in the ImageBase.
Definition at line 113 of file ImageBase.h.
|
inherited |
An iterator for traversing the pixels in a row.
Definition at line 133 of file ImageBase.h.
|
inherited |
An xy_locator.
Definition at line 121 of file ImageBase.h.
|
inherited |
An iterator for traversing the pixels in a row, created from an xy_locator.
Definition at line 139 of file ImageBase.h.
|
inherited |
An iterator for traversing the pixels in a row, created from an xy_locator.
Definition at line 145 of file ImageBase.h.
|
inherited |
An iterator for traversing the pixels in a column.
Definition at line 143 of file ImageBase.h.
enum lsst::afw::image::ImageSlice::ImageSliceType |
|
explicit |
Constructor for ImageSlice.
img | The image to represent as a slice. |
Definition at line 41 of file ImageSlice.cc.
|
inlineoverride |
Definition at line 56 of file ImageSlice.h.
|
staticprotectedinherited |
Definition at line 45 of file Image.cc.
|
inlineprotectedinherited |
Definition at line 465 of file ImageBase.h.
|
staticprotectedinherited |
Definition at line 65 of file Image.cc.
|
inherited |
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.
|
inherited |
|
inherited |
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.
|
inherited |
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.
|
inlineinherited |
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.
|
inlineinherited |
|
inherited |
|
inherited |
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.
|
inherited |
Return a reference to a single pixel (with no bounds check).
Definition at line 209 of file Image.cc.
|
inherited |
|
inlineinherited |
Return the area of the image.
Definition at line 298 of file ImageBase.h.
|
inherited |
Definition at line 476 of file ImageBase.h.
|
inherited |
Definition at line 491 of file ImageBase.h.
|
inlineinherited |
Definition at line 445 of file ImageBase.h.
|
inlineinherited |
Return the image's size; useful for passing to constructors.
Definition at line 356 of file ImageBase.h.
|
inlineinherited |
Return the number of rows in the image.
Definition at line 296 of file ImageBase.h.
|
inline |
Definition at line 57 of file ImageSlice.h.
|
inlineinherited |
Return the number of columns in the image.
Definition at line 294 of file ImageBase.h.
|
inlineinherited |
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.
|
inlineinherited |
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.
|
inlineinherited |
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.
|
inlineinherited |
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.
|
inlineprotectedinherited |
Definition at line 467 of file ImageBase.h.
|
inherited |
Return a reference to the pixel (x, y)
in LOCAL coordinates.
Definition at line 171 of file Image.cc.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Multiply lhs by scalar rhs.
Definition at line 545 of file Image.cc.
|
virtualinherited |
|
inherited |
Add a Function2(x, y) to an Image.
function | function to add |
Definition at line 474 of file Image.cc.
|
inherited |
Add scalar rhs to lhs.
Definition at line 455 of file Image.cc.
|
inherited |
|
inherited |
|
inherited |
Subtract scalar rhs from lhs.
Definition at line 500 of file Image.cc.
|
inherited |
|
inherited |
|
inherited |
Divide lhs by scalar rhs.
Definition at line 577 of file Image.cc.
|
inlineinherited |
Return a subimage corresponding to the given box (interpreted as PARENT coordinates).
Definition at line 224 of file Image.h.
|
inlineinherited |
Return a reference to a single pixel in PARENT coordinates (with no bounds check).
Definition at line 288 of file ImageBase.h.
|
inlineinherited |
Return a reference to a single pixel in PARENT coordinates (with no bounds check).
Definition at line 291 of file ImageBase.h.
|
inlinestaticinherited |
Convert a type to our SinglePixel type.
Definition at line 158 of file ImageBase.h.
|
inlineinherited |
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.
|
inherited |
|
inlinestaticinherited |
Read an Image from a FITS RAM file.
[in] | manager | Object that manages the memory to be read. |
[in] | hdu | Number of the "header-data unit" to read (where 0 is the Primary HDU). The default value of afw::fits::DEFAULT_HDU is interpreted as "the first HDU with NAXIS != 0". |
|
inlinestaticinherited |
Read an Image from a regular FITS file.
[in] | filename | Name of the file to read. |
[in] | hdu | Number of the "header-data unit" to read (where 0 is the Primary HDU). The default value of afw::fits::DEFAULT_HDU is interpreted as "the first HDU with NAXIS != 0". |
|
inherited |
|
inlineinherited |
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.
|
inlineinherited |
|
inherited |
Divide lhs by Image c*rhs (i.e. pixel-by-pixel division)
Definition at line 612 of file Image.cc.
|
inherited |
Subtract Image c*rhs from lhs.
Definition at line 519 of file Image.cc.
|
inherited |
Multiply lhs by Image c*rhs (i.e. pixel-by-pixel multiplication)
Definition at line 564 of file Image.cc.
|
inherited |
Add Image c*rhs to lhs.
Definition at line 487 of file Image.cc.
|
inlineinherited |
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.
|
inlineinherited |
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.
|
inherited |
|
inlineinherited |
Return a subimage corresponding to the given box.
bbox | Bounding box of the subimage returned. |
origin | Origin bbox is rleative to; PARENT accounts for xy0, LOCAL does not. |
This method is wrapped as getitem in Python.
Definition at line 219 of file Image.h.
|
inherited |
|
inherited |
|
inherited |
Write an image to an open FITS file object.
[in] | fitsfile | A FITS file already open to the desired HDU. |
[in] | metadata | Additional values to write to the header (may be null). |
|
inherited |
Write an image to an open FITS file object.
[in] | fitsfile | A FITS file already open to the desired HDU. |
[in] | options | Options controlling writing of FITS image. |
[in] | header | Additional values to write to the header (may be null). |
[in] | mask | Mask, for calculation of statistics. |
|
inherited |
Write an image to a FITS RAM file.
[in] | manager | Manager object for the memory block to write to. |
[in] | metadata | Additional values to write to the header (may be null). |
[in] | mode | "w"=Create a new file; "a"=Append a new HDU. |
|
inherited |
Write an image to a FITS RAM file.
[in] | manager | Manager object for the memory block to write to. |
[in] | options | Options controlling writing of FITS image. |
[in] | header | Additional values to write to the header (may be null). |
[in] | mode | "w"=Create a new file; "a"=Append a new HDU. |
[in] | mask | Mask, for calculation of statistics. |
|
inherited |
Write an image to a regular FITS file.
[in] | fileName | Name of the file to write. |
[in] | metadata | Additional values to write to the header (may be null). |
[in] | mode | "w"=Create a new file; "a"=Append a new HDU. |
|
inherited |
Write an image to a regular FITS file.
[in] | filename | Name of the file to write. |
[in] | options | Options controlling writing of FITS image. |
[in] | mode | "w"=Create a new file; "a"=Append a new HDU. |
[in] | header | Additional values to write to the header (may be null). |
[in] | mask | Mask, for calculation of statistics. |
|
inlineinherited |
Return an x_iterator
to the point (x, y)
in the image.
Definition at line 407 of file ImageBase.h.
|
inlineinherited |
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.
|
inlineinherited |
Return an y_iterator
to the point (x, y)
in the image.
Definition at line 419 of file ImageBase.h.