Skip to content

Getting Started ​

Install the PhantEM renderer, open a bundled sample in the tuning workbench, and know where everything lives.

Requirements ​

  • Python ≥ 3.9
  • numpy, scipy, scikit-image, tifffile, matplotlib, mrcfile (all in requirements.txt)
  • Optional: bm3d (classical-tier validation), careamics + a CUDA-matched torch (ML-tier validation)

The tuner server itself is standard-library only — the dependencies are for the render engine and fitters.

Installation ​

bash
git clone https://github.com/lucasfortune/phantem.git
cd phantem
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

First Run: The Tuning Workbench ​

bash
cd renderer_code
python tuner_server.py --port 8765
# open http://127.0.0.1:8765/ in a browser

In the top bar, point the workbench at three files plus a pixel size:

InputWhat it is
tomogramThe intensity stack (.tif/.tiff, .mrc, or .npy)
labelsThe segmentation stack, same shape (integer labels; 0 = background)
noiseA fitted noise-model JSON — or a clean background-crop stack, which the workbench fits server-side
nm/pxPixel size in nanometres (sizes object radii and the PSF)

Press Open — the workbench measures each class's intensity from the tomogram, and the clean and noisy renders update live as you tune. Paths are read server-side (they are paths on the machine running tuner_server.py).

Data to try immediately: the repository's sample sets (the six development volumes) or any pair from the Zenodo deposit — each ships the tomogram-derived inputs, a background crop, and a frozen config. See The Benchmark Data.

Headless Entry Points ​

Everything the UI does also runs from the command line:

CommandPurpose
python renderer_code/noise_fit.py crop.tifFit the noise model {spectrum, banding, axial} from a background crop + run the C1 checks
python validation/tune_check.py <volume> my_cfg.jsonPer-volume window-only scorecard for a config you are tuning
python validation/ws_render_stacks.py [vol ...]Render the clean/noisy stacks (plus the negative controls)
python validation/ws_t1.py [vol ...]T1 residual-behavior tier (median/Gaussian/NLM/BM3D)
python validation/ws_t2_careamics.pyML tier (N2V, structN2V; T2 transfer + T1)

Self-Tests ​

bash
python renderer_code/render_layers.py --selftest   # render-engine invariants
python renderer_code/noise_fit.py                  # fitter self-test (no args)
python renderer_code/tuner_server.py --selftest    # API validation

Repository Layout ​

PathContent
renderer_code/The workbench: server, UI, render engine, noise generator, fitters, metrics, C2 checks
validation/The C3 tier scripts, the frozen verdict, per-volume registry and evaluation windows
figures_src/Scripts generating the paper's data figures

Next Steps ​

Part of DFG Priority Programme SPP2332 "Physics of Parasitism"