In vivo measurement of the redox state