implement pyregion-based region extraction