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 @@ -402,7 +402,7 @@ def __init__(
node1, node2 = tuple(self.proposal)
self.annotate_edge(node1)
self.annotate_edge(node2)
self.annotate_proposal()
self.annotate_proposal()

# --- Core Routines ---
def get_input_patch(self):
Expand Down
5 changes: 1 addition & 4 deletions src/neuron_proofreader/split_proofreading/split_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,7 @@ def save_results(self):
self.dataset.graph.to_zipped_swcs(temp_dir, sampling_rate=2)

# Merge ZIPs
swc_dir = os.path.join(self.output_dir, "corrected-swcs")
swc_path = os.path.join(swc_dir, "corrected-swcs.zip")
util.mkdir(swc_dir)

swc_path = os.path.join(self.output_dir, "corrected-swcs.zip")
zip_paths = util.list_paths(temp_dir, extension=".zip")
util.combine_zips(zip_paths, swc_path)
util.rmdir(temp_dir)
Expand Down
8 changes: 2 additions & 6 deletions src/neuron_proofreader/utils/img_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ def to_physical(voxel, anisotropy, offset=(0, 0, 0)):
return tuple([voxel[i] * anisotropy[i] - offset[i] for i in range(3)])


def to_voxels(xyz, anisotropy, multiscale=0):
def to_voxels(xyz, anisotropy):
"""
Converts coordinate from a physical to voxel space.

Expand All @@ -785,15 +785,11 @@ def to_voxels(xyz, anisotropy, multiscale=0):
anisotropy : ArrayLike
Image to physical coordinates scaling factors to account for the
anisotropy of the microscope.
multiscale : int, optional
Level in the image pyramid that the voxel coordinate must index into.
Default is 0.

Returns
-------
Tuple[int]
Voxel coordinate.
"""
scaling_factor = 1.0 / 2 ** multiscale
voxel = [int(scaling_factor * xyz[i] / anisotropy[i]) for i in range(3)]
voxel = [int(xyz[i] / anisotropy[i]) for i in range(3)]
return tuple(voxel[::-1])
Loading