Correlating structural and resistive changes in Ti:NiO resistive memory elements