Refactored polyline selection to use ROI directly