adding more nodes

This commit is contained in:
2026-04-03 23:11:52 -07:00
parent 5d4c6dfcea
commit 7747c1c7bc
146 changed files with 4950 additions and 145 deletions

33
docs/nodes/Grain Cross.md Normal file
View File

@@ -0,0 +1,33 @@
# Grain Cross
Correlate grain properties between two fields using a shared grain mask. Reports per-grain property pairs and the Pearson correlation coefficient. Equivalent to Gwyddion's grain_cross.c module.
## Inputs
| Name | Type | Required | Description |
|------|------|----------|-------------|
| field_a | DATA_FIELD | Yes | First height field |
| field_b | DATA_FIELD | Yes | Second height field |
| mask | IMAGE | Yes | Binary grain mask (white = grain) |
## Outputs
| Name | Type | Description |
|------|------|-------------|
| correlation | RECORD_TABLE | Per-grain property pairs and Pearson correlation coefficient |
## Controls
| Name | Type | Default | Description |
|------|------|---------|-------------|
| property_a | dropdown | mean_height | Property to compute from field_a: area, mean_height, max_height, or volume |
| property_b | dropdown | max_height | Property to compute from field_b: area, mean_height, max_height, or volume |
| min_size | INT | 10 | Minimum grain area in pixels; smaller grains are excluded (1100000) |
## Notes
- Grains are identified by connected-component labelling (`scipy.ndimage.label`) on the binary mask.
- The **area** property uses physical pixel area (dx * dy). **Volume** integrates height above the mean of non-grain pixels.
- Each table row contains one grain's property pair formatted as "value_a / value_b".
- The final row reports the Pearson correlation coefficient r between the two property vectors (requires at least 2 grains).
- Both fields must have the same pixel dimensions as the mask.