diff --git a/src/deep_neurographs/intake.py b/src/deep_neurographs/intake.py index a4286e4..b304bfe 100644 --- a/src/deep_neurographs/intake.py +++ b/src/deep_neurographs/intake.py @@ -81,7 +81,6 @@ def build_neurograph_from_gcs_zips( img_path=None, min_size=MIN_SIZE, n_proposals_per_leaf=N_PROPOSALS_PER_LEAF, - search_radius=SEARCH_RADIUS, prune=PRUNE, prune_depth=PRUNE_DEPTH, optimize_proposals=OPTIMIZE_PROPOSALS, @@ -106,9 +105,6 @@ def build_neurograph_from_gcs_zips( n_proposals_per_leaf : int, optional Number of edge proposals generated from each leaf node in an swc file. The default is the global variable "N_PROPOSALS_PER_LEAF". - search_radius : float, optional - Maximum Euclidean length of an edge proposal. The default is the - global variable "SEARCH_RADIUS". prune : bool, optional Indication of whether to prune short branches. The default is the global variable "PRUNE". @@ -152,19 +148,6 @@ def build_neurograph_from_gcs_zips( t, unit = utils.time_writer(time() - t0) print(f"Module Runtime(): {round(t, 4)} {unit} \n") - # Generate proposals - if search_radius > 0: - print("Generate Edge Proposals...") - t0 = time() - neurograph.generate_proposals( - search_radius, n_proposals_per_leaf=n_proposals_per_leaf - ) - t, unit = utils.time_writer(time() - t0) - print( - "# proposals:", - utils.reformat_number(len(neurograph.mutable_edges)), - ) - t, unit = utils.time_writer(time() - total_runtime) print(f"Total Runtime: {round(t, 4)} {unit}") print(f"Memory Consumption: {round(utils.get_memory_usage(), 4)} GBs") diff --git a/src/deep_neurographs/neurograph.py b/src/deep_neurographs/neurograph.py index 533d787..2bb5a44 100644 --- a/src/deep_neurographs/neurograph.py +++ b/src/deep_neurographs/neurograph.py @@ -116,9 +116,10 @@ def __add_nodes(self, nodes, key, node_ids, cur_id, swc_id): node_ids[i] = cur_id self.add_node( node_ids[i], - xyz=nodes[key][i]["xyz"], + proposals=set(), radius=nodes[key][i]["radius"], swc_id=swc_id, + xyz=nodes[key][i]["xyz"], ) if key == "leafs": self.leafs.add(cur_id) @@ -173,6 +174,8 @@ def generate_proposals( # Add edge edge = frozenset((leaf, node)) self.proposals[edge] = {"xyz": np.array([xyz_leaf, xyz])} + self.nodes[node]["proposals"].add(leaf) + self.nodes[leaf]["proposals"].add(node) # Check whether to optimization proposals if optimize: @@ -264,9 +267,10 @@ def split_edge(self, edge, attrs, idx): new_node = len(self.nodes) + 1 self.add_node( new_node, - xyz=tuple(attrs["xyz"][idx]), + proposals=set(), radius=attrs["radius"][idx], swc_id=attrs["swc_id"], + xyz=tuple(attrs["xyz"][idx]), ) self.__add_edge((i, new_node), attrs, np.arange(0, idx + 1)) self.__add_edge(