rois test work on 1d as well

This commit is contained in:
2025-06-29 15:13:51 +02:00
parent 856ca1e558
commit 8e20d08af2
2 changed files with 23 additions and 9 deletions

View File

@@ -418,10 +418,13 @@ void Implementation::setPortROIs(const std::vector<defs::ROI> &args) {
if (it.completeRoi() || it.noRoi()) {
continue; // valid
}
if (it.xmin < 0 || it.ymin < 0 || it.xmax < 0 || it.ymax < 0 ||
it.xmin >= nx || it.xmax >= nx ||
it.ymin >= ny || it.ymax >= ny) {
throw RuntimeError("Invalid ROI coordinates: " + ToString(it));
if (it.xmin < 0 || it.xmax < 0 ||
it.xmin >= nx || it.xmax >= nx) {
throw RuntimeError("Invalid ROIvx coordinates: " + ToString(it));
}
if (ny > 1 && (it.ymin < 0 || it.ymax < 0 ||
it.ymin >= ny || it.ymax >= ny)) {
throw RuntimeError("Invalid ROI y coordinates: " + ToString(it));
}
}
portRois = args;