Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting GUDHI Persistence Diagrams to Giotto #653

Closed
mukhituly opened this issue Dec 1, 2022 · 1 comment
Closed

Converting GUDHI Persistence Diagrams to Giotto #653

mukhituly opened this issue Dec 1, 2022 · 1 comment

Comments

@mukhituly
Copy link

Hi everyone!

Is it possible to convert GUDHI Persistence Diagrams into Giotto Format?

@wreise
Copy link
Collaborator

wreise commented Dec 2, 2022

Hi @mukhituly !
Yes, it is. A persistence diagram in gudhi is a list, where each element is of the form (dimension, pair(birth, death)). In giotto-tda, the elements of that list are [birth, death, dimension]. Hence, for example,
np.array([[b, d, dim] for dim, (b,d) in gudhi_diagram]) should give you a diagram in the giotto-format.

Since giotto relies on GUDHI for some computations, this conversion is done in gtda/homology/_utils.py::_postprocess_diagrams.py.

Note that extended persistence diagrams in gudhi are slightly different: the list of points is partitioned into 4 parts (possible empty) and each of them has a different interpretation. Currently, it is possible to treat only those from the first part (ordinary persistence) using giotto.

Please let me know if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants