Every dense map that needs geometry now evaluates each image pixel at its place on the detector plane (DetectorModules), so it is right for a stacked panel layout and picks up refined module placements: - AzimuthalIntegrationMapping: bins, resolution, solid-angle/polarisation corrections built per pixel through the table; a pixel on no panel is left as a masked one. The geometry cache key now includes the panel table, so a mapping built after the stills module placement is rebuilt rather than served from the cache. ResolutionMaskBits follows (it is a lookup). - ROIMap / ExportROIMap: azimuthal ROIs on the plane (box and circle ROIs stay in image pixels). - ROIIntegration CPU+GPU: the weighted sums are taken per ROI and panel in image pixels and placed on the plane at the end (exact; the affine commutes with a weighted mean). - HotPixelFinder: ring/sector keys and the zeta of the persistence rule on the plane. - Background beam-centre walk CPU+GPU: pixels binned at their plane position; host and device share BackgroundPlanePoint so they stay bit-identical. New common/PanelRows.h: ForEachPixelInRows, ForEachPixel cut to a band of rows in index order, for the row-parallel builders. An empty table takes the old arithmetic in the old order: rotation sets and every single-panel input are unchanged. [PanelLayout] AzintMapping and ResolutionMask enabled (+ azimuthal ROI map and ROI centroid on the plane); new BeamCenterFromBackground_BinsOnThePlane and ROIIntegrationGPU_MatchesCPU_Panels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu
32 lines
1.1 KiB
C++
32 lines
1.1 KiB
C++
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <map>
|
|
#include <vector>
|
|
#include <cstdint>
|
|
#include <optional>
|
|
|
|
#include "DetectorSetup.h"
|
|
#include "ROIDefinition.h"
|
|
#include "DiffractionGeometry.h"
|
|
#include "DetectorModules.h"
|
|
|
|
class ROIMap {
|
|
ROIDefinition rois;
|
|
|
|
static constexpr const size_t roi_limit = 16;
|
|
public:
|
|
void SetROI(const ROIDefinition& input);
|
|
// Box and circle ROIs are drawn in image pixels; azimuthal ROIs at each pixel's place on the plane
|
|
// (`modules`, empty when that is where the image has it).
|
|
[[nodiscard]] std::vector<uint16_t> GetROIMap(const DiffractionGeometry &geom, const DetectorModules &modules,
|
|
size_t width, size_t height) const;
|
|
[[nodiscard]] std::map<std::string, uint16_t> GetROINameMap() const;
|
|
[[nodiscard]] const ROIDefinition& GetROIDefinition() const;
|
|
[[nodiscard]] bool empty() const;
|
|
[[nodiscard]] size_t size() const;
|
|
[[nodiscard]] std::vector<ROIConfig> ExportMetadata() const;
|
|
};
|