mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-02-19 16:48:42 +01:00
fixed python bindings - only read headers of modules that are in the roi
This commit is contained in:
@@ -62,7 +62,7 @@ void RawFile::read_into(std::byte *image_buf, size_t n_frames,
|
||||
this->get_frame_into(m_current_frame++, image_buf, header);
|
||||
image_buf += bytes_per_frame();
|
||||
if (header)
|
||||
header += m_geometry.n_modules();
|
||||
header += m_geometry.n_modules_in_roi();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,6 +98,9 @@ size_t RawFile::bitdepth() const { return m_master.bitdepth(); }
|
||||
xy RawFile::geometry() { return m_master.geometry(); }
|
||||
|
||||
size_t RawFile::n_modules() const { return m_geometry.n_modules(); };
|
||||
size_t RawFile::n_modules_in_roi() const {
|
||||
return m_geometry.n_modules_in_roi();
|
||||
};
|
||||
|
||||
void RawFile::open_subfiles() {
|
||||
if (m_mode == "r")
|
||||
|
||||
@@ -257,12 +257,21 @@ TEST_CASE_PRIVATE(aare, open_multi_module_file_with_roi,
|
||||
|
||||
RawFile f(fpath, "r");
|
||||
|
||||
REQUIRE(f.master().roi().value().width() == 256);
|
||||
REQUIRE(f.master().roi().value().height() == 256);
|
||||
SECTION("read 2 frames") {
|
||||
REQUIRE(f.master().roi().value().width() == 256);
|
||||
REQUIRE(f.master().roi().value().height() == 256);
|
||||
|
||||
CHECK(f.m_geometry.n_modules() == 2);
|
||||
CHECK(f.m_geometry.n_modules() == 2);
|
||||
|
||||
CHECK(f.m_geometry.n_modules_in_roi() == 1);
|
||||
CHECK(f.m_geometry.n_modules_in_roi() == 1);
|
||||
|
||||
auto frames = f.read_n(2);
|
||||
|
||||
CHECK(frames.size() == 2);
|
||||
|
||||
CHECK(frames[0].rows() == 256);
|
||||
CHECK(frames[1].cols() == 256);
|
||||
}
|
||||
}
|
||||
} // close namespace aare
|
||||
|
||||
|
||||
Reference in New Issue
Block a user