Dev/multiple rois in aare (#263)
Build on RHEL8 / build (push) Successful in 2m23s
Build on RHEL9 / build (push) Successful in 2m32s
Run tests using data on local RHEL8 / build (push) Failing after 3m14s

Reading multiple ROI's for aare 

- read_frame, read_n etc throws for multiple ROIs
- new functions read_ROIs, read_n_ROIs 
-  read_roi_into (used for python bindings - to not copy) 

all these functions use get_frame or get_frame_into where one passes the
roi_index
## Refactoring:
- each roi keeps track of its subfiles that one has to open e.g.
subfiles can be opened several times
- refactored class DetectorGeometry - keep track of the updated module
geometries in new class ROIGeometry.
- ModuleGeometry updates based on ROI

## ROIGeometry: 
- stores number of modules overlapping with ROI and its indices
- size of ROI 

Note: only tested size of the resulting frames not the actual values

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
This commit is contained in:
2026-02-18 10:57:56 +01:00
committed by GitHub
parent 7f64b9a616
commit 218f31ce60
17 changed files with 1242 additions and 421 deletions
+18 -1
View File
@@ -84,4 +84,21 @@ struct fmt_format_trait<Cluster<T, ClusterSizeX, ClusterSizeY, CoordType>> {
};
template <typename ClusterType>
auto fmt_format = fmt_format_trait<ClusterType>::value();
auto fmt_format = fmt_format_trait<ClusterType>::value();
/**
* Helper function to allocate image data given item size and shape
* used when we want to fill a numpy array and return to python
*/
py::array allocate_image_data(size_t item_size,
const std::vector<size_t> &shape) {
py::array image_data;
if (item_size == 1) {
image_data = py::array_t<uint8_t>(shape);
} else if (item_size == 2) {
image_data = py::array_t<uint16_t>(shape);
} else if (item_size == 4) {
image_data = py::array_t<uint32_t>(shape);
}
return image_data;
}