Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def load_fragments(dataset, is_test=False):
for segmentation_id in sub_df["segmentation_id"].unique():
if (brain_id, segmentation_id) in target_pairs:
swc_pointer = f"{root}/{brain_id}/{segmentation_id}/merged_fragments.zip"
dataset.load_fragment_graphs(brain_id, swc_pointer)
dataset.load_fragment_graphs(
brain_id, swc_pointer, use_anisotropy=False
)


def load_groundtruth(dataset, is_test=False):
Expand All @@ -62,7 +64,7 @@ def load_groundtruth(dataset, is_test=False):
print("\nLoading Ground Truth")
root = "gs://allen-nd-goog/ground_truth_tracings"
for brain_id in get_brain_ids(dataset.merge_sites_df, is_test):
swc_pointer = f"{root}/{brain_id}/world"
swc_pointer = f"{root}/{brain_id}/voxel"
dataset.load_gt_graphs(brain_id, swc_pointer)


Expand Down
7 changes: 4 additions & 3 deletions src/neuron_proofreader/merge_proofreading/merge_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ def __init__(
self.merge_site_kdtrees = dict()

# --- Load Data ---
def load_fragment_graphs(self, brain_id, swc_pointer):
def load_fragment_graphs(
self, brain_id, swc_pointer, use_anisotropy=True
):
"""
Loads fragments containing merge mistakes for a whole-brain dataset,
then stores them in the "graphs" attribute.
Expand All @@ -137,7 +139,7 @@ def load_fragment_graphs(self, brain_id, swc_pointer):
graph = SkeletonGraph(
anisotropy=self.anisotropy,
node_spacing=self.node_spacing,
use_anisotropy=False
use_anisotropy=use_anisotropy
)
graph.load(swc_pointer)

Expand Down Expand Up @@ -184,7 +186,6 @@ def load_gt_graphs(self, brain_id, swc_pointer):
self.gt_graphs[brain_id] = SkeletonGraph(
anisotropy=self.anisotropy,
node_spacing=self.node_spacing,
use_anisotropy=False
)
self.gt_graphs[brain_id].load(swc_pointer)
self.gt_graphs[brain_id].set_kdtree()
Expand Down
6 changes: 6 additions & 0 deletions src/neuron_proofreader/skeleton_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__(
min_size=0,
node_spacing=1,
prune_depth=20,
use_anisotropy=True,
verbose=False,
):
"""
Expand All @@ -63,6 +64,10 @@ def __init__(
prune_depth : float, optional
Branches with length less than "prune_depth" microns are removed.
Default is 20μm.
use_anisotropy : bool, optional
Indication of whether to apply anisotropy to SWC files. Note: set
to False if the SWC files are saved in physical coordinates.
Default is False.
verbose : bool, optional
Indication of whether to display a progress bar while building
graph. Default is True.
Expand All @@ -77,6 +82,7 @@ def __init__(
self.node_spacing = node_spacing

# Graph Loader
anisotropy = anisotropy if use_anisotropy else (1.0, 1.0, 1.0)
self.graph_loader = gutil.GraphLoader(
anisotropy=anisotropy,
min_size=min_size,
Expand Down
1 change: 1 addition & 0 deletions src/neuron_proofreader/utils/graph_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def ingest_somas(self, segmentation_path):
# Assign threads
threads = list()
for xyz in self.soma_centroids:
# CHANGE THIS
voxel = img_util.to_voxels(xyz, (0.748, 0.748, 1.0))
threads.append(executor.submit(reader.read_voxel, voxel, xyz))

Expand Down
Loading