20 double xup,
double yup)
27 double xup,
double yup)
32 "Data is not two-dimensional.");
38 : m_rectangle(new
Rectangle(xlow, ylow, xup, yup)), m_ax1(0), m_ay1(0), m_ax2(0), m_ay2(0),
51 :
ICloneable(), m_rectangle(other.m_rectangle->clone()), m_ax1(other.m_ax1), m_ay1(other.m_ay1),
52 m_ax2(other.m_ax2), m_ay2(other.m_ay2), m_glob_index0(other.m_glob_index0),
53 m_detector_dims(other.m_detector_dims), m_roi_dims(other.m_roi_dims)
86 if (ny < m_ay1 || ny >
m_ay2)
90 if (nx < m_ax1 || nx >
m_ax2)
109 if (ny < m_ay1 || ny >
m_ay2)
112 if (nx < m_ax1 || nx >
m_ax2)
119 size_t nbin1 = (axis_index == 0 ?
m_ax1 :
m_ay1);
120 size_t nbin2 = (axis_index == 0 ?
m_ax2 :
m_ay2);
Defines interface IDetector2D.
Defines class RegionOfInterest.
Axis with fixed bin size.
Interface for one-dimensional axes.
virtual size_t findClosestIndex(double value) const =0
find bin index which is best match for given value
virtual Bin1D getBin(size_t index) const =0
retrieve a 1d bin for the given index
virtual size_t size() const =0
retrieve the number of bins
std::string getName() const
retrieve the label of the axis
Interface for polymorphic classes that should not be copied, except by explicit cloning.
Abstract 2D detector interface.
const IAxis & getAxis(size_t index) const
size_t getRank() const
Returns number of dimensions.
const IAxis & getAxis(size_t serial_number) const
returns axis with given serial number
The rectangle shape having its axis aligned to the (non-rotated) coordinate system.
Defines rectangular area for the detector which will be simulated/fitted.
size_t detectorSize() const
Number of detector bins.
bool isInROI(size_t detectorIndex) const
std::unique_ptr< IAxis > clipAxisToRoi(size_t axis_index, const IAxis &axis) const
size_t xcoord(size_t index, const std::vector< size_t > &dims) const
size_t detectorIndex(size_t roiIndex) const
Converts roi index to the detector index.
void initFrom(const IAxis &x_axis, const IAxis &y_axis)
size_t m_ax1
Number of bins on detector axes corresponding to roi-rectangle.
size_t ycoord(size_t index, const std::vector< size_t > &dims) const
std::vector< size_t > m_detector_dims
size_t roiSize() const
Number of detector bins in ROI area.
std::vector< size_t > m_roi_dims
size_t roiIndex(size_t detectorIndex) const
Converts global detector index to ROI index.
RegionOfInterest * clone() const
std::unique_ptr< Rectangle > m_rectangle
size_t m_glob_index0
Detector global index corresponding to the lower left corner of ROI.
RegionOfInterest(const IDetector2D &detector, double xlow, double ylow, double xup, double yup)
double m_upper
upper bound of the bin
double m_lower
lower bound of the bin