15 #ifndef BORNAGAIN_CORE_DETECTOR_REGIONOFINTEREST_H
16 #define BORNAGAIN_CORE_DETECTOR_REGIONOFINTEREST_H
66 size_t xcoord(
size_t index,
const std::vector<size_t>& dims)
const;
67 size_t ycoord(
size_t index,
const std::vector<size_t>& dims)
const;
82 return index / dims[1] % dims[0];
87 return index % dims[1];
Defines and implements the standard mix-in ICloneable.
Interface for one-dimensional axes.
Interface for polymorphic classes that should not be copied, except by explicit cloning.
Abstract 2D detector interface.
Template class to store data of any type in multi-dimensional space.
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 & operator=(const RegionOfInterest &other)=delete
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)