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
--forceis given. tomojax <command> --helplists 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,alignandsimulate).tomojax <command> --config-keyslists 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 --versionprints 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;--jsonprints the report as JSON, and--preview DIRwrites PNGs of the central projection and, for a reconstruction, the volume's central slices.import: write a dataset from a Nikon.xtekctscan, a TIFF stack (with--angles,--pixel-sizeand, for cone beams, the distances) or another.nxs/.npzdataset.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 withtj.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,FistaConfigorSPDHGConfig), each replacing that field of the class's defaults, astj.reconstruct(config=...)takes them;--roi cylzeroes the volume outside the cylinder every view sees.align: estimate the rotation axis and per-view poses (--mode auto,pose,cor,cor-then-poseorfull) withtj.align, on top of the poses saved in the input unless--no-poses. Its expert settings aretomojax.alignment.AlignConfigfields, each replacing that field of the configuration the mode gives (--dry-runprints it);--checkpoint PATHsaves progress after each outer iteration and resumes from it. Mixed setup and pose stages infullcarry their own gauge policies; an expert direct parameter set mixing them needs an explicitgauge_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.