Repository Features
Directory structure
.github.workflows: Contains our github action runnersbump_version.yaml: Bumps the package version number for every push to main with src changestest_and_check.yaml: Runs ruff, mypy and pytest with coverageupdate_documentation: Updates the central virdocs when pushed to main
config: Hydra config.yaml files for scriptstraining_configs: config files for training, see section Training for more information
docs: Mkdocs documentation filesnotebooks: Jupyter notebooks with subdirectories for each personscripts: Executable python scriptssrc: Main source codetests: all tests
Testing in actions runner
This repository comes with a github actions workflow that runs pytest in a docker container for a clean testing environment. We run the tests on our self-hosted runner. All tests that test inference functionality are run in the cuda test environment cuda-test without any dev dependencies. All other tests are run i]n the cuda-dev environment, which also has all development dependencies. The tests can also be run locally using pixi tasks:
pixi task run-tests # select cuda-test as environment
pixi task run-dev-tests # select cuda-dev
Docs
We use mkdocs and host the documentations on our server. For full documentation visit mkdocs.org.
The repo for the documentation can be found here: GitHub virdocs The documentation itself can be found here: virdocs
The central documentation is automatically updated upon a push to main (a Github action runner takes care of this). To locally test the documentation run:
mkdocs serve
Precommit
Installed pre-commit hooks are:
- ruff (linter)
Features comparison nnUNet
We have made the decision to not include certain nnUNet features in our own repo at this point. However, it should be fairly straight forward to add these if we need them at a later point.
- The
3D_lowresfollowed by3d_cascade_fullresconfiguration is missing. Our current GPUs allow for much larger image sizes, so this was not considered essential and simplified the code a bit. - Region-based training
- Training with non-nifti/non-vicom data. However, this can simply be implemented by creating a new dataset (which can inherit from the current classes).
- All modules and training classes should in theory work for 2D, but this has not been well tested yet. For 2D data (or any other non-vicom data) a new
train_runner.pyscript, and potentially dataloaders, will have to be created. - Foreground sampling has been implemented, but this should be better tested if this is important for the task. As for the currently tests tasks this does not make a large contribution to the performance, this was difficult to verify. Also, our own implementation always uses stochastic (per-item) foreground sampling, whereas nnUNet also has the option to balance each batch (i.e. always one fg-sampled, and one not), which is the default.
- Residual Encoder Backbone