mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-02-19 22:38:43 +01:00
starting work on ROI
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user