Code Monkey home page Code Monkey logo

kit-rt's Introduction

CI Coverage Status Documentation Status License: MIT

KiT-RT - an HPC Radio Therapy simulation framework

The KiT-RT (Kinetic Transport Solver for Radiation Therapy) framework is a high-performance open source platform for radiation transport. Its main focus is on radiotherapy planning in cancer treatment. To enable problem-specific method selection, the framework provides different deterministic solver types. This not only facilitates treatment planning, but also provides tools to investigate various research questions in the field of radiative transfer. This goal is supported by an easily extendable code structure that allows for straightforward implementation of additional methods and techniques.

The documentation can be found here. The preprint for the KiT-RT journal paper is available here.

Contents

What KiT-RT is capable of

Theory

A short description of kinetic theory can be found here.

Build

Required dependencies

  • Compiler with C++17 support
  • cmake >= v3.16
  • LAPACK
  • OpenMP
  • MPI
  • python3
  • VTK
  • git

Tensorflow installation

If you choose to enable the machine learning tools via the BUILD_ML option, you need to install the tensorflow C-API:

FILENAME=libtensorflow-cpu-linux-x86_64-2.7.0.tar.gz
wget -q --no-check-certificate https://storage.googleapis.com/tensorflow/libtensorflow/${FILENAME}
tar -C /usr/local -xzf ${FILENAME}
ldconfig /usr/local/lib

Python dependencies

  • pydicom
  • numpy
  • pygmsh version 6.1.1
  pip install pygmsh==6.1.1

(note that newer versions are not yet supported)

Obtain submodules

Note that an active internet connection is required for the first build in order to download the suitable versions of the required submodules! For the first build only, download all submodules:

git submodule update --init --recursive

Compile the code

In case of the make build system (available on most systems) run:

mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ../
make -j

Run

Execute the compiled binary by handing over a valid config file, e.g.:

./KiT-RT ../examples/linesource_SN.cfg

In order to run the code in parallel execute:

OMP_NUM_THREADS=N mpirun -np J ./KiT-RT ../examples/linesource_SN.cfg

with N equal to the number of shared memory threads and J equal to the number of distrubuted memory threads.


Unit Tests

After compiling the framework with:

cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON ../
make -j

Unit test can be run with:

make test

Docker

A preconfigured docker container can also be used to run the code. By running

docker run --rm -ti -v $(pwd):/home kitrt/test:latest

To use the tensorflow backend for neural network based entropy closures, please use the tensorflow equippend containter by running

docker run --rm -ti -v $(pwd):/home kitrt/test_ml:latest

from the current folder will be mounted to the docker container and the code can be executed without any of the required dependencies.

Bash scripts are provided in the folder tools/CI to get started with the docker environments. To start an interactive docker environment, execute

docker run -i -t --rm -v $(pwd)/../..:/mnt kitrt/test:latest /bin/bash

Tensorflow

To use the neural network based entropy closure, one needs to install the tensorflow C++ backend. Just use the following commands:

FILENAME=libtensorflow-cpu-linux-x86_64-2.7.0.tar.gz
wget -q --no-check-certificate https://storage.googleapis.com/tensorflow/libtensorflow/${FILENAME}
tar -C /usr/local -xzf ${FILENAME}
ldconfig /usr/local/lib

and for a gpu based version (you need supported hardware and gpu drivers, see here ):

FILENAME=libtensorflow-gpu-linux-x86_64-2.7.0.tar.gz
wget -q --no-check-certificate https://storage.googleapis.com/tensorflow/libtensorflow/${FILENAME}
tar -C /usr/local -xzf ${FILENAME}
ldconfig /usr/local/lib

Cite

@article{kitrt2023,
    title={KiT-RT: An extendable framework for radiative transfer and therapy},
    author={Kusch, Jonas and Schotth{\"o}fer, Steffen and Stammer, Pia and Wolters, Jannick and Xiao, Tianbai},
    journal={ACM Transactions on Mathematical Software},
    volume={49},
    number={4},
    pages={1--24},
    year={2023},
    publisher={ACM New York, NY}
}

kit-rt's People

Contributors

chinsp avatar jawolters avatar jonasku avatar piastammer avatar scsteffen avatar vavrines avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

kit-rt's Issues

Sprint todos

Presprint TODO:

  • validate PN in different cases against starmap

Sprint TODO

  • Adding MPI
  • Collided-Uncollided Split
  • Running CT Scans with Triangular meshes (with Code of Chinmay)
  • Validate & Check second order (if working, add to all methods / new branches)
  • Prepare steps to 3D code (to fuse with Pias Matlab code) [IC, BC, Fluxes] (not high prio)
  • Adding a beam test case
  • Change Cell based flux to Face based Flux / Streamline mesh class for this case

2nd order issues

  • Compare 1st and 2nd order for standard PN,SN

  • Implement 2nd order for CSDPN/SN

  • See if the cross artifact remains

  • Consider 2nd order DG since it is AP

  • Consider adjustable parameters in unstructured triangular mesh need to be considered!

error termination with "VOLUME_OUTPUT_FREQUENCY = 1"

Hello, the simulation ran without issues with VOLUME_OUTPUT_FREQUENCY = 0, but it terminated with an error (Return code: -9) when VOLUME_OUTPUT_FREQUENCY was set as 1.
I tested it using WSL2 Ubuntu on a machine with Windows 11 Home (version: 23H2).
The attachment contains a log of the solver, the config file, and the hardware information of the machine.
Thank you!

doc.zip

RadiationCT/Waterphantom testcases (esp. with Sn) break for higher moments

  • Config files from KiTRTPaperData seem to work for 13 moments
  • Config files with smaller mesh, density one but same number of moments also work
  • when increasing moments to 20, solver breaks -> mass explodes, then becomes -nan, flux is inf then -nan
  • Edit: the breaking point is 20 moments, below everything is fine, above problems ensue -> maybe the StarMap/physical data only goes up to 19?

Validation against StarMAP CSD

Ideas to find the error:

  • Compare Initial conditions
  • Find why our dose is by 10³ higher. Moment normalization factor? Factor in dose computation/integration?
  • Compare Stopping powers
  • Find out details about StarMAP cross-section plot + its legedend.
  • Hardcode StarMap IC s.t. they are comparable to ours
  • Check PN Scattering influence

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.