# Computation of ultimate basis sets in realistic body models

### Citation

Bastien Guerin, Jorge F Villena, Athanasios G Polimeridis, Elfar Adalsteinsson, Luca Daniel, Jacob White and Lawrence L Wald (2014). "The ultimate SNR and SAR in realistic body models". Annual meeting of the International Society for Magnetic Resonance in Medicine. Milan, Italy.

Bastien Guérin, Jorge F. Villena, Athanasios G. Polimeridis, Elfar Adalsteinsson, Luca Daniel, Jacob K. White, Bruce R. Rosen and Lawrence L. Wald (2016). "Ultimate hyperthermia: Computation of the best achievable radio-frequency hyperthermia treatments in non-uniform body models". Annual meeting of the International Society for Magnetic Resonance in Medicine. Singapore.

### What this code does

This code contains the Matlab scripts and MARIE routines that are required to compute basis-set in non-uniform body models as described in the citations above. MARIE is a freely available ultra-fast volume integral solver. You may download it separately or as part of the basis-set package linked below. Downloading the latest version of MARIE will ensure that you are using the fastest/lastest/most bug-free version of the software, however I do not guarantee that it will interface perfectly with the ultimate basis-set scripts. The MARIE routines included in the package linked below may be a bit "old", but they interface with the ultimate basis-scripts without errors.

### Computer requirements

Ultimate basis-set computations are usually long (at least 24 hours for a simple model to a few days for complex models or high frequencies -- see the citations above). Therefore to run this code, I recommend the following computer requirements (these are a not strictly speaking required... You may try the simulation on a slower computer and pray that it works or simply wait longer!):

- RAM: At least 64 GB
- CPUs: At least 8 cores
- GPU: A GPU is required for this application, which is used to accelerate MARIE. Without the GPU, computation times will really become large for basis-set with a 2000 basis vectors. I reocmmend using at least a Tesla K20.

### Download files

The ultimate basis-set computation code can be downloaded here.

### Instructions

#### Transient simulations

To run a simple example, go to the sub-folder SEMCAD_validation/Simu_1_Results and run the script "semcad_vs_pbhs.m". This runs a comparison of the transient solver with SEMCAD. This script should make it clear how the code is run. The input to the code are, in this order:

- T0: The initial temperature map (can be non-uniform) in K
- DUR: The total duration of the simulation in s
- [dx dy dz]: A 1x3 Matlab vector with the x, y and z spatial resolutions in m
- RHO: The density map (can be non-uniform) in kg/m^3
- C: The heat capacity map (can be non-uniform) in J/kg/K
- K: The thermal conductivity map (can be non-uniform) in W/m/K
- Wb: The blood perfusion map (can be non-uniform) in kg/s/m^3
- Cb: The blood heat capacity in J/kg/K
- Tb: The blood temperature in K
- Q: The heat rate generation map (i.e., SAR*RHO which can be non-uniform) in W/m^3

#### Steady state simulations

To run a simple example of the steady-state simulation, go to the TEST_SteadyState/ folder and run "TEST_SS.m". Again, the way to run the code should be straightforward. The input to the steady-state function are similar to the input to the transient solve function, except obviously the duration is not needed.