Alberto Boschetti, Luca Massaron - Python Data Science Essentials - Learn The Fundamentals of Data Science With Python-Packt Publishing (2015)
Alberto Boschetti, Luca Massaron - Python Data Science Essentials - Learn The Fundamentals of Data Science With Python-Packt Publishing (2015)
SoftwareX
journal homepage: www.elsevier.com/locate/softx
article info a b s t r a c t
Article history: We present a Python-based, open source Electrical Impedance Tomography (EIT) library called pyEIT. It is a
Received 25 July 2018 multiplatform software released under the Apache License v2.0. pyEIT has a clean architecture and is well
Received in revised form 19 September 2018 documented. It implements state-of-the-art EIT imaging algorithms and is also capable of simple 2D/3D
Accepted 19 September 2018
meshing. pyEIT is written in Python. It accelerates the analysis of offline EIT data and can be incorporated
Keywords: into clinical EIT applications. In this paper, we focus on illustrating the fundamental design principles of
Electrical Impedance Tomography pyEIT by using some intuitive examples about EIT forward computing and inverse solving.
Inverse problems © 2018 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY license
Finite element method (http://creativecommons.org/licenses/by/4.0/).
Unstructrual mesh
Code metadata
Current code version 1.0.0
Permanent link to code/repository used for this code version https://github.com/ElsevierSoftwareX/SOFTX_2018_114
Legal Code License https://github.com/liubenyuan/pyEIT/blob/master/LICENSE.txt
Code versioning system used git
Software code languages, tools, and services used Python and the following Python packages: numpy, scipy, matplotlib, pandas
Compilation requirements, operating environments & dependencies Linux, Windows, Mac OS
If available Link to developer documentation/manual https://github.com/liubenyuan/pyEIT/tree/master/examples
Support email for questions [email protected]
1. Motivation and significance of cerebrospinal fluid [9] create a shielding effect where only a
small amount of current applies on the cerebral. But brain EIT is
Electrical impedance tomography (EIT) is a low-cost, also life-saving. For example, the early identification of cerebral
non-invasive, radiation-free imaging method [1,2]. It is sensitive injuries [10] is of great value to clinical surgeons. To advance
to the changes of internal electrical properties, which has potential the development of brain EIT, we need to conduct large-scale 3D
in bedside monitoring during hospital care. Nowadays, lung EIT [3] finite element (FE) simulations, implement various sophisticated
and brain EIT [4] are two major clinical research directions. In lung EIT imaging algorithms and process a large amount of in-vivo data
EIT, the ventilation and perfusion distribution in the thorax are in a closed loop.
imaged and evaluated in real-time [3]. In brain EIT, the pathological In this paper, we propose a Python-based EIT simulation and
intracranial changes, such as haemorrhage [5], ischemia [6] or imaging framework called pyEIT. pyEIT ties the backend such as
infarction [7], can be continuously monitored and imaged using Finite Element Method (FEM) simulation, EIT inverse solving and
EIT. Most of the latest brain EIT researches are limited to phantom imaging to the frontend applications. It may accelerate the evolu-
models or animal studies. in-vivo brain EIT is hard. The size of tion of in-vivo EIT studies.
the skull is large, and the internal structure is complex. Moreover, Recently, we have used EIT in-vivo in cerebral imaging and
the high resistivity of the skull [8] and the high conductivity monitoring during total aortic arch replacement [10]. The imaging
speed of EIT is one frame per second. The data in [10] contain
∗ Corresponding author. 42 subjects where the overall length is approximately 160 h. We
E-mail address: [email protected] (F. Fu). constructed a pipeline processing where data filtering, meshing,
https://doi.org/10.1016/j.softx.2018.09.005
2352-7110/© 2018 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/).
B. Liu et al. / SoftwareX 7 (2018) 304–308 305
Fig. 1. The software architecture of pyEIT. pyEIT consists of 3 parts: meshing, solving forward and inverse problem. Blue texts denote corresponding Python modules.
The fem module solves the forward problem of EIT. The mathe-
matic model of EIT is formulated as a boundary value problem,
∇ · (σ ∇ u) = 0, in Ω
∂ u ⏐⏐
⏐
σ =g
∂ n ⏐∂ Ω
∫
u=0
∂Ω
Fig. 3. Triangle meshes on a unit circle using the distmesh2d and a standard layered circle meshing method. The electrodes are highlighted using red nodes.
layer_circle are used. These functions return two objects, the first
one is the mesh structure, which is a named tuple with ’node’,
’element’ and ’perm’. In 2D, node is a N × 2 matrix specifies the
xy coordinates of nodes, element is an M × 3 matrix describes the
connectivity structure of the mesh. The second one is el_pos which
specifies the numbered locations of the electrodes (see Fig. 3).
mesh0 , el_pos0 = create ( n_el =16)
mesh1 , el_pos1 = l a y e r _ c i r c l e ( n_el =1 , n_fan =8 ,
n_layer =8)
xy = mesh0 [ ’ node ’] # Nx2 matrix
t = mesh0 [ ’ element ’] # Mx3 matrix
3.3. Solving EIT inverse problems monitoring the status of the brain non-invasively during cardio-
vascular surgeries [10]. The data consist approximately 160 hours
In the following, we present examples of dynamic EIT imaging. recordings and are processed using pyEIT. We evaluated various
Dynamic EIT uses two frames and reconstructs the changes in the image segmentation algorithms. The characteristics of EIT images
conductivities. It is also called time difference EIT imaging (see are then analyzed to postoperative outcomes. A predictive model
Fig. 6). of early cerebral injuries is built. Then it is incorporated into the
final in-vivo EIT application, which is beneficial in clinical brain EIT
4. Impact studies.
References [7] Yang B, Shi X, Dai M, Xu C, You F, Fu F, et al. Real-time imaging of cerebral
infarction in rabbits using electrical impedance tomography. J Int Med Res
[1] Holder DS. Electrical impedance tomography: methods, history and applica- 2014;42(1):173–83.
tions. CRC Press; 2004. [8] Tang C, You F, Cheng G, Gao D, Fu F, Yang G, et al. Correlation between
[2] Adler A, Boyle A. Electrical impedance tomography: Tissue properties to structure and resistivity variations of the live human skull. IEEE Trans Biomed
image measures. IEEE Trans Biomed Eng 2017;64(11):2494–504. Eng 2008;55(9):2286–92.
[3] Frerichs I, Amato MB, van Kaam AH, Tingay DG, Zhao Z, Grychtol B, et al. Chest [9] Baumann SB, Wozny DR, Kelly SK, Meno FM. The electrical conductivity
electrical impedance tomography examination, data analysis, terminology, of human cerebrospinal fluid at body temperature. IEEE Trans Biomed Eng
clinical use and recommendations: consensus statement of the translational 1997;44(3):220–3.
eit development study group. Thorax 2016;1–11. http://dx.doi.org/10.1136/ [10] Li Y, Zhang D, Liu B, Jin Z, Duan W, Dong X, et al. Noninvasive cerebral imaging
thoraxjnl-2016-208357. and monitoring using electrical impedance tomography during total aortic
[4] Fu F, Li B, Dai M, Hu SJ, Li X, Xu CH, et al. Use of electrical impedance arch replacement. J Cardiothoracic Vascular Anesthesia 2018 [in press]. http:
tomography to monitor regional cerebral edema during clinical dehydration //dx.doi.org/10.1053/j.jvca.2018.05.002.
treatment. PLoS One 2014;9(12). e113202. [11] Adler A, Lionheart WR. Uses and abuses of EIDORS: an extensible software
[5] Xu C, Wang L, Shi X, You F, Fu F, Liu R, et al. Real-time imaging and detection base for EIT. Physiological Measurement 2006;27(5):S25.
of intracranial haemorrhage by electrical impedance tomography in a piglet [12] Gómez-Laberge C, Adler A. Direct EIT Jacobian calculations for con-
model. J Int Med Res 2010;38(5):1596–604. ductivity change and electrode movement. Physiological Measurement
[6] Shi X, You F, Fu F, Liu R, You Y, Dai M, et al. Preliminary research on monitor- 2008;29(6):S89.
ing of cerebral ischemia using electrical impedance tomography technique. [13] Adler A, Arnold JH, Bayford R, Borsic A, Brown B, Dixon P, et al. GREIT: a unified
In: 2008 30th annual international conference of the IEEE engineering in approach to 2D linear EIT reconstruction of lung images. Physiol Measure
medicine and biology society; 2008. p. 1188–91 http://dx.doi.org/10.1109/ 2009;30(6):S35.
IEMBS.2008.4649375. [14] Cheney M, Isaacson D, Newell JC. Electrical impedance tomography. SIAM Rev
1999;41(1):85–101.