Skip to content

Lightweight reader with little to no postprocessing to read the CARTO3 file format from Biosense Webster.

License

Notifications You must be signed in to change notification settings

thomgrand/cartoreader-lite

Repository files navigation

CARTOreader - lite

CI Tests codecov DOI

This repository is an inofficial reader to easily process exported CARTO3 data in Python. It does not provide the more extensive capabilities to analyze the signals, such as OpenEP, but is rather meant as a simple reader to import CARTO data. The loaded time data is imported in pandas and the meshes in VTK provided through PyVista, allowing for easy access, export and interoperatibility with existing software.

Installation

To install cartoreader_lite, you can simply install the package from PyPI:

pip install cartoreader-lite

Alternatively, you can clone the repository and install the libary using pip.

git clone https://github.com/thomgrand/cartoreader-lite
cd cartoreader-lite
pip install -e .

Usage

To test the library, you first need to get CARTO3 data. None is provided with this repository, but you can download the testing data provided by OpenEP to quickly try out the library (make sure the libary was installed first):

python tests/generate_test_data.py
from cartoreader_lite import CartoStudy
import pyvista as pv
import numpy as np

study_dir = "openep-testingdata/Carto/Export_Study-1-11_25_2021-15-01-32"
study_name = "Study 1 11_25_2021 15-01-32.xml"
study = CartoStudy(study_dir, study_name, 
                carto_map_kwargs={"discard_invalid_points": False} #All points of the example are outside the WOI, which would be by default discarded
                )
ablation_points = pv.PolyData(np.stack(study.ablation_data.session_avg_data["pos"].to_numpy()))
ablation_points.point_data["RFIndex"] = study.ablation_data.session_avg_data["RFIndex"]
plotter = pv.Plotter()
plotter.add_mesh(ablation_points, cmap="jet")
plotter.add_mesh(study.maps[2].mesh)
plotter.show()

You should see the recorded map of the OpenEP example, together with its recorded points like below.

openep-example

Documentation

https://cartoreader-lite.readthedocs.io/en/latest

Citation

If you use the library in your scientific projects, please cite the associated Zenodo archive: https://zenodo.org/record/5918396.

@software{grandits_2022_5918396,
  author       = {Thomas Grandits},
  title        = {CARTOreader - lite},
  month        = jan,
  year         = 2022,
  publisher    = {Zenodo},
  version      = {v1.0.1},
  doi          = {10.5281/zenodo.5918396},
  url          = {https://doi.org/10.5281/zenodo.5918396}
}

About

Lightweight reader with little to no postprocessing to read the CARTO3 file format from Biosense Webster.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages