More ROI issues
The checkRoi() function uses parameters PRM_WIDTH, PRM_HEIGHT min, max values as if they were general detector width and height. It also uses PRM_OFFSET_xxx min and max values to determine the actual ROI supported by hardware. But all those parameters relate with the "current roi and binning settings" and hence the logic to decide roi settings is wrong and it results in a variety of errors and side effects.
Also the function getMaxImageSize() should be reconsidered for the same reason.