15 #ifndef BORNAGAIN_CORE_DETECTOR_REGIONOFINTEREST_H
16 #define BORNAGAIN_CORE_DETECTOR_REGIONOFINTEREST_H
41 double getXlow()
const;
42 double getYlow()
const;
43 double getXup()
const;
44 double getYup()
const;
60 std::unique_ptr<IAxis> clipAxisToRoi(
size_t axis_index,
const IAxis& axis)
const;
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;
69 void initFrom(
const IAxis& x_axis,
const IAxis& y_axis);
71 std::unique_ptr<Rectangle> m_rectangle;
73 size_t m_ax1, m_ay1, m_ax2, m_ay2;
76 std::vector<size_t> m_detector_dims;
77 std::vector<size_t> m_roi_dims;
80 inline size_t RegionOfInterest::xcoord(
size_t index,
const std::vector<size_t>& dims)
const
82 return index / dims[1] % dims[0];
85 inline size_t RegionOfInterest::ycoord(
size_t index,
const std::vector<size_t>& dims)
const
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.
size_t detectorIndex(size_t roiIndex) const
Converts roi index to the detector index.
size_t roiSize() const
Number of detector bins in ROI area.
size_t roiIndex(size_t detectorIndex) const
Converts global detector index to ROI index.