Skip to content
Snippets Groups Projects
Commit b0a411d6 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

IDetector::regionOfInterestIndexToDetectorIndex inline fcts x|ycoord

parent 97068762
No related branches found
No related tags found
1 merge request!1901IDetector cleanup
...@@ -23,21 +23,6 @@ ...@@ -23,21 +23,6 @@
#include "Device/Resolution/ConvolutionDetectorResolution.h" #include "Device/Resolution/ConvolutionDetectorResolution.h"
#include <iostream> #include <iostream>
namespace {
inline size_t xcoord(size_t i, size_t sizeX, size_t sizeY)
{
return i / sizeY % sizeX;
}
inline size_t ycoord(size_t i, size_t sizeY)
{
return i % sizeY;
}
} // namespace
//... Auxiliary class RoiOfAxis //... Auxiliary class RoiOfAxis
IDetector::RoiOfAxis::RoiOfAxis(const Scale& axis, double _lower, double _upper) IDetector::RoiOfAxis::RoiOfAxis(const Scale& axis, double _lower, double _upper)
...@@ -225,7 +210,9 @@ size_t IDetector::regionOfInterestIndexToDetectorIndex(const size_t i) const ...@@ -225,7 +210,9 @@ size_t IDetector::regionOfInterestIndexToDetectorIndex(const size_t i) const
const auto& y = m_explicitROI[1]; const auto& y = m_explicitROI[1];
const size_t globalIndex0 = y.lowerIndex + x.lowerIndex * y.detectorSize; const size_t globalIndex0 = y.lowerIndex + x.lowerIndex * y.detectorSize;
return globalIndex0 + ycoord(i, y.roiSize) + xcoord(i, x.roiSize, y.roiSize) * y.detectorSize; const size_t xcoord = i / y.roiSize % x.roiSize;
const size_t ycoord = i % y.roiSize;
return globalIndex0 + ycoord + xcoord * y.detectorSize;
} }
void IDetector::setRegionOfInterest(double xlow, double ylow, double xup, double yup) void IDetector::setRegionOfInterest(double xlow, double ylow, double xup, double yup)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment