Simulation Grid

The GliomaSolver is implemented in the Multi-Resolution-Adaptive-Grid (MRAG)[Rossinelli 2015] which allows fast execution thanks to parallel processing and adaptive grid refinement. The user can control the grid resolution, parallelization, and level of refinement, which is described in this section.

Main idea

As shown in the Fig. 1., the simulation domain consists of blocks, which are processed in parallel. The resolution of the individual blocks changes adaptively, so the finest grid resolution is kept only in the blocks that in the given time contain the quantity of interest, here the tumor cell density, while the resolution of the remaining blocks is compressed to accelerate the computation (see Fig. 3). The grid is adaptively refined and compressed to ensure high accuracy together with high performance. Different levels of grid refinement are sketched in Fig. 2.


Grid handling

The file GliomaSolver/makefile/Makefile contains 4 parameters that can be used to control the grid behavior:

  • dim = grid dimension (supports 2D and 3D)
  • bpd = blocks per dimension (for ideal performance should scale with the number of processors)
  • bs = block size, i.e., the number of grid points per block (for the best refinement should be a power of two)
  • resjump = maximum allowed jump(s) in the resolution between two neighboring blocks

The setup shown below corresponds to a 3D grid, with resolution 128 grid points per dimension and the maximum allowed jump in the resolution between two neighboring blocks is 1.

#---------MRAG grid parameters-----------


INPUT DATA: The GliomaSolver accepts the input anatomy (e.g. segmentation of white matter) in the form of a 3D matrix in the .dat-format. The folder GliomaSolver/tools/DataProcessing/source/ contains matlab scripts for converting data from/to .dat format:

  • writeMatrix.m = write input matrix into .dat format
  • loadMatrix.m = load a matrix in .dat format
  • nii2dat.m = converts nifty file(s) to .dat
  • dat2nii.m = converts .dat file(s) to nifty

The last two scripts can be applied to a single file or a folder with multiple data. These scripts can be used to convert desired anatomy (extracted from scans or created in other software) into GliomaSolver input format. In the future, the solver might be extended to work directly with the nifty data.

OUTPU DATA: The GliomaSolver outputs data in two formats: .dat and .vtu. The .dat data contains 3D matrix with the tumor cell density at uniform resolution, which can be converted to nifty with the above scripts. The .vtu contains multiple data, stored as channels in unstructured grid. The number of channels depends on the selected tumor model, while the list below shows content stored in each channel:


  • channel0 = tumor cell density
  • channel1 = tumor cell density + 0.1 * white-matter + 0.2 * gray-matter
  • channel2 = white matter [%]
  • channel3 = gray matter [%]
  • channel4 = csf [%]
  • channel5 = cell density of white matter
  • channel6 = cell density of gray matter
  • channel7 = cell density of csf
  • channel8 = x-component of tissue displacment vector
  • channel9 = y-component of tissue displacment vector
  • channel10 = z-component of tissue displacment vectory
  • channel11 = intracranial pressure
  • channel12 = brain mask
  • channel13 = pressure source for the deformation model
  • channel14 = phase-field function (used for the Diffuse domain approach in the deformation model)

Data Visualisations: The above mentioned data can be visualised with the following tools:

  • nifty -> ITKsnap
  • .dat -> can be loaded to MATLAB with loadMatrix.m script
  • .vtu -> ParaView (can visualise multiple channels + 3D rendeding). Figure 3 shows channel2 rendered with the ParaView.

Application to other types of tumors

The GliomaSolver is developed mainly for modelling infiltrative brain lesions, however, it can be applied to other types of infiltrative tumors in complex or simple anatomies. In the simplest case, one just need to replace the default brain anatomy by the desired one (e.g. bone CT) and tune the model parameters for the specific case.


The GliomaSolver is written with an extensibility in the mind. All the used numerical operations (i.e. Laplace, gradient, time integration…) are implemented as independent operators, which can be arbitrarily combined to solve a given system of partial differential equations. This facilitates development and implementation of new tumor models. Moreover, it is possible to add own operators. The provided operators are stored in GliomaSolver/Glioma/Operators/.

The GliomaSolver development is published on Github. All the code is versioned through git repositories.