FreeMat

- Main Page
- Related Pages

vtkImageAnisotropicDiffusion2D

Section: Visualization Toolkit Imaging Classes

# Usage

vtkImageAnisotropicDiffusion2D diffuses a 2d image iteratively. The neighborhood of the diffusion is determined by the instance flags. If "Edges" is on the 4 edge connected voxels are included, and if "Corners" is on, the 4 corner connected voxels are included. "DiffusionFactor" determines how far a pixel value moves toward its neighbors, and is insensitive to the number of neighbors chosen. The diffusion is anisotropic because it only occurs when a gradient measure is below "GradientThreshold". Two gradient measures exist and are toggled by the "GradientMagnitudeThreshold" flag. When "GradientMagnitudeThreshold" is on, the magnitude of the gradient, computed by central differences, above "DiffusionThreshold" a voxel is not modified. The alternative measure examines each neighbor independently. The gradient between the voxel and the neighbor must be below the "DiffusionThreshold" for diffusion to occur with THAT neighbor.

To create an instance of class vtkImageAnisotropicDiffusion2D, simply invoke its constructor as follows

      obj = vtkImageAnisotropicDiffusion2D

# Methods

The class vtkImageAnisotropicDiffusion2D has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkImageAnisotropicDiffusion2D class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkImageAnisotropicDiffusion2D = obj.NewInstance ()`
- `vtkImageAnisotropicDiffusion2D = obj.SafeDownCast (vtkObject o)`
- `obj.SetNumberOfIterations (int num)` - This method sets the number of interations which also affects the input neighborhood needed to compute one output pixel. Each iterations requires an extra pixel layer on the neighborhood. This is only relavent when you are trying to stream or are requesting a sub extent of the "wholeExtent".
- `int = obj.GetNumberOfIterations ()` - Get the number of iterations.
- `obj.SetDiffusionThreshold (double )` - Set/Get the difference threshold that stops diffusion. when the difference between two pixel is greater than this threshold, the pixels are not diffused. This causes diffusion to avoid sharp edges. If the GradientMagnitudeThreshold is set, then gradient magnitude is used for comparison instead of pixel differences.
- `double = obj.GetDiffusionThreshold ()` - Set/Get the difference threshold that stops diffusion. when the difference between two pixel is greater than this threshold, the pixels are not diffused. This causes diffusion to avoid sharp edges. If the GradientMagnitudeThreshold is set, then gradient magnitude is used for comparison instead of pixel differences.
- `obj.SetDiffusionFactor (double )` - The diffusion factor specifies how much neighboring pixels effect each other. No diffusion occurs with a factor of 0, and a diffusion factor of 1 causes the pixel to become the average of all its neighbors.
- `double = obj.GetDiffusionFactor ()` - The diffusion factor specifies how much neighboring pixels effect each other. No diffusion occurs with a factor of 0, and a diffusion factor of 1 causes the pixel to become the average of all its neighbors.
- `obj.SetFaces (int )` - Choose neighbors to diffuse (6 faces, 12 edges, 8 corners).
- `int = obj.GetFaces ()` - Choose neighbors to diffuse (6 faces, 12 edges, 8 corners).
- `obj.FacesOn ()` - Choose neighbors to diffuse (6 faces, 12 edges, 8 corners).
- `obj.FacesOff ()` - Choose neighbors to diffuse (6 faces, 12 edges, 8 corners).
- `obj.SetEdges (int )` - Choose neighbors to diffuse (6 faces, 12 edges, 8 corners).
- `int = obj.GetEdges ()` - Choose neighbors to diffuse (6 faces, 12 edges, 8 corners).
- `obj.EdgesOn ()` - Choose neighbors to diffuse (6 faces, 12 edges, 8 corners).
- `obj.EdgesOff ()` - Choose neighbors to diffuse (6 faces, 12 edges, 8 corners).
- `obj.SetCorners (int )` - Choose neighbors to diffuse (6 faces, 12 edges, 8 corners).
- `int = obj.GetCorners ()` - Choose neighbors to diffuse (6 faces, 12 edges, 8 corners).
- `obj.CornersOn ()` - Choose neighbors to diffuse (6 faces, 12 edges, 8 corners).
- `obj.CornersOff ()` - Choose neighbors to diffuse (6 faces, 12 edges, 8 corners).
- `obj.SetGradientMagnitudeThreshold (int )` - Switch between gradient magnitude threshold and pixel gradient threshold.
- `int = obj.GetGradientMagnitudeThreshold ()` - Switch between gradient magnitude threshold and pixel gradient threshold.
- `obj.GradientMagnitudeThresholdOn ()` - Switch between gradient magnitude threshold and pixel gradient threshold.
- `obj.GradientMagnitudeThresholdOff ()` - Switch between gradient magnitude threshold and pixel gradient threshold.