Processing math: 100%
MedicalVisualization

Gradient Calculation

Iso Surface Shading | | Flat Vs Smooth Shading

Flat Shading vs Goruraud Shading → 1 normal per face vs. 3 normals per vertex:

Where do we get the original normal for our shaded iso surfaces?

Trick: for each of the 3 normals at the 3 vertices of each extracted triangle we use the gradient vector, which is perpendicular to the iso surface!

The gradient vector is computed on a discrete grid by finite differences method.

  • Gradient vector is written as so called Nabla Operator
  • Gradient = partial derivatives of the continuous scalar function f(x,y,z)
f=(dfdx,dfdy,dfdz)T
  • Discrete derivatives via finite differences method
    • forward differences method
      • df(x)dsf(x+Δs)f(x)Δs
    • backward differences method
      • df(x)dsf(x)f(xΔs)Δs
    • central differences methods has better smoothness
      • df(x)dsf(x+Δs)f(xΔs)2Δs

Normal n=f=(f(x+Δs,y,z)f(xΔs,y,z)2Δs,f(x,y+Δs,z)f(x,yΔs,z)2Δs,f(x,y,z+Δs)f(x,y,zΔs)2Δs)T

  • Discrete derivation via central differences on the voxel grid
    • df(x)dsf(i+1)f(i1)2
    • At the grid boundaries forward resp. backward differences.
  • Hint: even better smoothness than via central differences: Sobel Operator!


Iso Surface Shading | | Flat Vs Smooth Shading

Options: