ROIBox: Handle trimming when x_min < 0 and x_max >= 0, but zero-box when x_max < 0

This commit is contained in:
2026-04-15 11:28:42 +02:00
parent 54d741611a
commit c3c917922e
+12 -2
View File
@@ -5,6 +5,7 @@
ROIBox::ROIBox(const std::string &in_name, int64_t in_x_min, int64_t in_x_max, int64_t in_y_min, int64_t in_y_max)
: ROIElement(in_name) {
if (in_x_max < in_x_min) {
x_min = in_x_max;
x_max = in_x_min;
@@ -21,10 +22,19 @@ ROIBox::ROIBox(const std::string &in_name, int64_t in_x_min, int64_t in_x_max, i
y_max = in_y_max;
}
if (x_min < 0)
if (x_max < 0) {
x_min = 0;
if (y_min < 0)
x_max = -1;
} else if (x_min < 0) {
x_min = 0;
}
if (y_max < 0) {
y_min = 0;
y_max = -1;
} else if (y_min < 0) {
y_min = 0;
}
}
int64_t ROIBox::GetXMin() const {