Processing math: 100%
VolumeRendering

Gradient Calculation

Lighting | | Gradient-Magnitude (GM)

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!


Lighting | | Gradient-Magnitude (GM)

Options: