Many new and experimental treatment methods in medical applications use magnetic nanoparticles as a contrast agent. These particles allow for multiple different approaches (see [Hiergeist et al., 1999, Alexiou et al., 2011]), however for the named methods the exact knowledge about the particle distribution is crucial. Here, Magnetorelaxometry (MRX) can be used to determine the amount of particles in a region of interest as shown in [Baumgarten et al., 2008, Liebl et al., 2014]. Based on this approach an imaging technique called Magnetorelaxometry Imaging (MRXI) has been proposed.
The SiMRX toolbox provides a set of tools to model and simulate such an MRX system. It is based on the mathematical model developed in [Föcke et al., 2018].
This following subsection (including notation) is part of [Föcke et al., 2018], which, for interested readers, provides an in depth look in the analysis of the following operator. The magnetic field in induced by a coil is given by
where is the length of the coil. The magnetization of the magnetic nanoparticles (MNP) after the reorientation process in is described by
where is the desired particle distribution. The particle induced magnetic response from particles in measured by a sensor is modeled by
In the end we receive the following forward operator for a coil :
First we consider the 3D case: Here the conductor coil is approximated by a set list of segments, with starting points and ending points for the -th segment respectively. Then the magnetic field in is [Hanson and Hirshman, 2002]:
For the MNP response equation (3) still holds in the discrete case.
The SiMRX toolbox is a modular toolkit that has separate functions which are necessary for a successful simulation of an MRX experiment. SiMRX is capable of simulating synthetic or real setups and datasets.
The simulation tool runs a sequence of modular functions that subsequently handle the creation of a voxel grid, the calculation of the coil activation fields and the data acquisition at the sensors. See subsection 3.1 for a detailed description of the simulation step and relate to Figure 1 for an illustration of the simulation process.
For the simulation of an MRX experiment a setup and config file are required. The setup file includes information about the number of dimensions, coil position and shape (and, if necessary, orientation), sensor position and orientation, as well as intervals that define the region of interest. The config file includes information about the resolution of the phantom within the region of interest and a coil activation pattern. Both files are forwarded to the simulation script, that return a matrix representation of the given setup and configuration. Detailed information on the creation of setup and config file can be found in subsection 3.3.
The SiMRX toolbox is separated in the following submodules (each in its own subfolder):
./simulation ./visualization ./configuration ./phantom
We give a short overview of each module in the upcoming subsections. The syntax to use the specified functions is found in a help section at the beginning of each file. We recommend the MATLAB help function (F1) for more information about features and syntax of any module/function that comes with SiMRX .
The simulation module is the core element of the toolbox. All necessary files can be found in the subfolder ./simulation. The main script is provided by the file createSystemMatrix.m. It processes a given MRX setup and a coil configuration into a linear operator, namely a matrix A. It requires a valid setup file that provides dimension information, region of interest, coil position and orientation, as well as sensor position and orientation. Furthermore voxel/pixel resolution within the region of interest and coil activation schemes are provided by a config file. Internally createSystemMatrix.m calls the functions createSystemMatrixRaw.m and subsequently applyCoilSequence.m. The internal processes, variables and function arguments are illustrated in Figure 1.
At first, createSystemMatrixRaw.m calls createVoxelGrid.m, which creates a valid voxelGrid. This voxel grid combines the desired resolution (config.res) with the demanded region of interest (setup.roi). Then createMagneticFields2D.m and createMagneticFields3D.m, respectively, are called to apply a uniform basic current to each given coil (setup.coils). The magnetic fields induced by theses coils are derived on the provided voxelgrid and are stored for each coil individually. Finally createDipoleFields.m translates the fields present on the voxel grid into a magnetization. Then it derives the resulting magnetic response, which is acquired by the sensors (setup.sensors), for each coil separately in a temporary system matrix ARaw. The set of operators ARaw is finally returned by createSystemMatrixRaw.m.
To this point only a uniform coil activation current is used. Due to the linearity of this forward propagation, we can apply an arbitrary coil activation sequence by using applyCoilSequence.m. This derives a linear combination of the temporary system matrices ARaw and creates a linear operator A.
It is possible to trigger each step separately, such that one can investigate the effects of different coil activations without repeating the whole simulation for each new activation pattern.
SiMRX provides tools to visualize the region of interest, coils and sensors. The function visualizeSetup.m combines named visualization functions to create a representation of a full MRX setup. We recommend the usage during the creation of a new MRX setup, since it uses only the setup file and does not require the simulation of a given setup.
Furthermore the function visualizeField.m provides a tool to visualize the magnetic fields induced by the activation coils. It uses the magnetic fields created by createMagneticFields2D.m and createMagneticFields3D.m, respectively, during the simulation process. A combination of visualizeSetup.m and visualizeField.m is given by visualizeCoilActivation.m. This function allows to scroll through each coil activation subsequently.
This module provides a set of functions to create setup and config files.
3.3.1 Setup file
setup files are structs in MATLAB. They hold the following fields
dim, roi, coils, and sensors.
SiMRX supports 2D and 3D systems, therefore setup.dim is either 2 or 3. The region of interest setup.roi is a struct with fields x, y and z, that holds boundary information in an array, e.g. setup.roi.x = [0,10]. Yet again setup.coils and setup.sensors are arrays of structs with fields:
coils(i).Position, sensors(i).Position, coils(i).Normal, sensors(i).Normal, coils(i).Segments,
where is the -th coil/sensor. For the fields Position and Normal
a three element vector is used.
To add new coil and sensor entries to the setup, the functions addCoilArray.m and addSensorArray.m can be used. In the current version both functions take two points, a normal and a number of repetition. Then addCoilArray.m adds a list of equidistant points, that represent the coil position, as well as the coil normal to the given setup (sensors analogously).
In the 3D case the coil wire is modeled by a list of points, which represent the coil shape. The function createCoilLoop.m creates a coil template. This template of a coil now has to be positioned at all coil positions. The function parseCoils.m receives a coil struct (with fields Position and Normal) and adds the Segments field in respect to the given coil template. Internally this uses the function relocateStructure.m that reorientates a given list of points.
In case a voxel grid is given, the corresponding region of interest can be determined using getROI.m. During the creation of a new setup the usage of visualizeSetup.m is recommended.
3.3.2 Config file
config files are, similar to setup files, structs in MATLAB. They hold the fields
res, and coilSequence.
The simulated voxel resolution of the region of interest is given by a three element array and stored in res.
The coil activation sequence is stored in a matrix with one column for each coil. Each row represents the activation scheme where the entries refer to the respective coil activation current. The function addCoilSequence.m provides standard patterns and multiple other presets.
3.3.3 Save and Load
The setup and config structs can be stored using saveSetup.m and saveConfig.m. These are stored using a custom .mrxsetup and .mrxcfg extension, that is based on the MATLAB internal .mat file format. Corresponding load functions (loadSetup.m and loadConfig.m) are available.
The function createPhantom.m provides multiple phantom options, including phantoms suited for reconstruction or resolution tests. createPhantom.m uses the function phantom3.m, which is a 3D reimplementation of the MATLAB given phantom function and able to generate 3D phantoms that are composed of multiple ellipses. For all available phantoms, please check the help section of createPhantom.m and phantom3.m. See Figure 3 for a small selection of the available phantoms.
This simulation toolbox does not guarantee its correctness and closeness to reality. SiMRX is not qualified for commercial usage.
- [Alexiou et al., 2011] Alexiou, C., Tietze, R., Schreiber, E., Jurgons, R., Richter, H., Trahms, L., Rahn, H., Odenbach, S., and Lyer, S. (2011). Cancer therapy with drug loaded magnetic nanoparticles—magnetic drug targeting. Journal of Magnetism and Magnetic Materials, 323(10):1404–1407. Proceedings of 12th International Conference on Magnetic Fluid.
[Baumgarten et al., 2008]
Baumgarten, D., Liehr, M., Wiekhorst, F., Steinhoff, U., Münster, P.,
Miethe, P., Trahms, L., and Haueisen, J. (2008).
Magnetic nanoparticle imaging by means of minimum norm estimates from remanence measurements.Medical & Biological Engineering & Computing, 46(12):1177.
- [Föcke et al., 2018] Föcke, J., Baumgarten, D., and Burger, M. (2018). The inverse problem of magnetorelaxometry imaging. Inverse Problems, 34(11):115008.
- [Hanson and Hirshman, 2002] Hanson, J. D. and Hirshman, S. P. (2002). Compact expressions for the biot–savart fields of a filamentary segment. Physics of Plasmas, 9(10):4410–4412.
- [Hiergeist et al., 1999] Hiergeist, R., Andrä, W., Buske, N., Hergt, R., Hilger, I., and Kaiser, W. (1999). Application of magnetite ferrofluids for hyperthermia. Journal of Magnetism and Magnetic Materials, 201(Issues 1-3):420–422.
- [Liebl et al., 2014] Liebl, M., Steinhoff, U., Wiekhorst, F., Haueisen, J., and Trahms, L. (2014). Quantitative imaging of magnetic nanoparticles by magnetorelaxometry with multiple excitation coils. Physics in Medicine & Biology, 59(21):6607.