Skip to content

Commit

Permalink
minor upds
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-grim committed Oct 30, 2024
1 parent 4ffe02f commit 97d94d6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/deep_neurographs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class GraphConfig:
min_size: float = 30.0
node_spacing: int = 1
proposals_per_leaf: int = 2
prune_depth: float = 25.0
prune_depth: float = 20.0
remove_doubles_bool: bool = False
search_radius: float = 20.0
smooth_bool: bool = True
Expand Down
3 changes: 2 additions & 1 deletion src/deep_neurographs/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,11 @@ def build_graph(self, fragments_pointer):
min_size=self.graph_config.min_size,
node_spacing=self.graph_config.node_spacing,
progress_bar=True,
prune_depth=self.graph_config.prune_depth,
)
self.graph = graph_builder.run(fragments_pointer)

# Remove doubles (if applicable)
# Filter fragments
n_curvy = fragment_filtering.remove_curvy(self.graph, 200)
n_curvy = util.reformat_number(n_curvy)
if self.graph_config.remove_doubles_bool:
Expand Down
2 changes: 0 additions & 2 deletions src/deep_neurographs/neurograph.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,6 @@ def merge_proposal(self, proposal):
self.upd_ids(swc_id, j if swc_id == swc_id_i else i)
self.__add_edge((i, j), attrs, swc_id)
self.proposals.remove(proposal)
else:
print("Skip! -- Failed Degree Check")

def check_proposal_degrees(self, i, j):
one_leaf = self.degree[i] == 1 or self.degree[j] == 1
Expand Down
7 changes: 4 additions & 3 deletions src/deep_neurographs/utils/graph_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def schedule_processes(self, swc_dicts):
pbar = tqdm(total=len(swc_dicts), desc="Extract Graphs")

# Main
with ProcessPoolExecutor(max_workers=1) as executor:
with ProcessPoolExecutor() as executor:
# Assign Processes
i = 0
processes = [None] * len(swc_dicts)
Expand Down Expand Up @@ -273,8 +273,9 @@ def prune_branches(self, graph):
break

# Check whether to stop
if length > self.prune_depth or n_passes == 1:
graph.remove_nodes_from(branch[0:min(3, len(branch))])
if length > self.prune_depth:
if n_passes == 1:
graph.remove_nodes_from(branch[0:min(3, len(branch))])
break

def get_component_irreducibles(self, graph, swc_dict):
Expand Down

0 comments on commit 97d94d6

Please sign in to comment.