low pri features

This commit is contained in:
2026-04-04 00:25:53 -07:00
parent 4818c1123c
commit 5de93e6c4d
47 changed files with 3866 additions and 19 deletions

37
docs/nodes/Calibration.md Normal file
View File

@@ -0,0 +1,37 @@
# Calibration
Apply lateral and height calibration corrections to a DATA_FIELD. Equivalent to Gwyddion's calibrate.c functionality.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| field | DATA_FIELD | Yes | Data to calibrate |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| result | DATA_FIELD | Calibrated field |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| xy_mode | dropdown | keep | Lateral calibration mode: keep (no change), set_size (set explicit physical size), scale (multiply by factor) |
| z_mode | dropdown | keep | Height calibration mode: keep (no change), set_range (linear map to new min/max), scale (multiply by factor), offset (add constant) |
| xreal_new | float | 1e-6 | New x physical size (shown when xy_mode = set_size) |
| yreal_new | float | 1e-6 | New y physical size (shown when xy_mode = set_size) |
| xy_scale | float | 1.0 | Lateral scale factor (shown when xy_mode = scale) |
| z_min | float | 0.0 | New z minimum (shown when z_mode = set_range) |
| z_max | float | 1e-9 | New z maximum (shown when z_mode = set_range) |
| z_scale | float | 1.0 | Z scale factor (shown when z_mode = scale) |
| z_offset | float | 0.0 | Z offset value (shown when z_mode = offset) |
| xy_unit | string | (empty) | New XY unit string; leave empty to keep current |
| z_unit | string | (empty) | New Z unit string; leave empty to keep current |
## Notes
- Controls are conditionally shown based on the selected mode via show_when_widget_value.
- set_range linearly maps data from the current [min, max] to the specified [z_min, z_max]. If data is constant, z_min is applied uniformly.
- Unit fields accept any string (e.g. "m", "nm", "V"). An empty string preserves the existing unit.

View File

@@ -0,0 +1,32 @@
# DWT Anisotropy
Quantify surface anisotropy using a multi-level 2-D Haar wavelet decomposition. At each decomposition level, horizontal and vertical detail energies are compared to produce an X/Y energy ratio. Equivalent to Gwyddion's dwtanisotropy.c.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| field | DATA_FIELD | Yes | Input surface field |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| anisotropy_map | DATA_FIELD | Per-pixel anisotropy ratio map (averaged across decomposition levels) |
| statistics | RECORD_TABLE | Per-level X/Y energy ratios and anisotropy flags |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| n_levels | INT | 4 | Number of wavelet decomposition levels (1--10) |
| ratio_threshold | FLOAT | 0.2 | Deviation from 1.0 required to flag a level as anisotropic (0.001--10.0) |
## Notes
- The decomposition uses the Haar wavelet (db1), which splits each 2x2 block into approximation (LL), horizontal detail (LH), vertical detail (HL), and diagonal detail (HH) coefficients.
- Energy ratios are computed as sum(HL^2) / sum(LH^2) at each level. HL captures horizontal features (edges running left-right), while LH captures vertical features (edges running top-bottom).
- Ratio > 1 means the surface has more horizontal features; ratio < 1 means more vertical features; ratio near 1 indicates isotropy.
- The input is padded to the next power of 2 if necessary; padding uses edge values.
- The anisotropy map is built by upsampling each level's per-pixel ratio and averaging across levels.
- The statistics table includes per-level x_energy, y_energy, ratio, and a boolean anisotropic flag based on the ratio_threshold control.

View File

@@ -0,0 +1,34 @@
# Displacement Field
Distort an image using synthetic displacement fields. Supports correlated Gaussian noise and tear-line distortion modes. Equivalent to Gwyddion's displfield.c module.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| field | DATA_FIELD | Yes | Input field to distort |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| result | DATA_FIELD | Distorted field |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| method | dropdown | gaussian_1d | Distortion method: gaussian_1d, gaussian_2d, or tear |
| sigma | float | 5.0 | Distortion amplitude in pixels |
| tau | float | 20.0 | Lateral correlation length in pixels |
| density | float | 0.02 | Tear density — fraction of rows that become tear lines (tear mode only) |
| seed | int | 42 | Random seed for reproducibility |
## Notes
- **gaussian_1d** generates a 1D correlated random displacement applied only in the x direction. All rows share the same displacement profile, simulating a systematic lateral distortion.
- **gaussian_2d** generates independent 2D correlated random displacements in both x and y. This produces a more general warping of the image.
- **tear** mode simulates scanning artifacts where random horizontal tear lines introduce sudden x-offsets that decay exponentially away from the tear row. This is useful for simulating or studying piezo slip artifacts in SPM data.
- The **sigma** parameter controls the magnitude of the displacement. Larger values produce more extreme distortion.
- The **tau** parameter controls the spatial correlation length. A larger tau produces smoother, more slowly varying displacement fields. The ratio sigma/tau roughly determines the local strain.
- For realistic scanning artifacts, use tear mode with low density (0.01--0.05) and moderate sigma.

View File

@@ -0,0 +1,31 @@
# Distribution Coercion
Transform pixel values so their distribution matches a target shape (uniform, Gaussian, or discrete levels) using rank-based reassignment. Equivalent to Gwyddion's coerce.c module.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| field | DATA_FIELD | Yes | Input field whose value distribution will be transformed |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| result | DATA_FIELD | Field with pixel values reassigned to match the target distribution |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| distribution | dropdown | uniform | Target distribution shape: uniform, gaussian, or levels |
| n_levels | INT | 4 | Number of discrete output levels (21000); visible only for levels mode |
| processing | dropdown | field | Processing scope: field (entire array at once) or rows (line-by-line) |
## Notes
- The transformation is rank-based: pixels are sorted, then reassigned values drawn from the target distribution in sorted order. This preserves the relative ordering of all pixel values.
- Uniform mode spreads values evenly between the original minimum and maximum.
- Gaussian mode maps ranks to the inverse normal CDF, scaled to match the original mean and standard deviation.
- Levels mode quantizes the data into a fixed number of evenly spaced discrete values, useful for terrace-like visualization or discrete height analysis.
- Row mode applies the transformation independently to each scan line, which can correct line-to-line distribution variations in SPM data.

View File

@@ -0,0 +1,34 @@
# Grain Visualization
Visualize labeled grains as geometric shapes — inscribed discs, bounding boxes, centroid markers, or fitted ellipses. Produces a mask image with the chosen shapes and a labeled field where each grain has a unique integer value. Equivalent to Gwyddion's grain selection visualization (grain_makesel).
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| field | DATA_FIELD | Yes | Source data field providing spatial reference and calibration |
| mask | IMAGE | Yes | Binary grain mask (white = grain region) |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| result | IMAGE | Visualization mask with geometric shapes drawn for each grain |
| labeled | DATA_FIELD | Labeled field where each connected grain region has a unique integer value |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| style | dropdown | inscribed_disc | Visualization style: inscribed_disc, bounding_box, centroid, or ellipse |
| fill | BOOLEAN | False | When enabled, shapes are filled; when disabled, only outlines are drawn |
## Notes
- **inscribed_disc**: Draws a circle at each grain centroid with the inscribed disc radius (maximum of the distance transform within the grain).
- **bounding_box**: Draws an axis-aligned rectangle around each grain's bounding box.
- **centroid**: Draws small cross markers at each grain's centroid.
- **ellipse**: Fits an ellipse to each grain using the inertia tensor to determine the major/minor axes and orientation angle.
- When fill is disabled, outlines are drawn with approximately 1-2 pixel thickness.
- The labeled output assigns each connected grain region a unique positive integer; background pixels are zero.
- The mask and field must have the same pixel dimensions.

View File

@@ -0,0 +1,37 @@
# Logistic Classification
Classify surface features using logistic regression on engineered height-derived features. Optionally accepts a training mask; otherwise an Otsu-based threshold generates pseudo-labels automatically.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| field | DATA_FIELD | Yes | Input topographic surface to classify |
| training_mask | IMAGE | No | Optional training labels — masked pixels are treated as the positive class |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| mask | IMAGE | Binary classification result (0 or 255) |
| probability | DATA_FIELD | Per-pixel probability from the logistic model (values in [0, 1]) |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| use_gaussians | BOOLEAN | True | Include Gaussian blur features at multiple scales |
| n_gaussians | INT | 4 | Number of Gaussian scales (110). Only shown when use_gaussians is True |
| use_sobel | BOOLEAN | True | Include Sobel gradient features (horizontal and vertical) |
| use_laplacian | BOOLEAN | True | Include Laplacian (sum of second differences) feature |
| regularization | FLOAT | 1.0 | L2 regularization strength lambda (0.010.0) |
| max_iter | INT | 500 | Maximum gradient descent iterations (105000) |
| seed | INT | 42 | Random seed for reproducibility (0999999) |
## Notes
- **Feature engineering:** The classifier always uses normalized raw height as a feature. Gaussian blurs at scales 2^0, 2^1, ..., 2^(n-1) capture multi-scale smoothness. Sobel gradients detect edges, and the Laplacian highlights curvature. All features are standardized to zero mean and unit variance before training.
- **L2 regularization:** The regularization parameter controls overfitting by penalizing large weights. Higher values produce smoother, more generalizable decision boundaries. The bias term is not regularized.
- **Logistic regression vs neural networks:** Logistic regression is a linear classifier — it learns a single hyperplane in feature space. For complex, highly non-linear boundaries a neural network may be more appropriate, but logistic regression is fast, interpretable, and often sufficient when combined with good feature engineering.
- **Unsupervised mode:** When no training mask is provided, the node uses an Otsu-like threshold on the raw height to generate pseudo-labels, then trains the classifier on those labels. This can improve on simple thresholding because the classifier leverages multi-scale and gradient features.
- Equivalent to Gwyddion's logistic.c classification functionality.

View File

@@ -0,0 +1,30 @@
# Mark Disconnected
Mark topologically disconnected (isolated) surface regions. A morphological opening followed by closing builds a smooth defect-free reference surface; pixels whose deviation from that reference exceeds the sensitivity threshold are flagged. Equivalent to Gwyddion's mark_disconn.c module.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| field | DATA_FIELD | Yes | Input surface to analyse for disconnected regions |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| mask | IMAGE | Binary mask (0/255) marking detected disconnected regions |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| defect_type | dropdown | positive | Which direction of outliers to detect: positive (bumps), negative (pits), or both |
| radius | INT | 5 | Morphological filter radius in pixels (1--100). Larger values smooth over bigger features |
| threshold | FLOAT | 0.1 | Sensitivity threshold as a fraction of the max residual range (0.001--1.0). Lower values detect smaller defects |
## Notes
- The algorithm applies grey-scale morphological opening then closing with a disk structuring element to produce a defect-free reference. The difference between the original surface and this reference highlights isolated regions.
- Increase the radius to ignore larger surface features and only flag truly disconnected regions.
- Lower the threshold to catch subtler defects; raise it to reduce false positives.
- The resulting mask can be fed to Laplace Interpolation or Fractal Interpolation to fill the detected regions.

View File

@@ -0,0 +1,32 @@
# Mask Noisify
Add random noise to a binary mask by flipping pixels near boundaries. Equivalent to Gwyddion's mask_noisify.c.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| mask | IMAGE | Yes | Binary mask to perturb |
| field | DATA_FIELD | No | Optional field for preview background display |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| mask | IMAGE | Noisified binary mask |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| density | FLOAT | 0.1 | Fraction of candidate pixels to flip (0.0--1.0) |
| direction | dropdown | both | Which pixels to perturb: add (grow mask), remove (shrink mask), or both |
| boundaries_only | BOOLEAN | True | Only modify pixels adjacent to a mask boundary |
| seed | INT | 42 | Random seed for reproducible results (0--999999) |
## Notes
- Boundary detection uses four-neighbour comparison (up, down, left, right) via np.roll. A pixel is a boundary pixel if it differs from at least one of its four neighbours.
- Direction modes control which candidates are eligible: "add" selects only unmasked boundary pixels, "remove" selects only masked boundary pixels, and "both" selects all boundary pixels.
- Setting boundaries_only to False allows any pixel in the mask to be a candidate, not just those at edges.
- The seed parameter ensures deterministic output for a given input, which is useful for repeatable experiments.

31
docs/nodes/Mask Shift.md Normal file
View File

@@ -0,0 +1,31 @@
# Mask Shift
Translate a binary mask by an integer pixel offset. Choose how out-of-bounds regions are filled: zero (empty), wrap (periodic roll), or mirror (reflected padding). Equivalent to Gwyddion's mask_shift.c.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| mask | IMAGE | Yes | Binary mask to shift |
| field | DATA_FIELD | No | Optional field for preview background display |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| mask | IMAGE | Shifted binary mask |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| shift_x | INT | 0 | Horizontal shift in pixels (-1000 to 1000). Positive values shift right. |
| shift_y | INT | 0 | Vertical shift in pixels (-1000 to 1000). Positive values shift down. |
| border_mode | dropdown | zero | How to handle edges: zero fills vacated region with empty mask, wrap rolls periodically, mirror reflects at boundaries |
## Notes
- Shift values are in pixels, not physical units.
- **zero** mode: the mask is rolled and the vacated strip is cleared to zero (unmasked). Useful when the shifted region should not wrap around.
- **wrap** mode: uses periodic rolling (`np.roll`). The total number of masked pixels is preserved. Suitable for periodic or tiled data.
- **mirror** mode: pads with reflected values before cropping, so edges are filled with a mirrored copy of the mask boundary. Avoids hard cutoffs at the border.

View File

@@ -0,0 +1,35 @@
# Neural Classification
Classify surface pixels into two classes using a simple two-layer feedforward neural network with sigmoid activations. Features are extracted via multi-scale Gaussian filtering. Equivalent in purpose to Gwyddion's neural.c classifier.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| field | DATA_FIELD | Yes | Input surface to classify |
| training_mask | IMAGE | No | Training labels: 0 = class A, 255 = class B. When omitted the network uses unsupervised self-labelling |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| mask | IMAGE | Binary classification mask (0 or 255) |
| probability | DATA_FIELD | Per-pixel probability of belonging to class B (values in 0-1) |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| n_gaussians | INT | 4 | Number of Gaussian blur scales for feature extraction (1-10). Each scale uses sigma = 2^i |
| n_hidden | INT | 16 | Number of neurons in the hidden layer (4-128) |
| train_steps | INT | 200 | Number of gradient descent iterations (10-5000) |
| seed | INT | 42 | Random seed for weight initialisation (0-999999) |
## Notes
- Feature extraction applies Gaussian blur at multiple scales (sigma = 1, 2, 4, 8, ...) to capture both fine and coarse surface structure. Each feature is normalised to zero mean and unit variance before training.
- The network architecture is input -> hidden (sigmoid) -> output (sigmoid), trained with binary cross-entropy loss and standard backpropagation.
- When a training mask is provided, the network learns in supervised mode using all pixels (0 pixels as class A targets, 255 pixels as class B targets).
- Without a training mask, the node uses an unsupervised approach: the random initial weights produce an initial classification which is then refined by self-training for a small number of steps.
- Increasing n_hidden or train_steps improves capacity but slows computation. For most surfaces, the defaults work well.
- The probability output can be fed into a Threshold Mask node for adjustable post-classification thresholding.

View File

@@ -0,0 +1,35 @@
# PSF Estimation
Estimate a point spread function (PSF) from a measured (blurred) image and an ideal (sharp) reference. The estimated PSF can be fed into the Deconvolution node to restore other images acquired under the same conditions. Equivalent to Gwyddion's psf.c / psf-fit.c modules.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| measured | DATA_FIELD | Yes | Measured (blurred) image |
| ideal | DATA_FIELD | Yes | Ideal (sharp) reference image |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| psf | DATA_FIELD | Estimated point spread function |
| parameters | RECORD_TABLE | Fitted PSF parameters (populated by gaussian_fit method) |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| method | dropdown | wiener | Estimation method: wiener, least_squares, or gaussian_fit |
| regularization | FLOAT | 0.01 | Regularization parameter (1e-6 to 1.0) |
| psf_size | INT | 32 | Size of the estimated PSF in pixels (4 to 128) |
## Notes
- **Wiener**: Pseudo-Wiener deconvolution in the frequency domain. Computes `conj(F_ideal) * F_measured / (|F_ideal|^2 + regularization)`. Fast and robust for most cases.
- **Least-squares**: Regularised frequency-domain division. Zeros out components where the ideal signal is too weak, avoiding noise amplification.
- **Gaussian fit**: Estimates the PSF via the Wiener method, then fits a 2D Gaussian to the result using moment analysis. Returns the smooth fitted PSF and its parameters (sigma_x, sigma_y, amplitude). Useful when the PSF is known to be approximately Gaussian.
- The **regularization** parameter controls the noise/sharpness tradeoff. Smaller values yield sharper PSF estimates but amplify noise. Start with the default (0.01) and adjust if needed.
- The PSF output is always normalized to sum to 1 and cropped to `psf_size x psf_size` pixels centered on the peak.
- Connect the PSF output to the Deconvolution node for image restoration with the estimated kernel.
- Both input fields should have the same pixel dimensions for best results.

View File

@@ -0,0 +1,34 @@
# Pixel Classification
Classify pixels into discrete classes based on height, slope, and/or curvature using threshold or clustering methods. Equivalent to Gwyddion's classify.c module.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| field | DATA_FIELD | Yes | Input surface |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| classified | DATA_FIELD | Integer class labels (0 to n_classes-1) |
| mask | IMAGE | Binary mask of the first class (class 0) |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| n_classes | INT | 3 | Number of output classes (210) |
| feature | dropdown | height | Feature used for classification: height, slope, curvature, height_slope, or all |
| method | dropdown | otsu | Thresholding method: otsu, equal_range, or quantile |
## Notes
- **Feature types**: "height" uses raw data values; "slope" uses gradient magnitude (via `np.gradient`); "curvature" uses the Laplacian (sum of second derivatives). "height_slope" and "all" stack multiple features.
- **Threshold methods** (single-feature only):
- *otsu*: Multi-Otsu thresholding that finds thresholds minimising intra-class variance.
- *equal_range*: Divides the feature value range into equal-width intervals.
- *quantile*: Divides by quantiles so each class contains roughly the same number of pixels.
- **Multi-feature modes** ("height_slope", "all") ignore the method setting and use k-means clustering instead. Each feature is normalised to [0, 1] before clustering.
- The mask output contains class 0 only — use the classified field for access to all class labels.

View File

@@ -0,0 +1,31 @@
# Presentation Ops
Manage presentation overlays on data fields. Provides logarithmic scaling, normalisation extraction, overlay attachment, and linear blending. Equivalent to Gwyddion's `presentationops.c` module.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| field | DATA_FIELD | Yes | Primary data field |
| overlay | DATA_FIELD | No | Field to attach or blend as an overlay (used by attach and blend modes) |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| result | DATA_FIELD | Processed data field |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| operation | dropdown | logscale | Operation mode: logscale, extract_presentation, attach, or blend |
| blend_factor | FLOAT | 0.5 | Linear blend ratio between field (0.0) and overlay (1.0); only shown in blend mode (0.0--1.0) |
## Notes
- **logscale**: Shifts the data so the minimum becomes a small positive value, then applies log10. Useful for data with large dynamic range such as power spectral densities or FFT magnitudes.
- **extract_presentation**: Normalises the field to the [0, 1] range. Handy for generating a quick visual overview or feeding into colour-mapping nodes.
- **attach**: Replaces the field data with the overlay data. If the overlay has different dimensions it is resampled with cubic interpolation to match.
- **blend**: Linearly mixes `(1 - blend_factor) * field + blend_factor * overlay`. The overlay is resampled if its dimensions differ from the field.
- Overlay resampling uses `scipy.ndimage.zoom` with third-order (cubic) interpolation.

View File

@@ -0,0 +1,32 @@
# Super Resolution
Combine multiple aligned scans to produce a super-resolved image with higher spatial resolution. Sub-pixel shifts between inputs are estimated via FFT cross-correlation and used to reconstruct a finer grid. Equivalent to Gwyddion's superresolution.c.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| field1 | DATA_FIELD | Yes | Reference image |
| field2 | DATA_FIELD | No | Second image |
| field3 | DATA_FIELD | No | Third image |
| field4 | DATA_FIELD | No | Fourth image |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| result | DATA_FIELD | Super-resolved image |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| upscale | INT | 2 | Upscaling factor (2, 3, or 4) |
## Notes
- When only one field is provided the image is upsampled using cubic interpolation (no multi-image enhancement).
- Additional fields are aligned to the reference using FFT-based cross-correlation with parabolic sub-pixel refinement, then averaged on the high-resolution grid.
- Providing more images generally improves the result because each scan samples slightly different sub-pixel positions.
- All input fields should have the same pixel dimensions and physical size for correct alignment.
- The upscale factor controls the output resolution multiplier (2x, 3x, or 4x the input dimensions).

View File

@@ -0,0 +1,33 @@
# Tip Shape Estimate
Estimate SPM tip geometry from a known calibration feature. The image of a calibration feature (sharp edge, sphere, cylinder) is a dilation of the true feature shape with the tip. By subtracting the known feature contribution the tip shape can be recovered. The 2D tip is built by revolving the extracted 1D radial profile assuming axial symmetry. Equivalent to Gwyddion's tipshape.c analysis.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| field | DATA_FIELD | Yes | Image of a known calibration feature |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| tip_shape | DATA_FIELD | Estimated tip shape as a 2D image (apex = maximum, edges = 0) |
| parameters | RECORD_TABLE | Estimated tip parameters: tip_radius (radius of curvature at apex) and half_angle (cone half-angle from the tip walls) |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| feature_type | dropdown | edge | Type of calibration feature: edge (sharp step), sphere (calibration ball), or cylinder (calibration wire) |
| feature_radius | FLOAT | 100 nm | Known radius of the calibration feature in metres; used for sphere and cylinder types (1 nm to 100 um) |
| n_points | INT | 100 | Number of points in the output tip profile / side length of the tip grid (10-1000) |
## Notes
- **Calibration features**: For best results use well-characterised calibration standards. Sharp edges give the most direct tip estimate. Sphere and cylinder features require accurate knowledge of the feature radius.
- **Dilation model**: The measured image is the morphological dilation of the true surface with the tip shape. For a known surface feature, subtracting the feature profile from the measured profile yields the tip contribution.
- **Axial symmetry assumption**: The 2D tip shape is built by revolving the 1D radial profile around the apex. This assumes the tip is rotationally symmetric, which is a reasonable first approximation for most SPM tips but may not capture asymmetric wear or contamination.
- **Use with Tip Deconvolution**: The estimated tip can be fed directly into the Tip Deconvolution node to reconstruct the true surface from measured images. Ensure the pixel size of the tip matches the image pixel size.
- **feature_radius** is only used for sphere and cylinder feature types; it is ignored for edge estimation.
- Equivalent to Gwyddion's tipshape.c tip characterisation routines.