Added functions for ROI definition