Improve logic of limit_bounds
together with rois
#201
Merged
limit_bounds
together with rois
#201