TomoJAX

Command line

The commands, their conventions and --config files.

tomojax.cli implements the tomojax console script.

Conventions

Every command has the shape tomojax <command> INPUT -o OUTPUT [options] (simulate takes no input).

  • An existing output is refused unless --force is given.
  • tomojax <command> --help lists the command's options. Expert settings are not on the help page: put them in a TOML file and pass it with --config FILE (preprocess, recon, align and simulate). tomojax <command> --config-keys lists the keys a file may set, with their defaults; explicit command-line options override the file.
  • Exit status is 0 on success, 1 on failure (for inspect, also when the dataset is invalid) and 2 for a usage error.
  • tomojax --version prints the version.

The options match the Python API's keywords: tomojax recon --method cgls --iterations 50 is tj.reconstruct(scan, "cgls", iterations=50), and tomojax align --mode cor --freeze dy is tj.align(scan, mode="cor", freeze=["dy"]).

With no --mode or --method, align and recon use the same automatic policy as Python. Explicit modes and methods retain their own settings; expert TOML solver settings require one. Limitations are printed and retained in result records/manifests. Automatic align --dry-run reports that its plan is data-dependent rather than running calibration. Explicit dry-run plans use the input beam geometry, matching the Python workflow's solver budget.

Commands

  • inspect: describe a dataset and check that it can be reconstructed; --json prints the report as JSON, and --preview DIR writes PNGs of the central projection and, for a reconstruction, the volume's central slices.
  • import: write a dataset from a Nikon .xtekct scan, a TIFF stack (with --angles, --pixel-size and, for cone beams, the distances) or another .nxs/.npz dataset.
  • preprocess: flat- and dark-correct raw frames into absorption projections.
  • recon: choose automatically, or reconstruct with Fourier, FBP/FDK, CGLS, FISTA-TV or SPDHG-TV with tj.reconstruct, with the poses saved in the input unless --no-poses. Its expert settings are fields of the method's configuration class (tomojax.recon.FBPConfig, FourierConfig, CGLSConfig, FistaConfig or SPDHGConfig), each replacing that field of the class's defaults, as tj.reconstruct(config=...) takes them; --roi cyl zeroes the volume outside the cylinder every view sees.
  • align: estimate the rotation axis and per-view poses (--mode auto, pose, cor, cor-then-pose or full) with tj.align, on top of the poses saved in the input unless --no-poses. Its expert settings are tomojax.alignment.AlignConfig fields, each replacing that field of the configuration the mode gives (--dry-run prints it); --checkpoint PATH saves progress after each outer iteration and resumes from it. Mixed setup and pose stages in full carry their own gauge policies; an expert direct parameter set mixing them needs an explicit gauge_policy.
  • export: write a reconstruction as TIFF slices, or as one raw file when OUTPUT ends in .raw.
  • simulate: write a synthetic scan of a phantom.

A lab CT scan from start to finish

tomojax import scan/scan.xtekct -o scan.nxs
tomojax inspect scan.nxs
tomojax align scan.nxs -o aligned.nxs --mode cor
tomojax recon aligned.nxs -o recon.nxs
tomojax inspect recon.nxs --preview previews
tomojax export recon.nxs -o slices/

align --mode cor estimates the cone beam's axis offset and detector roll, and recon uses them. previews/ then holds projection.png, slice_z.png, slice_y.png and slice_x.png. See the lab cone-beam CT guide.

On this page