Skip to content
Snippets Groups Projects
Commit fe8b87c5 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Save trajectories as lists of vertex indices

This is useful to find the shortest path between the beginning and the
end of a trajectory, or to create a histogram of the number of
trajectories per component.
parent ca790d75
No related branches found
No related tags found
No related merge requests found
......@@ -215,6 +215,13 @@ t0 = t1
# Save:
with open("traj_vert_ind.json", "w") as outfile:
json.dump(traj_vert_ind, outfile, separators=(",", ":"), default=int)
# (We specify default because the type of vertex indices is
# numpy.int32, not JSON serializable.)
print("Created traj_vert_ind.json.")
with open("traj_segm.json", "w") as outfile:
json.dump(traj_segm, outfile, separators=(",", ":"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment