You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
508 B
31 lines
508 B
2 years ago
|
# Divergence measures rate of change of gradient.
|
||
|
package require vtk
|
||
|
|
||
|
|
||
|
# Image pipeline
|
||
|
|
||
|
vtkPNGReader reader
|
||
|
reader SetFileName "$VTK_DATA_ROOT/Data/fullhead15.png"
|
||
|
|
||
|
vtkImageGradient gradient
|
||
|
gradient SetDimensionality 2
|
||
|
gradient SetInputConnection [reader GetOutputPort]
|
||
|
|
||
|
vtkImageDivergence derivative
|
||
|
derivative SetInputConnection [gradient GetOutputPort]
|
||
|
|
||
|
vtkImageViewer viewer
|
||
|
viewer SetInputConnection [derivative GetOutputPort]
|
||
|
viewer SetColorWindow 1000
|
||
|
viewer SetColorLevel 0
|
||
|
|
||
|
|
||
|
viewer Render
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|