eit_forward_results
- class nrv.eit.results.eit_forward_results(nerve_res: nerve_results | str | dict | None = None, fem_res: dict | None = None, data: str | dict | None = None)[source]
Stores and manages the results of an Electrical Impedance Tomography (EIT) forward simulation.
This class combines outputs from both the nerve simulation and the finite element (FEM) EIT simulation, providing convenient access to time series, electrode measurements, protocol information, and post-processing tools.
- Parameters:
Note
This class is designed for efficient post-processing and visualization of EIT simulation results.
It supports multi-frequency and multi-protocol EIT simulations.
Failed or invalid time steps are automatically detected and can be filtered out.
Provides tools for CAP detection and analysis.
Note
In this class the eit_forward simulation results are stored in multidimensionnal tensor. This tensor contain between 2 and 5 dimensions as shown in the following table:
Dimensions
Paterns
Frequency
Time
Electrode
Status
Optional
Optional
Always
Always
Size
n_p
n_f
n_t
n_e
Corresponding key
"p""f""t""e"Example
>>> res = eit_forward_results(nerve_res=nerve_sim, fem_res=fem_sim) # create results >>> dv = res.dv_eit(i_e=0) # Access voltage shift of the first electrode >>> cap_mask = res.get_cap_mask(thr=0.1)
Attributes
Index of the electrode axis in EIT arrays. |
|
Index of the frequency axis in EIT arrays when it exists. |
|
Indices of failed FEM time samples. |
|
Whether failed EIT samples have been identified. |
|
Whether forward EIT FEM data is available. |
|
Whether recording data coming from the nerve simulation is available. |
|
Returns True if the EIT simulation was run over multiple frequencies |
|
Returns True if the injections protocole contains more than one patern. |
|
number of electrodes |
|
number of frequency point |
|
number of drive partern point |
|
number of temporal point |
|
return the shape of v_eit |
|
Index of the time axis in EIT arrays. |
|
Interpolator for the EIT electrode potentials. |
|
Interpolator for recorder voltages from the nerve simulation. |
Methods
|
Build an EIT forward-results container. |
|
Return the voltage variation relative to the baseline sample. |
|
Return the absolute differential EIT signal normalized by its maximum. |
|
Return the percentage differential EIT signal. |
|
Create a new dictionary with keys from iterable and values set to value. |
|
Return the value for key if key is in the dictionary, else default. |
|
Detect activity masks independently for each acquisition line. |
|
Build a dataframe describing CAP time windows for each acquisition line. |
|
Build a CAP summary table augmented with voltage metrics. |
|
Split CAP detections into contiguous time-index groups. |
Detect the global CAP window on the most responsive electrode. |
|
|
Extract differential EIT traces described by a CAP dataframe. |
|
Build index arrays for advanced slicing of EIT results. |
Build a dataframe summarizing CAPs detected on recorder traces. |
|
|
Convert a pair of time indices into a duration. |
Import recorder traces from a nerve simulation result. |
|
|
Return broadcasting indices ready for |
|
Load serialized EIT results into the current object. |
|
Plot stored or interpolated EIT-related signals. |
|
If the key is not found, return the default if given; otherwise, raise a KeyError. |
Remove and return a (key, value) pair as a 2-tuple. |
|
|
Insert key with a value of default if key is not in the dictionary. |
|
Return the FEM time vector, optionally resampled. |
|
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k] |
Refresh the cached CAP dataframe with voltage-derived metrics. |
|
Replace entries previously marked as failed. |
|
|
Return the baseline EIT voltage at the first time sample. |
|
Return EIT voltages, either at stored or interpolated times. |
|
Extract raw stored EIT voltages using index-based selection. |
|
Return recorder voltages from the nerve simulation. |