XelToFab
CLI Reference

xtf viz

Visualize a scalar field and its extraction result

Usage

xtf viz [OPTIONS] INPUT_PATH

Load 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

ArgumentDescription
INPUT_PATHPath to the input scalar field file (must exist)

Options

OptionTypeDefaultDescription
-o, --outputPATHNoneOutput image path. If provided, the figure is saved to this file. If omitted, an interactive matplotlib window is opened.
--thresholdFLOAT0.5Field threshold [0-1] for binarization
--sigmaFLOAT1.0Gaussian smoothing sigma for preprocessing
-f, --field-nameTEXTNoneField/variable name to extract from input file (for .npz, .mat, .h5, etc.)
--shapeTEXTNoneGrid shape for flat data, e.g. 100x200 or 10x20x30
--field-typedensity|sdfdensityInput field type. Setting sdf enables smart defaults.
--directflagFalseDirect extraction from continuous field (skip preprocessing)
--extraction-methodmc|dc|surfnets|manifoldmcExtraction 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 with plt.show().

Examples

Interactive display

xtf viz scalar_field.npy

Save to file

xtf viz scalar_field.npy -o comparison.png

MATLAB file with custom parameters

xtf viz design_result.mat -f xPhys --threshold 0.4 -o result.png

SDF field visualization

xtf viz sdf_field.npy --field-type sdf -o sdf_result.png

Outline