Files
tono/docs/nodes/Threshold Mask.md
2026-03-30 23:10:42 -07:00

30 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Threshold Mask
Create a binary mask by thresholding data. Otsu automatically finds the optimal threshold. Equivalent to Gwyddion's threshold and otsu_threshold modules.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| field | DATA_FIELD | Yes | Input field to threshold |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| mask | IMAGE | Binary mask (white = selected pixels) |
| threshold | RECORD_TABLE | Table with the threshold value applied |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| method | dropdown | absolute | Thresholding method: absolute (raw data value), relative (fraction of minmax range), or otsu (automatic Otsu threshold) |
| threshold | FLOAT | 0.0 | Threshold value; for absolute: raw z value; for relative: fraction 01; ignored for otsu (socket-only input) |
| direction | dropdown | above | Which pixels to select: above or below the threshold |
## Limitations
- For the relative method, the threshold fraction is applied to the full data range [min, max].
- Otsu thresholding may not give meaningful results on non-bimodal height distributions.