IMAGE RECONSTRUCTION AND BLADDER STIMULATION USING ELECTRICAL IMPEDANCE TOMOGRAPHY REKONSTRUKCJA OBRAZU I STYMULACJA PĘCHERZA MOCZOWEGO Z WYKORZYSTANIEM ELEKTRYCZNEJ TOMOGRAFII IMPEDANCYJNEJ

Impedance tomography (EIT) is an imaging technique that harnesses differences in electrical conductivity to visualize the interior of objects. Despite limitations such as low resolution and nonlinearity of current distribution, its potential in medicine and industry is a source of fascination. The research in this work is a step towards unlocking this potential, focusing on improving the quality of EIT image reconstruction, particularly in bladder modeling. A key element is regularization techniques, including Laplace matrices and the iterative Gauss-Newton algorithm, which balance matching accuracy and image smoothness. In the practical part, simulations were conducted on dense and sparse meshes. Modeling the urinary bladder as a rotational ellipse significantly influences the interpretation of data by algorithms, a crucial factor for the accuracy of reconstruction. Various electrode configurations were also analyzed, revealing the impact of their arrangement on electrical properties and imaging quality. Iterative testing led to identifying optimal electrode placement and grid configuration, underscoring the importance of precise modeling for obtaining high-quality images. The results underscore the critical role of appropriately selecting the regularization parameter in minimizing reconstruction errors.


Introduction
Electrical impedance tomography (EIT) is a visualization technique based on differences in the electrical properties of various materials, including biological tissues (Rymarczyk et al., 2019Kłosowski et al., 2017).In this process, a current or voltage source is connected to the object, and the current or voltage is observed to be distributed on its surface.This information is then analyzed by a specialized algorithm that recreates the image of the object.Electrical impedance tomography is characterized by a relatively low resolution, primarily due to the limited number of available measurements, the non-linear nature of the current flow through the tested medium, and the insufficient sensitivity of measuring devices to changes in conductivity in the tested area (Dunne et al., 2018).
From a mathematical perspective, electrical tomography is considered one of the problems in inverse electromagnetic fields.These problems involve identifying, optimizing, or synthesizing parameters that describe a given field based on specific information.Inverse problems are notoriously difficult to solve because they often have no clear answers and are characterized by weak conditioning.These problems may result from too much or too little data, which may be inconsistent or linear (Leron et al., 2018;Rodríguez et al., 2013).
Inverse problems are known for rarely offering clear-cut solutions and typically having weak starting conditions as a result of having data that may be contradictory or incomplete.Tasks are said to be undefined in cases where there is insufficient data, while in situations where there is too much data, the tasks become too detailed.The inverse problem is formulated when no key information about the analyzed area, such as boundary conditions.To achieve a clear solution, it is necessary to have additional data, such as the potential distribution.The type of missing data is often a criterion for classifying inverse problems, which considers the examined object's physical parameters.Inverse problems can be defined based on various aspects such as boundary conditions, source function, area geometry, and material factors (Rymarczyk et al., 2021;Rymarczyk et al., 2019).

Development of algorithms and methods for preliminary reconstruction analysis from measurement data for an embedded system
Developing algorithms and methods for preliminary reconstruction analysis from measurement data for an embedded system includes developing mathematical equations.

Solving a simple problem
We consider the equation: (1) with Robin boundary conditions: (2) where φ -potential on the tested object, σ -conductivity, U l -potential on the l -th electrode.
We use the finite element method to solve the equation.We are looking for a functional of the form power.
A functional for equation (1) has been considered: (3) Ω -area of the entire finite element mesh, Γ -curve describing the edge of the mesh area containing electrodes, z l -contact impedance of l -this electrode, ∈ {1, 2, … N electrode }.
After calculating the appropriate integrals, we obtain the state matrix H, which satisfies the equation.
R. PIETRZYK, M. MAZUREK, J. CHAŁDAŚ-MAJDAŃSKA We will obtain the potential at the nodes by solving the state equation for specific stimulations.Using the potential in the nodes and a particular measurement pattern, we will obtain a solution to a simple problem.

Determining the sensitivity matrix
The solution to the inverse problem comes down to determining the sensitivity matrix. (5 Where ϕ is the potential at the nodes for stimulation electrodes, and ψ is the potential at the nodes for measurement electrodes.
We assumed interpolation of the potential on the element with basis functions N i We consider different ways to minimize the solution error depending on the method.For the method with Tikhonov regularization, we consider minimization.
(7) where σ 0 initial conductivity distribution.The method itself requires the use of SVD (singular value decomposition) of the sensitivity matrix.Solution: where the matrices U and V are orthonormal and the matrix Σ is a diagonal matrix with singular values on the diagonal.Solution: (9) where: i-th column of the matrix UVΣ i -i-th diagonal element of the matrix Σ, λregularization parameter.

Solving the inverse problem -defining the objective function
The sensitivity matrix is a linear approximation of the function P -(σ) = ΔU, P -(σ) = ΔU.The solution to the inverse problem consists in determining σ from the equation Ms .σ = B.
We consider different ways to minimize the solution error depending on the method.For the method with Tikhonov regularization, we believe the minimization of the objective function: (10) where σ 0 initial conductivity distribution.The method itself requires the use of SVD (singular value decomposition) of the sensitivity matrix.Solution: (11) where the matrices U and V are orthonormal and the matrix Σ is a diagonal matrix with singular values on the diagonal.Solution: (12) where: i-th column of -the matrix UWΣ i -i-th diagonal element of the matrix Σ, λregularization parameter.

Mesh modeling for image reconstruction from the urinary bladder
The electrode modeling process begins by finding points on the grid that are closest to the predicted electrode centers.These points constitute the key nodes from which further construction of the electrode structure begins.Points immediately adjacent to these key nodes are then identified.This operation allows you to create appropriate space around each electrode, which is essential for the precision of the model.The next step is to remove the initially identified points closest to the electrode centers, which the exact electrode centers replace.This change ensures that the electrodes are placed as precisely as possible.Once this replacement is made, any mesh connections that could interfere with proper electrode placement are removed.After reconfiguring the central points of the grid, the remaining points forming the electrodes are added.These additional points are necessary to construct the entire structure of the electrodes, ensuring their proper functioning in the model.Then, using the gmsh.fltk.run a function from the Gmsh software; connections are made between the grid points and the electrodes, which allows visualization of the final structure of the electrodes.The final step is to add connections to the entire mesh and generate the final mesh structure.This finalizes creating an electrode model ready for use in bladder image reconstruction simulations (Fig. 1).A function was used to reduce the number of points lost to electrodes.The function classifies the given points into N_new classes using kmeans.N_new is taken as a percentage of the points considered or is an integer.They have a designated classification; as a class representative, we take the arithmetic mean of the elements assigned to the class.A system representing each electrode by 6 points was selected by trial and error.Measurements for uniform distribution for dense and sparse meshes are shown in Figure 2. Building a mesh model for the electrical impedance imaging technique (EIT) begins with loading an STL file containing the modeled object's necessary geometry.This file is standardly used in 3D printing and simulations, facilitating data integration and transfer between different platforms and tools.Once the file is loaded, the stage of understanding its structure begins.Identifying the location of mesh elements, points, and other parameters necessary for proper modeling is crucial.This knowledge allows for precise planning of further steps in the mesh creation process.We then define the tasks to build the mesh using the Gmsh library.This software allows for efficient geometry modeling and mesh generation.As part of this process, it is crucial to close off areas such as the limbs and waist to create consistent and tight structures within the model.Determining the areas where electrodes will be placed is critical to simulating the electrical processes that are the essence of EIT.Once these areas have been identified and designed, removing any unnecessary elements and points from the electrode and closed areas is necessary, which increases the clarity and efficiency of the final mesh.The task is also to define closed bodies as specific mesh areas that will be treated as integral parts of the model, ensuring its correct structure and functionality.In the next modeling steps, the eit_3D model is built, where a dense mesh is initially created, representing a simple problem.Then, using the PyMesh library, the mesh is reduced to several elements not exceeding 10,000, which is a model of the inverse problem.In this context, the sparseness of the dense mesh and electrodes requires special attention to ensure that all relevant information is retained while making the model more efficient and suitable for research needs.After combining these two meshes, the final eit_3D model is ready for simulation and analysis.
Determining the electrode area required particular precision, mainly due to differences in the density of the two analyzed meshes.The main problem was the lack of overlap between the points on the grid containing the electrodes and those on the grid covering the waist and legs area.This precluded simple assignment and correlation of points between these areas.To meet this challenge, principal component analysis (PCA) was used, which allowed the extraction of 16 distinct classes from the grid containing electrodes.After determining the class, we began to determine the central points of each electrode and define their areas with a radius of 2.5 units.
Several different approaches have been tried to solve this problem.The first involved determining and assigning appropriate elements from the existing mesh directly to the electrode.Another method used was to designate the edge of the electrode area, remove the internal mesh elements, and then create a flat surface in its place.Another approach is to create a boundary area and then connect and smooth it using B-splines and Plane Surface.The last of the tested solutions was to construct the edge of the region, add a central point S and designate triangles with a common center S, making it possible to define the electrode areas precisely.Each of these approaches aimed to optimize and improve the process of defining electrode areas, adapting the method to the specific data and technical requirements.The visualization of the electrodes is shown in Figure 3. Building an eit_3D (electrical impedance tomography) model for different meshes is a significant challenge, especially when using dense and sparse meshes.This model contains 43,666 nodes and 204,562 tetrahedral elements, which enables a detailed analysis of the internal space of the tested object (Fig. 4).Work on the model began with the implementation of simulation on a dense mesh, considered a simple problem due to its high resolution and lower risk of errors in image reconstruction.Then, the model was configured for a sparse mesh, which was treated as the inverse problem.Due to the smaller number of elements and the greater spacing between them, additional challenges related to the mapping accuracy arise.The model simulated uniform distribution using polar electrode excitation and measurements between adjacent electrodes.This setup allows for system performance evaluation under controlled conditions, which is crucial for model verification and its subsequent applications in practical medical or industrial applications, where the accuracy of locating and characterizing changes in conductivity may be critical.Combining two meshes in the eit_3D process modeling involves several key steps that allow the electrode regions to be effectively integrated into the main mesh of the model.Thisww process begins with identifying the central points of the electrodes, which serve as reference points for further operations.
The next step is to search for the points in the first grid that are closest to the designated electrode centers.These points are then replaced by electrode centers, allowing the electrode areas to be directly connected to the rest of the mesh.After performing this conversion, it is necessary to precisely determine the angles in the triangles that contain these newly introduced points.Additionally, angles in triangles specific to the electrode structure are defined, which is crucial for maintaining the geometry and properties of the electrode in the model.On this basis, elements connecting the electrodes with the first mesh are built, which is the final stage of integration.In this process, two cases of electrode configuration relative to the first grid exist.In the first case, at least one neighbor disconnects the electrodes from the first grid, which IMAGE RECONSTRUCTION AND BLADDER STIMULATION USING ELECTRICAL IMPEDANCE TOMOGRAPHY may affect the insulation of the electrodes and change the local conductivity properties.The second case is where the electrodes are not disconnected even by one neighbor from the first grid, ensuring continuity and uniformity of connection, which is preferred to maintain consistency in the simulation of the electrical properties of the model.
Each of these cases requires a specific approach to the construction and configuration of the mesh to ensure optimal operation of the eit_3D model and precision in tomographic image reconstruction (Fig. 5).

Optimization of regularization parameter and reconstruction methods in modeling using different meshes
We model the urinary bladder as a rotational ellipse with the equation Image reconstruction using the Laplace matrix combined with the iterative Gauss-Newton algorithm is a key in modeling objects with complex shapes and properties, such as the urinary bladder.The Laplace matrix is used to stabilize the inverse problem, particularly when using the Gauss-Newton algorithm, which is susceptible to inumerical instability and IMAGE RECONSTRUCTION AND BLADDER STIMULATION USING ELECTRICAL IMPEDANCE TOMOGRAPHY improve the quality of the reconstruction, and various iterative methods were used.Ultimately, the selected Gauss-Newotn iterative algorithm with an appropriately selected regularization parameter allowed the best data availability and quality results to be obtained.These results highlight the importance of appropriately selecting reconstruction methods and regularization parameters, especially when working with sparse meshes, which may be more susceptible to artifacts and reconstruction errors.Selecting the most practical combination of method and regularization parameter is essential to achieve optimal image quality and reliability of medical interpretation (Fig. 7).

Conclusions
Electrical Impedance Tomography (EIT) is fundamentally challenged by its relatively low resolution, primarily due to the limited measurements available, the nonlinear nature of electrical current flow through the medium, and the insensitivity of measurement devices to changes in conductivity within the test area.These aspects significantly affect the precision and accuracy of the technique in reconstructing images of internal structures, such as the urinary bladder.In practical applications, particularly in modeling the urinary bladder, EIT involves intricate procedures like stabilizing the inverse problem using the Laplace matrix and iterative reconstruction algorithms like Gauss-Newton.The selection of an appropriate regularization parameter is critical in balancing the fit accuracy against the solution's smoothness, which is crucial for mitigating potential artifacts and inaccuracies due to the limitations above of EIT.Integrating different mesh types for electrode configuration reveals a nuanced understanding required to manage the discrepancies between dense and sparse mesh setups.The proper alignment and configuration of electrodes on the mesh significantly influence the fidelity of the reconstruction output.Cases where electrodes are either connected or disconnected by elements from the mesh impact the model's electrical properties and, ultimately, the image reconstruction quality.While EIT offers significant potential for non-invasive imaging, the complexities involved in its mathematical underpinnings and practical implementations necessitate ongoing refinement of techniques and methodologies.The development of more sophisticated algorithms and the selection of optimal regularization parameters are imperative to enhance the reliability and accuracy of this imaging modality, particularly in medical applications where precision is crucial.
the variables ξ,η -and determining the rows of the sensitivity matrix, we can begin to determine the solution to the inverse problem.The sensitivity matrix is a linear approximation of the function P -(σ) = ΔU, Ms .σ = ΔU.The solution to the inverse problem consists in determining σ from the equation Ms .σ = B.

Figure 1 .
Figure 1.Sparse mesh model (a) and tensions simulated on a sparse mesh with uniform distribution (b)

Figure 2 .
Figure 2. 3D mesh EIT panties -model (a) and measurements for uniform distribution for dense and sparse meshes (b)

Figure 3 .
Figure 3. Visualization of electrodes (a) the first (b) the second (c) the third (d) and the fourth approach

Figure 4 .
Figure 4. Dense model (a) and simulation on a uniform distribution (b)

Figure 5 .
Figure 5. Mesh without electrodes (a) and Points constituting the electrodes (blue dots), points from the first grid that are neighbors of the closest points (green stars), points nearest to the centers of the electrodes (orange x) (b)

Figure 7 .
Figure 7. Urinary bladder reconstruction for sparse mesh (previous model of electrode placement)