The Basic Filters tool lets you apply several simple filters to your image. This can be very useful for data denoising; however, the real measured data will get altered in the process, so great care should be taken not to destroy important features of the image.
Moreover, there are more denoising functions in Gwyddion, for example DWT denoising and FFT filtering. For details see section Extended Data Edit.
If you need to only suppress some values in the SPM data that are obviously wrong, you can also try the Mask of Outliers module and the Remove Data Under Mask module. For details see section Data Edit.
→ →
Convolutions with arbitrary kernels up to 9 × 9 can be performed with the Convolution Filter module.
The Divisor entry represents a common factor all the coefficients are divided before applying the filter. This allows to use denormalized coefficients that are often nicer numbers. The normalization can be also calculated automatically when automatic is checked. When the sum of the coefficients is nonzero, it makes the filter sum-preserving, i.e. it the factor normalizes the sum of coefficients to unity. When the sum of the coefficients is zero, the automatic factor is simply let equal to 1.
Since many filters used in practice exhibit various types of symmetry, the coefficients can be automatically completed according to the selected symmetry type (odd, even). Note the completion is performed on pressing Enter in the coefficient entry.
In a fresh installation only a sample Identity filter is present (which is not particularly useful as it does nothing). This filter cannot be modified, to create a new filter use the New button on the Presets page.
→
Presentations are special filters that output their results into a separate layer that displays on top of the original data. Unlike the filters mentioned above, presentation filters preserve the measured data. This allows the user to safely apply various data visualizations. The other data processing modules and tools will still operate on the original data. To remove a presentation, just right click on the data window, and select .
The menu contains a few basic presentation operations:
→ →
Attaches other data (height or other physical quantity field) as a presentation to the actual data. Note that this useful option can be particularly confusing while evaluating anything from the data as all the computed values are evaluated from the data (not from the presentation, even if it looks like data).
→ →
Extracts presentation from the actual data window making copy of the presentation as a new channel in the same file. In this way one can get presentation data for further processing. Note however, the extracted data have no absolute scale information (the range is always [0, 1]) as presentation often help to visualize certain features, but the produced values are hard or impossible to assign any physical meaning to.
Figure 4.8. Presentation examples: (a) original data, (b) shading, (c) vertical Prewitt gradient, (d) Canny edge detection, (e) local non-linearity edge detection, (f) local contrast improvement.

→ →
Simple and very useful way of seeing data as illuminated from some direction. The direction can be set by user. It is also possible to mix the shaded and original images for presentational purposes (the resulting image is meaningless from the physical point of view).
→ →
Sobel horizontal and vertical gradient filter and Prewitt horizontal and vertical gradient filter create similar images as shading, however, they output data as a result of convolution of data with relatively standardized kernel. Thus, they can be used for further presentation processing for example. The kernels for horizontal filters are listed below, vertical kernels differ only by reflection about main diagonal.
→ →
One is often interested in the visualization of the discontinuities present in the image, particularly in discontinuities in the value (zeroth order) and discontinuities in the derivative (first order). Although the methods of location of both are commonly referred to as “edge detection” methods, these are actually quite different, therefore we will refer to the former as to step detection and to the latter as to edge detection. Methods for the detection of more specific features, e.g. corners, are commonly used too, these methods usually are of order zero.
The order of a discontinuity detection method can be easily seen on its output as edge detection methods produce typical double edge lines at value discontinuities as is illustrated in the following figure. While the positions of the upper and lower edge in an ideal step coincide, real-world data tend to actually contain two distinct edges as is illustrated in the picture. In addition, finding two edges on a value step, even an ideally sharp one, is often an inherent feature of edge detection methods.
The following step and edge detection functions are available in Gwyddion (the later ones are somewhat experimental, on they other hand they usually give better results than the well-known algorithms):
Canny edge detector is a well-known step detector can be used to extract the image of sharp value discontinuities in the data as thin single-pixel lines.
Laplacian presents a simple convolution with the following kernel (that is the limit of discrete Laplacian of Gaussians filter for σ → 0):
Zero crossing step detection marks lines where the result of Laplacian of Gaussians filter changes sign, i.e. crosses zero. The FWHM (full width half maximum) of the Gaussians determines the level of details covered. Threshold enables to exclude sign changes with too small absolute value of the neighbour pixels, filtering out fine noise. Note, however, that for non-zero threshold the edge lines may become discontinuous.
A step detection algorithm providing a good resolution, i.e. sharp discontinuity lines, and a good dynamic range while being relatively insensitive to noise. The principle is quite simple: it visualizes the square root of the difference between the 2/3 and 1/3 quantiles of the data values in a circular neighbourhood of radius 2.5 pixels centered around the sample.
This step detector visualizes areas with high local value variation. The root mean square of deviations from the mean value of a circular neighbourhood of radius 2.5 pixels centered around each sample is calculated and displayed.
This function essentially postprocesses RMS output with a filter similar to Laplacian to emphasize boundaries of areas with high local value variation. Despite the name it is still a step detector.
An edge detector which visualizes areas that are locally very non-planar. It fits a plane through a circular neighbourhood of radius 2.5 pixels centered around each sample and then calculates residual sum of squares of this fit reduced to plane slope, i.e. divided by 1 + bx2 + by2 where bx and by are the plane coefficients in x and y directions, respectively. The square root is then displayed.
Visualizes the angle ϑ of local plane inclination. Technically this function belongs among step detectors, however, the accentuation of steps in its output is not very strong and it is more intended for easy visual comparison of different slopes present in the image.
Figure 4.10. Comparison of step and edge detection methods on several interesting, or typical example data. Canny and Zero crossing are step detectors that produce one pixel wide edge lines, Step and Inclination are step detectors with continous output, Local nonlinearity is an edge detector – the edge detection can be easily observed on the second and third row. Note zero crossing is tunable, it parameters were chosen to produce reasonable output in each example.
