LSST Applications
21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
|
A compact representation of a collection of pixels. More...
#include <SpanSet.h>
Public Types | |
using | const_iterator = std::vector< Span >::const_iterator |
using | size_type = std::vector< Span >::size_type |
using | value_type = Span |
using | const_reference = const value_type & |
Public Member Functions | |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
const_reference | front () const |
const_reference | back () const |
size_type | size () const |
bool | empty () const |
SpanSet () | |
Default constructor. More... | |
SpanSet (lsst::geom::Box2I const &box) | |
Construct a SpanSet from a box. More... | |
template<typename iter > | |
SpanSet (iter begin, iter end, bool normalize=true) | |
Construct a SpanSet from an iterator. More... | |
SpanSet (std::vector< Span > const &vec, bool normalize=true) | |
Construct a SpanSet from a std vector by copying. More... | |
SpanSet (std::vector< Span > &&vec, bool normalize=true) | |
Construct a SpanSet from a std vector from a move. More... | |
SpanSet (SpanSet const &other)=delete | |
SpanSet (SpanSet &&other)=delete | |
~SpanSet () override=default | |
SpanSet & | operator= (SpanSet const &)=default |
SpanSet & | operator= (SpanSet &&other) |
size_type | getArea () const |
Return the number of pixels in the SpanSet. More... | |
lsst::geom::Box2I | getBBox () const |
Return a new integer box which is the minimum size to contain the pixels. More... | |
bool | isContiguous () const |
Defines if the SpanSet is simply contiguous. More... | |
std::shared_ptr< SpanSet > | shiftedBy (int x, int y) const |
Return a new SpanSet shifted by specified amount. More... | |
std::shared_ptr< SpanSet > | shiftedBy (lsst::geom::Extent2I const &offset) const |
Return a new SpanSet shifted by specified amount. More... | |
std::shared_ptr< SpanSet > | clippedTo (lsst::geom::Box2I const &box) const |
Return a new SpanSet which has all pixel values inside specified box. More... | |
std::shared_ptr< SpanSet > | transformedBy (lsst::geom::LinearTransform const &t) const |
Return a new SpanSet who's pixels are the product of applying the specified transformation. More... | |
std::shared_ptr< SpanSet > | transformedBy (lsst::geom::AffineTransform const &t) const |
Return a new SpanSet who's pixels are the product of applying the specified transformation. More... | |
std::shared_ptr< SpanSet > | transformedBy (TransformPoint2ToPoint2 const &t) const |
Return a new SpanSet who's pixels are the product of applying the specified transformation. More... | |
bool | overlaps (SpanSet const &other) const |
Specifies if this SpanSet overlaps with another SpanSet. More... | |
bool | contains (SpanSet const &other) const |
Check if a SpanSet instance entirely contains another SpanSet. More... | |
bool | contains (lsst::geom::Point2I const &point) const |
Check if a point is contained within the SpanSet instance. More... | |
lsst::geom::Point2D | computeCentroid () const |
Compute the point about which the SpanSet's first moment is zero. More... | |
ellipses::Quadrupole | computeShape () const |
Compute the shape parameters for the distribution of points in the SpanSet. More... | |
std::shared_ptr< SpanSet > | dilated (int r, Stencil s=Stencil::CIRCLE) const |
Perform a set dilation operation, and return a new object. More... | |
std::shared_ptr< SpanSet > | dilated (SpanSet const &other) const |
Perform a set dilation operation, and return a new object. More... | |
std::shared_ptr< SpanSet > | eroded (int r, Stencil s=Stencil::CIRCLE) const |
Perform a set erosion, and return a new object. More... | |
std::shared_ptr< SpanSet > | eroded (SpanSet const &other) const |
Perform a set erosion operation, and return a new object. More... | |
template<typename Pixel , int inN, int inC> | |
ndarray::Array< typename std::remove_const< Pixel >::type, inN - 1, inN - 1 > | flatten (ndarray::Array< Pixel, inN, inC > const &input, lsst::geom::Point2I const &xy0=lsst::geom::Point2I()) const |
Reduce the pixel dimensionality from 2 to 1 of an array at points given by SpanSet. More... | |
template<typename PixelIn , typename PixelOut , int inA, int outC, int inC> | |
void | flatten (ndarray::Array< PixelOut, inA - 1, outC > const &output, ndarray::Array< PixelIn, inA, inC > const &input, lsst::geom::Point2I const &xy0=lsst::geom::Point2I()) const |
Reduce the pixel dimensionality from 2 to 1 of an array at points given by SpanSet. More... | |
template<typename Pixel , int inA, int inC> | |
ndarray::Array< typename std::remove_const< Pixel >::type, inA+1, inA+1 > | unflatten (ndarray::Array< Pixel, inA, inC > const &input) const |
Expand an array by one spatial dimension at points given by SpanSet. More... | |
template<typename PixelIn , typename PixelOut , int inA, int outC, int inC> | |
void | unflatten (ndarray::Array< PixelOut, inA+1, outC > const &output, ndarray::Array< PixelIn, inA, inC > const &input, lsst::geom::Point2I const &xy0=lsst::geom::Point2I()) const |
Expand an array by one spatial dimension at points given by SpanSet. More... | |
template<typename ImageT > | |
void | copyImage (image::Image< ImageT > const &src, image::Image< ImageT > &dest) |
Copy contents of source Image into destination image at the positions defined in the SpanSet. More... | |
template<typename ImageT , typename MaskT , typename VarT > | |
void | copyMaskedImage (image::MaskedImage< ImageT, MaskT, VarT > const &src, image::MaskedImage< ImageT, MaskT, VarT > &dest) |
Copy contents of source MaskedImage into destination image at the positions defined in the SpanSet. More... | |
template<typename ImageT > | |
void | setImage (image::Image< ImageT > &image, ImageT val, lsst::geom::Box2I const ®ion=lsst::geom::Box2I(), bool doClip=false) const |
Set the values of an Image at points defined by the SpanSet. More... | |
template<typename Functor , typename... Args> | |
void | applyFunctor (Functor &&func, Args &&... args) const |
Apply functor on individual elements from the supplied parameters. More... | |
template<typename T > | |
void | setMask (lsst::afw::image::Mask< T > &target, T bitmask) const |
Set a Mask at pixels defined by the SpanSet. More... | |
template<typename T > | |
void | clearMask (lsst::afw::image::Mask< T > &target, T bitmask) const |
Unset a Mask at pixels defined by the SpanSet. More... | |
std::shared_ptr< SpanSet > | intersect (SpanSet const &other) const |
Determine the common points between two SpanSets, and create a new SpanSet. More... | |
template<typename T > | |
std::shared_ptr< SpanSet > | intersect (image::Mask< T > const &other, T bitmask) const |
Determine the common points between a SpanSet and a Mask with a given bit pattern. More... | |
std::shared_ptr< SpanSet > | intersectNot (SpanSet const &other) const |
Determine the common points between a SpanSet and the logical inverse of a second SpanSet and return them in a new SpanSet. More... | |
template<typename T > | |
std::shared_ptr< SpanSet > | intersectNot (image::Mask< T > const &other, T bitmask) const |
Determine the common points between a SpanSet and the logical inverse of a Mask for a given bit pattern. More... | |
std::shared_ptr< SpanSet > | union_ (SpanSet const &other) const |
Create a new SpanSet that contains all points from two SpanSets. More... | |
template<typename T > | |
std::shared_ptr< SpanSet > | union_ (image::Mask< T > const &other, T bitmask) const |
Determine the union between a SpanSet and a Mask for a given bit pattern. More... | |
bool | operator== (SpanSet const &other) const |
Compute equality between two SpanSets. More... | |
bool | operator!= (SpanSet const &other) const |
std::vector< std::shared_ptr< geom::SpanSet > > | split () const |
Split a discontinuous SpanSet into multiple SpanSets which are contiguous. More... | |
bool | isPersistable () const noexcept override |
Return true if this particular object can be persisted using afw::table::io. More... | |
std::shared_ptr< geom::SpanSet > | findEdgePixels () const |
Select pixels within the SpanSet which touch its edge. More... | |
void | writeFits (std::string const &fileName, std::string const &mode="w") const |
Write the object to a regular FITS file. More... | |
void | writeFits (fits::MemFileManager &manager, std::string const &mode="w") const |
Write the object to a FITS image in memory. More... | |
void | writeFits (fits::Fits &fitsfile) const |
Write the object to an already-open FITS object. More... | |
Static Public Member Functions | |
static std::shared_ptr< geom::SpanSet > | fromShape (int r, Stencil s=Stencil::CIRCLE, lsst::geom::Point2I offset=lsst::geom::Point2I()) |
Factory function for creating SpanSets from a Stencil. More... | |
static std::shared_ptr< geom::SpanSet > | fromShape (geom::ellipses::Ellipse const &ellipse) |
Factory function for creating SpanSets from an ellipse object. More... | |
template<typename T , typename UnaryPredicate = details::AnyBitSetFunctor<T>> | |
static std::shared_ptr< geom::SpanSet > | fromMask (image::Mask< T > const &mask, UnaryPredicate comparator=details::AnyBitSetFunctor< T >()) |
Create a SpanSet from a mask. More... | |
template<typename T > | |
static std::shared_ptr< geom::SpanSet > | fromMask (image::Mask< T > const &mask, T bitmask) |
Create a SpanSet from a mask. More... | |
static std::shared_ptr< lsst::afw::geom::SpanSet > | readFits (fits::Fits &fitsfile) |
Read an object from an already open FITS object. More... | |
static std::shared_ptr< lsst::afw::geom::SpanSet > | readFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU) |
Read an object from a regular FITS file. More... | |
static std::shared_ptr< lsst::afw::geom::SpanSet > | readFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU) |
Read an object from a FITS file in memory. More... | |
static std::shared_ptr< lsst::afw::geom::SpanSet > | dynamicCast (std::shared_ptr< Persistable > const &ptr) |
Dynamically cast a shared_ptr. More... | |
Protected Types | |
using | OutputArchiveHandle = io::OutputArchiveHandle |
Friends | |
class | SpansSetFactory |
A compact representation of a collection of pixels.
A SpanSet is a collection of Span classes. As each Span encodes a range of pixels on a given row, a SpanSet represents an arbitrary collection of pixels on an image. The SpanSet class also contains mathematical set style operators, for working with the collection of pixels, and helper functions which make use of the area defined to perform localized actions
using lsst::afw::geom::SpanSet::const_reference = const value_type & |
|
protectedinherited |
Definition at line 108 of file Persistable.h.
lsst::afw::geom::SpanSet::SpanSet | ( | ) |
Default constructor.
Construct a null SpanSet, with zero size. This is useful as a placeholder
Definition at line 177 of file SpanSet.cc.
|
explicit |
Construct a SpanSet from a box.
box | A integer box that defines the shape for which a span set should be created |
Definition at line 180 of file SpanSet.cc.
|
inline |
Construct a SpanSet from an iterator.
This constructor accepts the begin and end points of an arbitrary iterator of a container which contains previously created Spans. These Spans are used to construct the SpanSet.
begin | Beginning iterator of a container of Spans |
end | End iterator of a container of Spans |
normalize | Controls if the constructor attempts to merge connected or overlapping spans. Defaults to true. Set to false to save computational time when the container is sure to already be normalized. |
Definition at line 123 of file SpanSet.h.
|
explicit |
Construct a SpanSet from a std vector by copying.
This constructor accepts a standard vector which contains already created Spans. These Spans are copied into the internal container of spans.
vec | Standard vector containing Spans |
normalize | Controls if the constructor attempts to merge connected or overlapping spans. Defaults to true. Set to false to save computational time when the container is sure to already be normalized. |
Definition at line 192 of file SpanSet.cc.
|
explicit |
Construct a SpanSet from a std vector from a move.
This constructor accepts a standard vector r-reference which contains already created Spans. These Spans become the internal container of spans.
vec | Standard vector containing Spans |
normalize | Controls if the constructor attempts to merge connected or overlapping spans. Defaults to true. Set to false to save computational time when the container is sure to already be normalized. |
Definition at line 206 of file SpanSet.cc.
|
delete |
|
delete |
|
overridedefault |
|
inline |
Apply functor on individual elements from the supplied parameters.
Use a variadic template to take a functor object, and an arbitrary number of parameters. Parameters may be of type(s) Image, MakedImage, ndarray, numeric value and generic iterators. For most of these types bound checking is done to ensure execution safety, but because a generic iterator can have any behavior, bounds checking is not possible. As such the iterator must be valid for at least the number of pixels contained in the SpanSet. Numeric values are also different in that they will not be iterated but the value will be passed to the functor for each point in the SpanSet.
Because a ndarray can either be interpreted as either a two dimensional image, or a one dimensional vector a user must break the ambiguity by using the functions ndarray::ndImage, or ndarray::ndFlat respectively.
The functor object must operate in-place on any data, no return values are captured. No exceptions are handled, if a functor throws one it will propagate back out of the applyFunctor call, possibly leaving the output array in an incomplete state. The first argument of the functor must be a lsst::geom::Point2I which will be the point in the SpanSet where the operation is occurring. All the remaining arguments to the functor will be individual values generated from the input arguments. For two dimensional types (Image, MaskedImage, ndarray) arguments will be the value taken from the input type at the location given by the SpanSet. I.e. if the SpanSet has the point (2,3) in it, then a 2 dimensional ndarray will have ndarray[2][3] passed to the functor. Thus all SpanSet coordinates must be addressable in two dimensional types. For one dimensional types (ndarray, iterator) arguments will correspond to the value at the location defined by number of pixels which have been iterated over. I.e. if there are 3 pixels defined in the SpanSet a one dimensional ndarray will have the value ndarray[0] passed to the functor on on the first functor call, ndarray[1] passed on the second call, and ndarray[2] passed on the last functor call. The total length of a one dimensional type will be equal to the area of the SpanSet, and therefore the data-type must be at least that length. The order of the parameters supplied to the functor will be the same order as they are passed to the applyFunctor method.
...Args | Variadic type specification |
func | Functor that is to be applied on each of the values taken from ...args. |
...args | Variadic arguments, may be of type Image, MaskedImage, ndarrays, numeric values and iterators. ndarrays must be specified as either image or vector with the ndarray::ndImage or ndarray::ndFlat functions |
Definition at line 512 of file SpanSet.h.
|
inline |
|
inline |
|
inline |
|
inline |
void lsst::afw::geom::SpanSet::clearMask | ( | lsst::afw::image::Mask< T > & | target, |
T | bitmask | ||
) | const |
Unset a Mask at pixels defined by the SpanSet.
T | data-type of a pixel in the Mask plane |
[in,out] | target | Mask in which a bit pattern will be unset |
[in] | bitmask | The bit pattern to clear in the mask |
Definition at line 938 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::clippedTo | ( | lsst::geom::Box2I const & | box | ) | const |
Return a new SpanSet which has all pixel values inside specified box.
box | Integer box specifying the bounds for which all pixels must be within |
Definition at line 439 of file SpanSet.cc.
lsst::geom::Point2D lsst::afw::geom::SpanSet::computeCentroid | ( | ) | const |
Compute the point about which the SpanSet's first moment is zero.
Definition at line 502 of file SpanSet.cc.
ellipses::Quadrupole lsst::afw::geom::SpanSet::computeShape | ( | ) | const |
Compute the shape parameters for the distribution of points in the SpanSet.
Definition at line 521 of file SpanSet.cc.
bool lsst::afw::geom::SpanSet::contains | ( | lsst::geom::Point2I const & | point | ) | const |
Check if a point is contained within the SpanSet instance.
point | An integer point object for which membership is to be tested |
Definition at line 492 of file SpanSet.cc.
bool lsst::afw::geom::SpanSet::contains | ( | SpanSet const & | other | ) | const |
Check if a SpanSet instance entirely contains another SpanSet.
other | The SpanSet who's membership is to be tested for |
Definition at line 466 of file SpanSet.cc.
|
inline |
Copy contents of source Image into destination image at the positions defined in the SpanSet.
ImageT | The pixel type of the Image |
[in] | src | The Image that pixel values will be taken from |
[out] | dest | The Image where pixels will be copied |
Definition at line 416 of file SpanSet.h.
|
inline |
Copy contents of source MaskedImage into destination image at the positions defined in the SpanSet.
ImageT | The pixel type of the MaskedImage's Image |
MaskT | The pixel type of the MaskedImage's Mask |
VarT | The Pixel type of the MaskedImage's Variance Image |
[in] | src | The MaskedImage that pixel values will be taken from |
[out] | dest | The MaskedImage where pixels will be copied |
Definition at line 433 of file SpanSet.h.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::dilated | ( | int | r, |
Stencil | s = Stencil::CIRCLE |
||
) | const |
Perform a set dilation operation, and return a new object.
Dilate a SpanSet with a kernel specified with the stencil parameter
r | radius of the stencil, the length is inclusive i.e. 3 ranges from -3 to 3 |
s | must be an enumeration of type geom::Stencil. Specifies the shape of the dilation kernel. May be CIRCLE, MANHATTAN, or BOX |
Definition at line 544 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::dilated | ( | SpanSet const & | other | ) | const |
Perform a set dilation operation, and return a new object.
Dilate a SpanSet with a kernel specified by another SpanSet
other | A SpanSet which specifies the kernel to use for dilation |
Definition at line 551 of file SpanSet.cc.
|
staticinherited |
Dynamically cast a shared_ptr.
Dynamically cast a shared pointer and raise on failure.
You must provide an explicit template instantiation in the .cc file for each class that inherits from PersistableFacade. Designed to work around RTTI issues on macOS with hidden symbols;
lsst::pex::exceptions::LogicError | if the cast fails |
param[in] ptr The pointer to be cast.
lsst::pex::exceptions::TypeError | If the dynamic cast fails. |
Definition at line 218 of file Persistable.cc.
|
inline |
|
inline |
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::eroded | ( | int | r, |
Stencil | s = Stencil::CIRCLE |
||
) | const |
Perform a set erosion, and return a new object.
Erode a SpanSet with a kernel specified with the stencil parameter
r | radius of the stencil, the length is inclusive i.e. 3 ranges from -3 to 3 |
s | must be an enumeration of type geom::Stencil. Specifies the shape of the erosion kernel. May be CIRCLE, MANHATTAN, or BOX |
Definition at line 572 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::eroded | ( | SpanSet const & | other | ) | const |
Perform a set erosion operation, and return a new object.
Erode a SpanSet with a kernel specified by another SpanSet
other | A SpanSet which specifies the kernel to use for erosion |
Definition at line 579 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::findEdgePixels | ( | ) | const |
Select pixels within the SpanSet which touch its edge.
Definition at line 411 of file SpanSet.cc.
|
inline |
Reduce the pixel dimensionality from 2 to 1 of an array at points given by SpanSet.
Take values from an array at points defined by SpanSet and use them to populate a new array where the x,y coordinates of the SpanSet have been flattened to one dimension. First two dimensions of the input array must be the h,w which correspond to the SpanSet coordinates. Any number of remaining dimensions is permissible.
Pixel | The datatype for the ndarray |
inN | The number of dimensions in the array object |
inC | Number of guaranteed row-major contiguous dimensions, starting from the end |
input | The ndarray from which the values will be taken |
xy0 | A point object with is used as the origin point for the SpanSet coordinate system |
Definition at line 303 of file SpanSet.h.
|
inline |
Reduce the pixel dimensionality from 2 to 1 of an array at points given by SpanSet.
Take values from an array at points defined by SpanSet and use them to populate a new array where the x,y coordinates of the SpanSet have been flattened to one dimension. First two dimensions of the input array must be the h,w which correspond to the SpanSet coordinates. Any number of remaining dimensions is permissible.
PixelOut | The data-type for the output ndarray |
PixelIn | The data-type for the input ndarray |
inA | The number of dimensions in the input array |
outC | Number of guaranteed row-major contiguous dimensions in the output array, starting from the end |
inC | Number of guaranteed row-major contiguous dimensions in the input array, starting from the end |
[out] | output | The 1d ndarray which will be populated with output parameters, will happen in place |
[in] | input | The ndarray from which the values will be taken |
[in] | xy0 | A point object which is used as the origin point for the SpanSet coordinate system |
Definition at line 336 of file SpanSet.h.
|
inlinestatic |
|
inlinestatic |
Create a SpanSet from a mask.
Create a SpanSet from a class. The default behavior is to include any pixels which have any bits set. More complex selection/filtering of bit patterns can be done by supplying a comparator function.
T | Pixel type of the Mask |
F | Type of the functor |
mask | mask to convert to a SpanSet |
comparator | Functor object to use in the decision to include pixel in SpanSet. Should return true when a given pixel in the mask should be part of the SpanSet, and false otherwise. The functor takes a single value taken from the mask at the pixel under consideration. Defaults to evaluating true if the mask has bits set, and false otherwise. |
Definition at line 644 of file SpanSet.h.
|
static |
Factory function for creating SpanSets from an ellipse object.
ellipse | An ellipse defining the region to create a SpanSet from |
Definition at line 715 of file SpanSet.cc.
|
static |
Factory function for creating SpanSets from a Stencil.
r | radius of the stencil, the length is inclusive i.e. 3 ranges from -3 to 3 |
s | must be an enumeration of type geom::Stencil. Specifies the shape of the newly created SpanSet. May be CIRCLE, MANHATTAN, or BOX |
offset | This function usually creates a SpanSet centered about zero. This parameter is a point2I object which specifies an offset from zero to apply when creating the SpanSet. |
Definition at line 688 of file SpanSet.cc.
|
inline |
std::size_t lsst::afw::geom::SpanSet::getArea | ( | ) | const |
Return the number of pixels in the SpanSet.
Definition at line 283 of file SpanSet.cc.
lsst::geom::Box2I lsst::afw::geom::SpanSet::getBBox | ( | ) | const |
Return a new integer box which is the minimum size to contain the pixels.
Definition at line 286 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::intersect | ( | image::Mask< T > const & | other, |
T | bitmask | ||
) | const |
Determine the common points between a SpanSet and a Mask with a given bit pattern.
T | Pixel type of the Mask |
other | Mask with which to calculate intersection |
bitmask | The bit value to consider when intersecting |
Definition at line 949 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::intersect | ( | SpanSet const & | other | ) | const |
Determine the common points between two SpanSets, and create a new SpanSet.
other | The other SpanSet with which to intersect with |
Definition at line 720 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::intersectNot | ( | image::Mask< T > const & | other, |
T | bitmask | ||
) | const |
Determine the common points between a SpanSet and the logical inverse of a Mask for a given bit pattern.
other | Mask with which to calculate intersection |
bitmask | The bit value to consider when intersecting |
T | Pixel type of the Mask |
Definition at line 954 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::intersectNot | ( | SpanSet const & | other | ) | const |
Determine the common points between a SpanSet and the logical inverse of a second SpanSet and return them in a new SpanSet.
other | The spanset which will be logically inverted when computing the intersection |
Definition at line 745 of file SpanSet.cc.
bool lsst::afw::geom::SpanSet::isContiguous | ( | ) | const |
Defines if the SpanSet is simply contiguous.
If the pixels can be traversed in such a way that every pixel can be reached without going over a pixel not contained in the SpanSet this method will return true. If the SpanSet is disjoint aka the above is not true and there is more than one region, returns false.
Definition at line 373 of file SpanSet.cc.
|
inlineoverridevirtualnoexcept |
Return true if this particular object can be persisted using afw::table::io.
Reimplemented from lsst::afw::table::io::Persistable.
bool lsst::afw::geom::SpanSet::operator!= | ( | SpanSet const & | other | ) | const |
Definition at line 683 of file SpanSet.cc.
bool lsst::afw::geom::SpanSet::operator== | ( | SpanSet const & | other | ) | const |
Compute equality between two SpanSets.
other | The SpanSet for which equality will be computed |
Definition at line 678 of file SpanSet.cc.
bool lsst::afw::geom::SpanSet::overlaps | ( | SpanSet const & | other | ) | const |
Specifies if this SpanSet overlaps with another SpanSet.
other | A SpanSet for which overlapping comparison will be made |
Definition at line 454 of file SpanSet.cc.
|
inlinestaticinherited |
Read an object from an already open FITS object.
[in] | fitsfile | FITS object to read from, already positioned at the desired HDU. |
Definition at line 183 of file Persistable.h.
|
inlinestaticinherited |
Read an object from a FITS file in memory.
[in] | manager | Manager for the memory to read from. |
[in] | hdu | HDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty. |
Definition at line 205 of file Persistable.h.
|
inlinestaticinherited |
Read an object from a regular FITS file.
[in] | fileName | Name of the file to read. |
[in] | hdu | HDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty. |
Definition at line 194 of file Persistable.h.
template void lsst::afw::geom::SpanSet::setImage< double > | ( | image::Image< ImageT > & | image, |
ImageT | val, | ||
lsst::geom::Box2I const & | region = lsst::geom::Box2I() , |
||
bool | doClip = false |
||
) | const |
Set the values of an Image at points defined by the SpanSet.
ImageT | The pixel type of the Image to be set |
[out] | image | The Image in which pixels will be set |
[in] | val | The value to set |
[in] | region | A bounding box limiting the scope of the SpanSet, points defined in the SpanSet which fall outside this box will be ignored if the doClip parameter is set to true, defaults to the bounding box of the image |
[in] | doClip | Limit the copy operation to pixels in the SpanSet that lie within the region parameter defaults to false |
Definition at line 904 of file SpanSet.cc.
void lsst::afw::geom::SpanSet::setMask | ( | lsst::afw::image::Mask< T > & | target, |
T | bitmask | ||
) | const |
Set a Mask at pixels defined by the SpanSet.
T | data-type of a pixel in the Mask plane |
[in,out] | target | Mask in which values will be set |
[in] | bitmask | The bit pattern to set in the mask |
Definition at line 927 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::shiftedBy | ( | int | x, |
int | y | ||
) | const |
Return a new SpanSet shifted by specified amount.
x | number of pixels to shift in x dimension |
y | number of pixels to shift in y dimension |
Definition at line 419 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::shiftedBy | ( | lsst::geom::Extent2I const & | offset | ) | const |
Return a new SpanSet shifted by specified amount.
offset | integer extent which specifies amount to offset in x and y |
Definition at line 424 of file SpanSet.cc.
|
inline |
std::vector< std::shared_ptr< SpanSet > > lsst::afw::geom::SpanSet::split | ( | ) | const |
Split a discontinuous SpanSet into multiple SpanSets which are contiguous.
Definition at line 382 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::transformedBy | ( | lsst::geom::AffineTransform const & | t | ) | const |
Return a new SpanSet who's pixels are the product of applying the specified transformation.
t | An affine transform object which will be used to map the pixels |
Definition at line 845 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::transformedBy | ( | lsst::geom::LinearTransform const & | t | ) | const |
Return a new SpanSet who's pixels are the product of applying the specified transformation.
t | A linear transform object which will be used to map the pixels |
Definition at line 840 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::transformedBy | ( | TransformPoint2ToPoint2 const & | t | ) | const |
Return a new SpanSet who's pixels are the product of applying the specified transformation.
t | A 2-D transform which will be used to map the pixels |
Definition at line 850 of file SpanSet.cc.
|
inline |
Expand an array by one spatial dimension at points given by SpanSet.
Take values from a lower dimensional array and insert them in an output array with one additional dimension at points defined by the SpanSet, offset by the lower left hand corner of the bounding box of the SpanSet. The first two dimensions of the output array will correspond to the y,x dimensions of the SpanSet
Pixel | The data-type for the ndarray |
inA | Number of dimension of the input array |
inC | Number of guaranteed row-major contiguous dimensions, starting from the end |
input | The ndarray from which the values will be taken |
Definition at line 360 of file SpanSet.h.
|
inline |
Expand an array by one spatial dimension at points given by SpanSet.
Take values from a lower dimensional array and insert them in an output array with one additional dimension at points defined by the SpanSet, offset by the lower left hand corner of the bounding box of the SpanSet. The first two dimensions of the output array will correspond to the y,x dimensions of the SpanSet
PixelOut | The datatype for the output ndarray |
PixelIn | The datatype for the input ndarray |
inA | Number of dimensions of the input ndarray |
outC | Number of guaranteed row-major contiguous dimensions in the output array, starting from the end |
inC | Number of guaranteed row-major contiguous dimensions in the input array, starting from the end |
[out] | output | The 1d ndarray which will be populated with output parameters, will happen in place |
[in] | input | The ndarray from which the values will be taken |
[in] | xy0 | A point object with is used as the origin point for the SpanSet coordinate system |
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::union_ | ( | image::Mask< T > const & | other, |
T | bitmask | ||
) | const |
Determine the union between a SpanSet and a Mask for a given bit pattern.
T | Pixel type of the Mask |
other | Mask with which to calculate intersection |
bitmask | The bit value to consider when intersecting |
Definition at line 959 of file SpanSet.cc.
std::shared_ptr< SpanSet > lsst::afw::geom::SpanSet::union_ | ( | SpanSet const & | other | ) | const |
Create a new SpanSet that contains all points from two SpanSets.
other | The SpanSet from which the union will be calculated |
Definition at line 826 of file SpanSet.cc.
|
inherited |
Write the object to an already-open FITS object.
[in] | fitsfile | Open FITS object to write to. |
Definition at line 18 of file Persistable.cc.
|
inherited |
Write the object to a FITS image in memory.
[in] | manager | Name of the file to write to. |
[in] | mode | If "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file. |
Definition at line 29 of file Persistable.cc.
|
inherited |
Write the object to a regular FITS file.
[in] | fileName | Name of the file to write to. |
[in] | mode | If "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file. |
Definition at line 24 of file Persistable.cc.