Correlation between the magnetic imaging of cobalt nanoconstrictions and their magnetoresistance response