29 #ifndef LSST_AFW_MATH_SPATIALCELL_H 30 #define LSST_AFW_MATH_SPATIALCELL_H 47 template <
typename ImagePixelT>
49 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
56 class SpatialCellCandidate;
77 : _id(++_CandidateId), _status(
UNKNOWN), _xCenter(xCenter), _yCenter(yCenter) {}
99 virtual double getCandidateRating()
const = 0;
108 void setStatus(
Status status);
110 virtual bool isBad()
const {
return (_status == BAD); }
115 float const _xCenter;
116 float const _yCenter;
119 static int _CandidateId;
140 static void setWidth(
int width) { _width = width; }
208 bool ignoreBad,
bool);
211 CandidateList::iterator _iterator;
212 CandidateList::iterator _end;
239 CandidateList
const& candidateList = CandidateList());
263 void sortCandidates();
335 bool const ignoreExceptions =
false,
bool const reset =
true);
350 bool const ignoreExceptions =
false,
bool const reset =
true)
const;
360 void visitAllCandidates(
CandidateVisitor* visitor,
bool const ignoreExceptions =
false,
361 bool const reset =
true);
374 void visitAllCandidates(
CandidateVisitor* visitor,
bool const ignoreExceptions =
false,
375 bool const reset =
true)
const;
380 CandidateList _candidateList;
428 void sortCandidates();
442 bool const ignoreExceptions =
false);
453 bool const ignoreExceptions =
false)
const;
462 void visitAllCandidates(
CandidateVisitor* visitor,
bool const ignoreExceptions =
false);
471 void visitAllCandidates(
CandidateVisitor* visitor,
bool const ignoreExceptions =
false)
const;
485 void setIgnoreBad(
bool ignoreBad);
SpatialCellCandidateIterator begin(bool ignoreBad)
static int getWidth()
Return the width of the image that getImage should return.
std::vector< std::shared_ptr< SpatialCellCandidate > > CandidateList
static void setHeight(int height)
Set the height of the image that getImage should return.
SpatialCellCandidateIterator end()
Return an iterator to (one after) the end of the Candidates.
std::shared_ptr< Image< PixelT > > operator*(Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
Overload operator*()
float getXCenter() const
Return the object's column-centre.
virtual bool isBad() const
Is this candidate unacceptable?
virtual ~CandidateVisitor()
virtual void processCandidate(SpatialCellCandidate *)
int getId() const
Return the candidate's unique ID.
double getChi2() const
Return the candidate's chi^2.
bool operator!=(SpatialCellCandidateIterator const &rhs) const
Are two SpatialCellCandidateIterators unequal?
Rotation angle is unknown.
bool operator==(SpatialCellCandidateIterator const &rhs) const
Are two SpatialCellCandidateIterators equal?
A collection of SpatialCells covering an entire image.
lsst::geom::Box2I const & getBBox() const
Get SpatialCell's BBox.
A base class for image defects.
SpatialCellImageCandidate(float const xCenter, float const yCenter)
ctor
Status getStatus() const
Return the candidate's status.
lsst::geom::Box2I getBBox() const
Return the bounding box of the image.
SpatialCellCandidateIterator iterator
virtual bool instantiate()
Do anything needed to make this candidate usable.
std::shared_ptr< Image< PixelT > > operator-(Image< PixelT > const &img, ImageSlice< PixelT > const &slc)
Overload operator-()
virtual void setCandidateRating(double)
Set the candidate's rating.
static void setWidth(int width)
Set the width of the image that getImage should return.
Base class for candidate objects in a SpatialCell that are able to return an Image of some sort (e...
float getYCenter() const
Return the object's row-centre.
std::vector< std::shared_ptr< SpatialCell > > CellList
Class to ensure constraints for spatial modeling.
bool getIgnoreBad() const
Get whether we are omitting BAD candidates from candidate list when traversing.
Base class for candidate objects in a SpatialCell.
void setIgnoreBad(bool ignoreBad)
Set whether we should omit BAD candidates from candidate list when traversing.
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects...
An integer coordinate rectangle.
SpatialCellCandidateIterator begin()
Return an iterator to the beginning of the Candidates.
An iterator that only returns usable members of the SpatialCell.
SpatialCellCandidateIterator end(bool ignoreBad)
void setChi2(double chi2)
Set the candidate's chi^2.
std::string const & getLabel() const
Get SpatialCell's label.
SpatialCellCandidate(float const xCenter, float const yCenter)
static int getHeight()
Return the height of the image that getImage should return.
CellList & getCellList()
Return our SpatialCells.