// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #ifndef JFJOCHMULTIREADER_H #define JFJOCHMULTIREADER_H #include #include #include #include "JFJochReader.h" // Several stills collections read as one: the images of input 0, then those of input 1, and so on, so // image i of the whole is image i - FirstImage(k) of the input k it falls in. The inputs must be the // same detector at the same geometry - one wavelength, distance and beam centre for the whole run, as // stills geometry refinement refines one for all frames - and the constructor refuses them otherwise. // The dataset is the first input's, with the pixel masks of all inputs combined and the per-image // efficiency of each input placed at its images. class JFJochMultiReader : public JFJochReader { std::vector> inputs; std::vector first_image; // image 0 of input k is image first_image[k] of the whole uint64_t number_of_images = 0; // The input image_number falls in, and its number there. std::pair Locate(int64_t image_number) const; bool LoadImage_i(std::shared_ptr &dataset, DataMessage &message, std::vector &buffer, int64_t image_number, bool update_dataset) override; public: explicit JFJochMultiReader(std::vector> inputs); [[nodiscard]] uint64_t GetNumberOfImages() const override; void Close() override; bool ReadRawImage(int64_t image_number, JFJochReaderRawImage &image) override; std::vector ReadSpots(int64_t image) const override; [[nodiscard]] size_t GetNumberOfInputs() const; [[nodiscard]] int64_t FirstImage(size_t input) const; [[nodiscard]] uint64_t ImagesInInput(size_t input) const; }; #endif //JFJOCHMULTIREADER_H