Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions ClearMap/Analysis/Graphs/GraphGt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1438,9 +1438,27 @@ def copy(self):
return Graph(name = copy.copy(self.name), base = self.base.copy())


def load(filename):
g = gt.load_graph(filename);
return Graph(base = g);
def load(filename, ignore_vp=None, ignore_ep=None, ignore_gp=None):
"""Read graph from file.

Arguments
---------
filename : str
Path to the GT file.
ignore_vp : list
Vertex properties that will be ignored.
ignore_ep : list
Edge properties that will be ignored.
ignore_gp : list
Graph properties that will be ignored.

Returns
-------
graph : Graph
The graph as a Graph object.
"""
g = gt.load_graph(filename, ignore_vp=ignore_vp, ignore_ep=ignore_ep, ignore_gp=ignore_gp)
return Graph(base=g)

def save(filename, graph):
graph.save(filename);
Expand Down