This might need to be updated to include a conditional involving the upper boundaries (in X and Y) of the FFIs. From what I understand, this is catching for cases where the lower limit of the cutout limits falls below 0 in either axis, but we don't have a conditional for when the upper limit goes beyond 2048 or whatever the FFI image size is:
|
if ((lims[0, 0] <= 0) and (lims[0, 1] <= 0)) or ((lims[1, 0] <= 0) and (lims[1, 1] <= 0)): |