CLI Reference
xtf viz
Visualize a scalar field and its extraction result
Usage
xtf viz [OPTIONS] INPUT_PATHLoad a scalar field, run it through the pipeline, and display (or save) a side-by-side comparison visualization showing the input field alongside the extraction result.
Arguments
| Argument | Description |
|---|---|
INPUT_PATH | Path to the input scalar field file (must exist) |
Options
| Option | Type | Default | Description |
|---|---|---|---|
-o, --output | PATH | None | Output image path. If provided, the figure is saved to this file. If omitted, an interactive matplotlib window is opened. |
--threshold | FLOAT | 0.5 | Field threshold [0-1] for binarization |
--sigma | FLOAT | 1.0 | Gaussian smoothing sigma for preprocessing |
-f, --field-name | TEXT | None | Field/variable name to extract from input file (for .npz, .mat, .h5, etc.) |
--shape | TEXT | None | Grid shape for flat data, e.g. 100x200 or 10x20x30 |
--field-type | density|sdf | density | Input field type. Setting sdf enables smart defaults. |
--direct | flag | False | Direct extraction from continuous field (skip preprocessing) |
--extraction-method | mc|dc|surfnets|manifold | mc | Extraction algorithm. SDF smart default: dc |
Behavior
- With
-o: The comparison figure is saved to the specified path at 150 DPI and the matplotlib figure is closed. No window is opened. - Without
-o: An interactive matplotlib window is opened withplt.show().
Examples
Interactive display
xtf viz scalar_field.npySave to file
xtf viz scalar_field.npy -o comparison.pngMATLAB file with custom parameters
xtf viz design_result.mat -f xPhys --threshold 0.4 -o result.pngSDF field visualization
xtf viz sdf_field.npy --field-type sdf -o sdf_result.png