From 8d161a785237c6e645b68a9183f49e97913ef76f Mon Sep 17 00:00:00 2001 From: Anna Grim <108307071+anna-grim@users.noreply.github.com> Date: Tue, 19 Nov 2024 13:02:53 -0800 Subject: [PATCH] Update fragments_graph.py --- src/deep_neurographs/fragments_graph.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/deep_neurographs/fragments_graph.py b/src/deep_neurographs/fragments_graph.py index c958bed..993f0a0 100644 --- a/src/deep_neurographs/fragments_graph.py +++ b/src/deep_neurographs/fragments_graph.py @@ -142,7 +142,7 @@ def add_component(self, irreducibles): # Edges for (i, j), attrs in irreducibles["edge"].items(): edge = (ids[i], ids[j]) - idxs = util.spaced_idxs(attrs["radius"], self.node_spacing) + idxs = util.spaced_idxs(len(attrs["radius"]), self.node_spacing) for key in ["radius", "xyz"]: attrs[key] = attrs[key][idxs] self.__add_edge(edge, attrs, swc_id) @@ -996,8 +996,7 @@ def branch_to_zip(self, text_buffer, n_entries, i, j, parent, color): branch_radius = np.flip(branch_radius, axis=0) # Make entries - idxs = np.arange(1, len(branch_xyz)) - for k in util.spaced_idxs(idxs, 6): + for k in util.spaced_idxs(len(branch_xyz), 5): x, y, z = tuple(branch_xyz[k]) r = 6 if branch_radius[k] == 7.3141592 else 2