Skip to content

Commit

Permalink
minor upds
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-grim committed Nov 1, 2024
1 parent 922075a commit 86aa063
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/deep_neurographs/groundtruth_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import numpy as np

from deep_neurographs import geometry
from deep_neurographs.geometry import dist as get_dist
from deep_neurographs.utils import util

ALIGNED_THRESHOLD = 4.5
Expand Down Expand Up @@ -141,7 +140,7 @@ def is_component_aligned(target_graph, pred_graph, nodes, kdtree):
for xyz in pred_graph.edges[edge]["xyz"]:
hat_xyz = geometry.kdtree_query(kdtree, xyz)
hat_swc_id = target_graph.xyz_to_swc(hat_xyz)
d = get_dist(hat_xyz, xyz)
d = geometry.dist(hat_xyz, xyz)
dists[hat_swc_id].append(d)

# Deterine whether aligned
Expand Down
1 change: 0 additions & 1 deletion src/deep_neurographs/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ def __init__(
)

# Set output directory
date = datetime.today().strftime("%Y-%m-%d")
self.output_dir = output_dir
util.mkdir(self.output_dir, delete=True)
if self.log_runtimes:
Expand Down
8 changes: 2 additions & 6 deletions src/deep_neurographs/neurograph.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
NOTE: SAVE LABEL UPDATES --- THERE IS A BUG IN FEATURE GENERATION
"""
import os
import zipfile
from concurrent.futures import ThreadPoolExecutor
from copy import deepcopy
from io import StringIO

Expand All @@ -21,10 +19,8 @@
from scipy.spatial import KDTree

from deep_neurographs import generate_proposals, geometry
from deep_neurographs.geometry import dist as get_dist
from deep_neurographs.groundtruth_generation import init_targets
from deep_neurographs.utils import graph_util as gutil
from deep_neurographs.utils import img_util, swc_util, util
from deep_neurographs.utils import graph_util as gutil, img_util, util


class NeuroGraph(nx.Graph):
Expand Down Expand Up @@ -808,7 +804,7 @@ def dist(self, i, j):
Euclidean distance between nodes "i" and "j".
"""
return get_dist(self.nodes[i]["xyz"], self.nodes[j]["xyz"])
return geometry.dist(self.nodes[i]["xyz"], self.nodes[j]["xyz"])

def branches(self, i, ignore_reducibles=True, key="xyz"):
branches = list()
Expand Down
5 changes: 3 additions & 2 deletions src/deep_neurographs/utils/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@

import json
import math
import networkx as nx
import os
import shutil
from io import BytesIO
from random import sample
from zipfile import ZipFile

import boto3
import networkx as nx
import numpy as np
import psutil
from google.cloud import storage

from deep_neurographs.utils import graph_util as gutil, swc_util
from deep_neurographs.utils import graph_util as gutil


# --- os utils ---
def mkdir(path, delete=False):
Expand Down

0 comments on commit 86aa063

Please sign in to comment.