16 #error no need to expose this header to Swig
20 #ifndef BORNAGAIN_DEVICE_DETECTOR_REGIONOFINTEREST_H
21 #define BORNAGAIN_DEVICE_DETECTOR_REGIONOFINTEREST_H
70 size_t xcoord(
size_t index,
const std::vector<size_t>& dims)
const;
71 size_t ycoord(
size_t index,
const std::vector<size_t>& dims)
const;
86 return index / dims[1] % dims[0];
91 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.
Templated class to store data of type double or CumulativeValue in multi-dimensional space.
A rectangle, for use in detector masks.
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)