Case - the fundamental data structure of openep-py¶
A Case stores all the information obtained during a clinical mapping procedure.
Warning
This class should not be instatiated directly. Instead, a Case can be
created using openep.io.readers.load_openep_mat().
Tip
Once you have a Case, you can perform analyses using the functions in
openep.case.case_routines. You can also create a 3D mesh using the
create_mesh() method.
-
class
openep.data_structures.case.Case[source]¶ The fundamental OpenEP object.
The class contains all the information on a single case exported from a clinical mapping system.
- Parameters
name (str) – Name to assign to the dataset
points (ndarray) – 3D coordinates of points on the mesh
indices (ndarray) – Indices of points that make up each face of the mesh
fields (Fields) – Numpy arrays of the scalar fields associated with each point on the surface of a mesh
electtic (Electric) – Electrical data obtained during a clinical mapping procedure.
ablation (Ablation, optional) – Ablation data obtained during a clinical mapping procedure.
notes (list, optional) – Notes associated with the dataset.
-
create_mesh(recenter: bool = True, back_faces: bool = False)[source]¶ Create a new mesh object from the stored nodes and indices
- Parameters
recenter – if True, recenter the mesh to the origin
back_faces – if True, calculate back face triangles
- Returns
mesh (pyvista.Polydata) – a mesh created from the case’s points and indices
-
get_surface_data(copy: bool = False) → Tuple[numpy.ndarray, numpy.ndarray][source]¶ Extract the surface data for the case.
- Parameters
copy (bool, optional) – If True, a copy of the data will be returned. The default is False, in which case a view of the data is returned.
- Returns
points (ndarray) – 3D coordinates of points on the mesh indices (ndarray): Indices of points that make up each face of the mesh
-
get_field(fieldname: str, copy: bool = False) → numpy.ndarray[source]¶ Extract scalar field data associated with each point on the surface.
- Parameters
fieldname (str) – Must be one of: bipolar_voltage, unipolar_voltage, local_activation_time, impedance, force.
copy (bool, optional) – If True, a copy of the data will be returned. The default is False, in which case a view of the data is returned.
- Returns
field (np.ndarray) – scalar field data
Note
Case contains information on the 3D surface and associated scalar fields,
the electrograms, and the ablation sites. These data are, respectively,
stored as the following data structures: openep.data_structures.surface.Fields,
openep.data_structures.electric.Electric, and
openep.data_structures.ablation.Ablation.
Scalar field data¶
-
class
openep.data_structures.surface.Fields[source]¶ Class for storing information about the surface of a mesh
- Parameters
bipolar_voltage (np.ndarray) – array of shape N
unipolar_voltage (np.ndarray) – array of shape N
local_activation_time (np.ndarray) – array of shape N
impedance (np.ndarray) – array of shape N
force (np.ndarray) – array of shape N
Electrical data¶
-
class
openep.data_structures.electric.Electric[source]¶ Class for storing electrical data obtained during a clinical mapping procedure.
- Parameters
names (np.ndarray) – The physician-visible names of the points applied during the clinical case.
internal_names (np.ndarray) – The internal names of the points used by the clinical electroanatomic mapping system.
bipolar_egm (Electrogram) – The bipolar electrograms, coordinates of mapping points, names of the electrodes, and voltages.
unipolar_egm (Electrogram) – The unipolar electrograms, coordinates of the two unipole electrodes, names of the two unipole electrodes, and voltages.
reference_egm (Electrogram) – The reference electrograms for each mapping point.
ecg (np.ndarray) – The surface electrocardiogram for each mapping point.
impedance (Impedance) – The time and values of impedance traces for each mapping point
surface (ElectricSurface) – The position of each mapping point projected to the nearest point on the 3D surface, as well as the normal to the surface at that point.
annotations (Annotations) – The window of interest, local activation time, and reference activation time for each mapping point.
-
class
openep.data_structures.electric.Electrogram[source]¶ Class for storing information about electrograms
- Parameters
egm (np.ndarray) – Electrograms
points (np.ndarray) – 3D coordinates of the associated mapping points.
voltage (np.ndarray) – The voltage at each mapping point.
gain (np.ndarray) – gain to apply to each signal
names (np.ndarray) – Names of the associated electrodes.
-
class
openep.data_structures.electric.Impedance[source]¶ Class for storing information about impedance traces.
- Parameters
times (np.ndarray) – Times at which the traces were taken.
values (np.ndarray) – Impedance measurements.
-
class
openep.data_structures.electric.ElectricSurface[source]¶ Class for storing information about electroanatomic data projected onto the surface mesh.
- Parameters
nearest_point (np.ndarray) – The position of each mapping point projected to the nearest point on the 3D surface constructed by the clinical mapping system.
normals (np.ndarray) – Normal to the surface at each of the nearest points.
-
class
openep.data_structures.electric.Annotations[source]¶ Class for storing information about activation times for electrograms.
- Parameters
window_of_interest (np.ndarray) – The window of interest for each mapping point
local_activation_time (np.ndarray) – The local activation time for each mapping point
reference_activation_time (np.ndarray) – The reference activation time for each mapping point
Ablation data¶
-
class
openep.data_structures.ablation.Ablation[source]¶ Class for storing ablation data.
- Parameters
times (np.ndarray) – array of shape N
power (np.ndarray) – array of shape N
impedance (np.ndarray) – array of shape N
temperature (np.ndarray) – array of shape N
force (AblationForce) – data on the force at each ablation site. Specifically, the force applied, the time at which it was applied, and axial and lateral angles, and the 3D coordinates of the ablation site.
-
class
openep.data_structures.ablation.AblationForce[source]¶ Class for storing data on ablation force.
- Parameters
times (np.ndarray) – array of shape N
force (np.ndarray) – array of shape N
axial_angle (np.ndarray) – array of shape N
lateral_angle (np.ndarray) – array of shape N
points (np.ndarray) – array of shape Nx3