From c5ccd44a4c7f380cee0b595f318fd41d90e3d587 Mon Sep 17 00:00:00 2001 From: vhinger Date: Tue, 21 Jul 2026 16:04:41 +0200 Subject: [PATCH] Refactoring suggestion for remap result (better doc) --- include/aare/RemapDefs.hpp | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/include/aare/RemapDefs.hpp b/include/aare/RemapDefs.hpp index cac073b0..086ffcdf 100644 --- a/include/aare/RemapDefs.hpp +++ b/include/aare/RemapDefs.hpp @@ -133,19 +133,42 @@ struct SensorModulePlacement { /** * @brief Result of remapping one strixel group onto the pixel grid. * - * The order map associates each output strixel position with a flattened - * pixel index in the user-provided ROI. An entry of -1 indicates that the - * corresponding strixel position has no valid source pixel. + * The order map defines a local strixel-grid coordinate system. For each + * map position (row, col), map(row, col) contains the flattened pixel index + * of the corresponding source pixel in the user-provided input ROI. + * + * For a valid entry: + * + * map(row, col) = dy * roi_user.width() + dx + * + * where (dx, dy) is the pixel position in the coordinate system of the + * original user-provided ROI. + * + * NOTE: The map coordinates (row, col) are local to this strixel group and are + * geometrically associated with effective_roi. The stored pixel index, + * however, is flattened with respect to the original user-provided ROI, + * not effective_roi. (I.e.: The map provides a local strixel grid mapped to the + * correct corresponding pixel indices in the original user grid, and + * effective_roi is the ROI the algorithm used for remapping.) + * + * An entry of -1 indicates that the corresponding strixel position has no + * valid source pixel. */ struct StrixelGroupToPixelMap { /// Strixel-to-pixel order map. + /// + /// The indices (row, col) define the local coordinate system of the + /// strixel group. Each value is a flattened index into the original + /// user-provided ROI. NDArray map; /** * @brief Effective pixel ROI covered by this map. * - * This is the intersection of the transformed group ROI with the - * user-provided ROI, after applying the bond shift and sensor rotation. + * This is the transformed group ROI after applying the bond shift and + * sensor rotation and intersecting it with the user-provided ROI. + * + * The local coordinate system of `map` is aligned with this ROI. */ InclusiveROI effective_roi; };