Dirac index classes and the noncommutative spectral flow