First define a Black-Scholes process with constant parameters.
You can compute the expected payoff of a European call option with strike 100 maturing in 1 year.
You can then compare the result to the theoretical price.
This is incorporating local volatility term structure.
Again, you can compute the expected payoff of a European call option with strike 100 maturing in 1 year.
Then you can compute the implied volatility.
In this example we implied volatility surface obtained using a piecewise interpolation of known prices.