Revise patch extraction to preserve spatial relationships