# EPTlib: An Open-Source Extensible Collection of Electric Properties Tomography Techniques
## 2 Software Architecture
### Terminal Application  
The terminal application _EPTlib_app_ allows to apply the EPT techniques implemented in the library in a simple way, without the need to know neither the entire library architecture nor the library interface. _EPTlib_app_ is controlled by a TOML configuration file ([[https://toml.io](https://toml.io)]([https://toml.io](https://toml.io))) that manages the program settings.  
```
1:title = \"Example\"
2:description = \"Brief description of the case study\"
3:method = x
4:[mesh]
5:size = [81, 104, 21]
6:step = [2 \(\times 10^{-3}\), 2 \(\times 10^{-3}\), 2 \(\times 10^{-3}\)]
7:[input]
8:frequency = 64e6
9:tx-channels = 2
10:rx-channels = 4
11:tx-sensitivity = \"in.h5:/tx_sens>\"
12:tx-phase = \"in.h5:/tx_phase><\"
13:wrapped-phase = false
14:[input.wildcard]
15:tx-character = '>'
16:rx-character = '<'
17:start-from = 0
18:step = 1
19:[output]
20:electric-conductivity = \"out.h5:/sigma\"
21:relative-permittivity = \"out.h5:/epsr\"
```  
**Configuration File 1** Common settings for _EPTlib_app_  
The configuration file has a number of settings common to all the EPT techniques and a parameter section that depends on the selected technique. The common settings, collected in the example Configuration File 1, are described in the following. The first three lines of Configuration File 1 are for basic setups:  
* **title** and **description** provide a brief description of the case study.  
* is an integer value that selects the EPT technique to use according to the following list: 0 for Helmholtz-EPT, 1 for convection-reaction-EPT and 2 for gradient-EPT. The section _mesh_ describes geometrically the input three-dimensional images:
* is the number of voxels of the input data in the three dimensions.
* is the length in meters of the voxels in the three dimensions. The section _input_ defines the input data:
* is the Larmor frequency in hertz of the input data.
* and **rx-channels*
* are the number of Tx and Rx channels in the input data, respectively. They must assume values in certain ranges depending on the adopted EPT technique.
* and **tx-phase*
* are the addresses of the Tx sensitivity \(|B_{1}^{+}|\) and the TRx phase \(\varphi^{\pm}\) datasets in suitable HDF5 files. The address is provided as a string in which the HDF5 file address is separated from the internal dataset identifier by a colon. Moreover, in case of multiple Tx channels, the wildcard character '>' can be used to distinguish the data from each channel. It will be replaced by an increasing integer number from zero up to the number of Tx channels minus one. Similarly, the wildcard character '<' is used for multiple Rx channels. Thus, the string \"in.h5:/trx_phase\(>\)\(<\)\" denotes the datasets \"/trx_phase00\", \"/trx_phase10\", \"/trx_phase01\", \"/trx_phase11\", \"/trx_phase02\" and so on in the file \"in.h5\".
* is true if the input TRx phase maps are wrapped. This setting is optional and false by default. The optional section _input.wildcard_ can be used to change the wildcard characters for the input address definition:
* and **rx-character*
* are the above-mentioned wildcard character. By default '>' and '<', respectively.
* is the integer number from which the wildcard character replacement starts. By default 0.
* is the integer step in the wildcard character replacement. By default it is 1. Lastly, the section _output_ defines the output addresses:
* and **relative-permittivity*
* are the addresses of the datasets in HDF5 files in which the electric conductivity \(\sigma\) and the relative permittivity \(\varepsilon_{\tau}\) estimated by the EPT technique will be stored, respectively. The address is provided as a string in which the HDF5 file address is separated from the internal dataset identifier by a colon. Thus, the string \"out.h5:/sigma\" denotes the dataset \"/sigma\" in the file \"out.h5\". For an up-to-date description of the configuration file settings, check the website of _EPTlib_, [[https://eptilib.github.io](https://eptilib.github.io)]([https://eptilib.github.io](https://eptilib.github.io)).