stitchedof.py performs two steps for tiled Keyence datasets:
- Per-tile extended depth-of-field (EDOF) collapse from Z-stacks.
- Global tile stitching into one output TIFF.
The script expects an input folder containing:
- Tile TIFF files named like
..._00001_Z001.tifor..._00001_Z001_CH4.tif - Exactly one
.gcifile (used to read row/column grid size)
- Python packages:
numpy,tifffile,scipy,tqdm,torch - CUDA-enabled PyTorch is optional but recommended for faster phase-correlation stitching.
PyTorch install:
python stitchedof.py <input_dir> [output]input_dir: required directory containing TIFF tiles and one.gcioutput: optional output TIFF path or filename- If omitted, default output is:
<input_dir>/<input_dir_name>_stitched.tif
- If omitted, default output is:
Examples:
python stitchedof.py data
python stitchedof.py data custom_output.tif
python stitchedof.py data /tmp/out/final.tif --workers 4 --overlap 0.3
python stitchedof.py data --tilestitch--patch_size NEDOF local-statistics window size (default:7)--alpha AEDOF score mixing factor in[0,1](default:0.7)--workers Nmultiprocessing workers for EDOF tiles (default: CPU count)--edofsave BOOLsave per-tile EDOF TIFFs (true/false, default:false)--overlap Ffractional tile overlap for alignment/blending (default:0.3)--tilestitchuse legacy single-tile row anchoring instead of default full-row overlap stitching
- Default stitching mode is row-based (
ROWSTITCH), which aligns rows using full overlap strips. --tilestitchswitches to legacy behavior using one anchor tile pair per row.- Runtime console output reports stitching mode and device (
CPUorCUDA).