## Local Defects

Several modules enable direct or indirect editing of the SPM data. Even though most data processing changes the data in one way or another, this section describes functions and tools designed specifically for correction of local defects. They remove bad data from an image, and replace them using some interpolation method.

See also section Scan Line Artefacts for methods that deal with defects related to scanning.

### Remove Spots Tool

The Remove Spots tool can be used for removing very small parts of the image that are considered a scanning error, dust particle or anything else that should not be present in the data. Note that doing so can dramatically alter the resulting statistical parameters of the surface, so be sure not to remove things that are really present on the surface.

While using this tool you can pick up position of the spot to magnify its neighbourhood in the tool window. Then, in the tool window, select a rectangle or ellipse (depending on chosen Shape) around the area that should be removed. You can then select one of several interpolation methods for creating data in place of the former spot:

• Hyperbolic flatten uses information from outer boundary pixels of the selected area to interpolate the information inside area.
• Laplace solver solves Laplace's equation to calculate data inside area; the outer boundary is treated as virtual source.
• Pseudo-Laplace is a faster approximation of true Laplace equation solution. For small areas one can always use the true solver.
• Fractal correction uses whole image to determine fractal dimension. Then tries to create randomly rough data that have the same fractal dimension and put them into the area.
• Fractal-Laplace blend is a weighted average of fractal interpolation and Laplace solver. The interior is given by fractal interpolation, but close to region edges the Laplace interpolation is mixed in to provide a smoother continuation to the exterior.
• Zero simply fills the area with zeros.

Clicking will execute the selected algorithm.

### Note

Spot removal will only work for regions of size 80 × 80 pixels or smaller. To remove larger regions, create a mask using the Mask Editor tool, then use Data ProcessCorrect DataInterpolate Data Under Mask.

### Remove Grains Tool

The simple Remove Grains tool removes manually selected connected parts of mask or interpolates the data under them, or possibly both. The part of mask to remove is selected by clicking on it with left mouse button.

The data available interpolation methods are a subset of those offered by Remove Spots tool, in particular Zero, Laplace's equation solution, Fractal correction and their blend.

Data ProcessCorrect DataInterpolate Data Under Mask

This function substitutes data under the mask by the solution of solving the Laplace's equation. The data values around the masked areas define the boundary conditions. The solution is calculated iteratively and it can take some time to converge.

Data ProcessCorrect DataZero Data Under Mask

This function simply fills masked data with zeros, which is sometimes less distracting than interpolation.

### Fractal Correction

Data ProcessCorrect DataFractal Correction

The Fractal Correction module, like the Interpolate Data Under Mask module, replaces data under the mask. However, it uses a different algorithm to come up with the new data: The fractal dimension of the whole image is first computed, and then the areas under the mask are substituted by a randomly rough surface having the same fractal dimension. The root mean square value of the height irregularities (roughness) is not changed by using this module.

### Note

This calculation can take some time, so please be patient.

### Warning

Running this module on data that do not have fractal properties can cause really unrealistic results and is strictly not recommended.

This module creates mask of areas in the data that not pass the criterion. All the values above and below this confidence interval are marked in mask and can be edited or processed by other modules afterwards, for instance Interpolate Data Under Mask. This outlier marking method is useful for global outliers with values very far from the rest of the data.