Skip to content

Parse Rhythmia matlab file

Full example code: examples/parser/rhythmia_mat.py

All rhythmia data is contained in this matlab file. Surface mesh, measured points and signals.

from dgmr.parser import RhythmiaReader

mat_file = "path_to_your_matlab_file"
data = RhythmiaReader.load_mat_file(matfile)

vertices, triangles = RhythmiaReader.load_mesh_data(data)
map_points = RhythmiaReader.load_points_data(data)

print(map_points[:5])
print(vertices[:5])
print(triangles[:5])

Output:

           x          y           z  LAT_unipolar  LAT_bipolar  Voltage_unipolar  Voltage_bipolar  cutoutMask
0  26.407516  69.491158 -190.966644     55.006898    59.689460          2.623607         0.815410       False
1  27.426077  69.472664 -191.055603     55.181138    60.136036          2.436753         0.748954       False
2  28.268314  69.142654 -190.921783     56.010691    60.729332          1.970783         0.517144       False
3  26.404879  70.336906 -191.043396     55.512578    60.208148          2.708712         0.926648       False
4  27.343777  70.267914 -191.138306     56.195891    60.910596          2.708712         0.926648       False

   vertex_0  vertex_1  vertex_2
0         1         0         4
1         4         0         3
2         2         1         5
3         5         1         4
4         6         2         5

          x          y           z  LAT_unipolar  LAT_bipolar  Voltage_unipolar  Voltage_bipolar
0 -2.036388  94.710999 -140.841731    -26.214409    57.671699          1.176079         0.032931
1 -2.119308  94.854105 -140.915518    -24.117256   102.760482          0.357131         0.014298
2 -2.138508  94.855306 -140.912917     89.128990    99.614753          0.357131         0.023032
3 -3.035281  94.722497 -140.804238    -79.691802    51.380241          0.575269         0.029231
4 -2.727108  94.816584 -140.858291     81.788955    91.226142          0.453262         0.012692