starting work on ROI

This commit is contained in:
froejdh_e
2024-11-07 16:24:48 +01:00
parent d5fb823ae4
commit b172c7aa0a
8 changed files with 145 additions and 71 deletions

View File

@@ -143,6 +143,8 @@ ScanParameters RawMasterFile::scan_parameters() const {
return m_scan_parameters;
}
std::optional<ROI> RawMasterFile::roi() const { return m_roi; }
void RawMasterFile::parse_json(const std::filesystem::path &fpath) {
std::ifstream ifs(fpath);
json j;
@@ -240,6 +242,33 @@ void RawMasterFile::parse_json(const std::filesystem::path &fpath) {
// not a scan
}
try{
ROI tmp_roi;
auto obj = j.at("Receiver Roi");
fmt::print("Receiver ROI: {}\n", obj.dump());
tmp_roi.xmin = obj.at("xmin");
tmp_roi.xmax = obj.at("xmax");
tmp_roi.ymin = obj.at("ymin");
tmp_roi.ymax = obj.at("ymax");
//if any of the values are set update the roi
if (tmp_roi.xmin != 4294967295 || tmp_roi.xmax != 4294967295 ||
tmp_roi.ymin != 4294967295 || tmp_roi.ymax != 4294967295) {
m_roi = tmp_roi;
}
}catch (const json::out_of_range &e) {
// leave the optional empty
}
//if we have an roi we need to update the geometry for the subfiles
if (m_roi){
}
// Update detector type for Moench
// TODO! How does this work with old .raw master files?
#ifdef AARE_VERBOSE