Examples#
KonfAI ships three low-level, YAML-driven examples under examples/. They are
the best starting point when you want to understand the framework before
building a reusable KonfAI App.
Segmentation and Synthesis are backed by public demo data on Hugging Face:
VBoussot/konfai-demo/SynthesisVBoussot/konfai-demo/Segmentation
Registration instead generates eight small fixed/moving pairs locally, with a known translation and no patient data. Segmentation and Synthesis also include notebooks intended for a fresh environment, including Google Colab.
Choosing an example#
Start with Segmentation when you want the smallest conservative baseline:
one input group (
CT)one label-map target (
SEG)built-in
UNettraining with
CrossEntropyLossfinal evaluation with Dice
Start with Synthesis when you want to understand more of KonfAI’s configuration model:
custom local Python modules loaded through
classpathpaired image-to-image training
masked evaluation
shared prediction and evaluation configs
a GAN variant with nested patching scopes
Start with Registration when you want to learn the two-input spatial workflow:
generated
FIXED/MOVINGimage pairs with a known offsetthe built-in 2D diffeomorphic
VoxelMorpha named warped-image output materialised as
MOVED.mhaMAE and MSE measured before and after registration
A good adoption pattern is:
get Segmentation to run once
use Registration when your model consumes ordered fixed/moving inputs
move to Synthesis when you need custom modules or more advanced workflow structure
Working from the repository#
All example commands in this documentation assume you are running from the example directory itself, for example:
cd examples/Segmentation
or:
cd examples/Registration
or:
cd examples/Synthesis
That matters because the shipped YAML files refer to local modules and dataset paths relative to the current working directory.
Next steps#
Segmentation Example — the smallest end-to-end run; start here
Registration example — train, materialise, and evaluate a fixed/moving image workflow
Registration: moving image to physical field — inspect a separate real IMPACT-Reg App execution
Configuration model — understand the YAML the examples are built from
Using custom models, transforms, augmentations, and losses — the step after Synthesis’s local
classpathmodules