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) {}
94 virtual double getCandidateRating()
const = 0;
103 void setStatus(
Status status);
105 virtual bool isBad()
const {
return (_status == BAD); }
110 float const _xCenter;
111 float const _yCenter;
114 static int _CandidateId;
131 static void setWidth(
int width) { _width = width; }
199 bool ignoreBad,
bool);
202 CandidateList::iterator _iterator;
203 CandidateList::iterator _end;
230 CandidateList
const& candidateList = CandidateList());
249 void sortCandidates();
321 bool const ignoreExceptions =
false,
bool const reset =
true);
336 bool const ignoreExceptions =
false,
bool const reset =
true)
const;
346 void visitAllCandidates(
CandidateVisitor* visitor,
bool const ignoreExceptions =
false,
347 bool const reset =
true);
360 void visitAllCandidates(
CandidateVisitor* visitor,
bool const ignoreExceptions =
false,
361 bool const reset =
true)
const;
366 CandidateList _candidateList;
409 void sortCandidates();
423 bool const ignoreExceptions =
false);
434 bool const ignoreExceptions =
false)
const;
443 void visitAllCandidates(
CandidateVisitor* visitor,
bool const ignoreExceptions =
false);
452 void visitAllCandidates(
CandidateVisitor* visitor,
bool const ignoreExceptions =
false)
const;
466 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
lsst::afw::geom::Box2I getBBox() const
Return the bounding box of the image.
virtual ~SpatialCellCandidate()
(virtual) destructor – this is a base class you know
lsst::afw::geom::Box2I const & getBBox() const
Get SpatialCell's BBox.
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.
virtual ~SpatialCell()
Destructor.
bool operator!=(SpatialCellCandidateIterator const &rhs) const
Are two SpatialCellCandidateIterators unequal?
Rotation angle is unknown.
An integer coordinate rectangle.
bool operator==(SpatialCellCandidateIterator const &rhs) const
Are two SpatialCellCandidateIterators equal?
A collection of SpatialCells covering an entire image.
A base class for image defects.
SpatialCellImageCandidate(float const xCenter, float const yCenter)
ctor
virtual ~SpatialCellSet()
Destructor.
Status getStatus() const
Return the candidate's status.
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.
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)
virtual ~SpatialCellImageCandidate()
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.