Impurity-induced localization in cuprate superconductors