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

shorter fct name regionOfInterestIndexToDetectorIndex -> roiToFullIndex

parent 0735fbc1
No related branches found
No related tags found
1 merge request!2044replace SimulationAreaIterator by plain loops
......@@ -204,7 +204,7 @@ void IDetector::iterateOverNonMaskedPoints(std::function<void(const_iterator)> f
func(it);
}
size_t IDetector::regionOfInterestIndexToDetectorIndex(const size_t i) const
size_t IDetector::roiToFullIndex(const size_t i) const
{
if (m_explicitROI.size() != 2)
return i;
......
......@@ -129,7 +129,7 @@ public:
//! Convert an index of the region of interest to an index of the detector.
//! If no region of interest is set, then the index stays unmodified (since ROI == detector
//! area).
size_t regionOfInterestIndexToDetectorIndex(size_t i) const;
size_t roiToFullIndex(size_t i) const;
//! The lower and upper bound of the region of interest. If no region of interest is explicitly
//! defined, then the whole detector is taken as "region of interest".
......
......@@ -44,7 +44,7 @@ size_t SimulationAreaIterator::roiIndex() const
size_t SimulationAreaIterator::detectorIndex() const
{
return m_detector->regionOfInterestIndexToDetectorIndex(m_index);
return m_detector->roiToFullIndex(m_index);
}
SimulationAreaIterator& SimulationAreaIterator::operator++()
......@@ -73,7 +73,7 @@ size_t SimulationAreaIterator::nextIndex(size_t currentIndex)
bool SimulationAreaIterator::isMasked(size_t index) const
{
const auto* masks = m_detector->detectorMask();
const auto detectorIndex = m_detector->regionOfInterestIndexToDetectorIndex(index);
const auto detectorIndex = m_detector->roiToFullIndex(index);
return masks && masks->isMasked(detectorIndex, m_detector->frame());
}
......
......@@ -24,10 +24,10 @@ TEST(RegionOfInterestTest, constructor)
EXPECT_EQ(detector.sizeOfRegionOfInterest(), 10u);
// converting local roi index to global detector index
EXPECT_EQ(detector.regionOfInterestIndexToDetectorIndex(0), 9);
EXPECT_EQ(detector.regionOfInterestIndexToDetectorIndex(4), 13);
EXPECT_EQ(detector.regionOfInterestIndexToDetectorIndex(5), 17);
EXPECT_EQ(detector.regionOfInterestIndexToDetectorIndex(9), 21);
EXPECT_EQ(detector.roiToFullIndex(0), 9);
EXPECT_EQ(detector.roiToFullIndex(4), 13);
EXPECT_EQ(detector.roiToFullIndex(5), 17);
EXPECT_EQ(detector.roiToFullIndex(9), 21);
}
//! Testing region of interest which is larger than the detector.
......@@ -46,10 +46,10 @@ TEST(RegionOfInterestTest, largeArea)
EXPECT_EQ(detector.sizeOfRegionOfInterest(), 32u);
// converting local roi index to global detector index
EXPECT_EQ(detector.regionOfInterestIndexToDetectorIndex(5), 5u);
EXPECT_EQ(detector.regionOfInterestIndexToDetectorIndex(6), 6u);
EXPECT_EQ(detector.regionOfInterestIndexToDetectorIndex(9), 9u);
EXPECT_EQ(detector.regionOfInterestIndexToDetectorIndex(27), 27u);
EXPECT_EQ(detector.roiToFullIndex(5), 5u);
EXPECT_EQ(detector.roiToFullIndex(6), 6u);
EXPECT_EQ(detector.roiToFullIndex(9), 9u);
EXPECT_EQ(detector.roiToFullIndex(27), 27u);
}
//! Testing clone
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment