From c922a70202682e83fcd2f0802ae7416a6577ec2d Mon Sep 17 00:00:00 2001 From: anna-grim Date: Wed, 4 Feb 2026 04:55:15 +0000 Subject: [PATCH] update swc write --- .../split_proofreading/split_feature_extraction.py | 2 +- .../split_proofreading/split_inference.py | 5 +---- src/neuron_proofreader/utils/img_util.py | 8 ++------ 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/neuron_proofreader/split_proofreading/split_feature_extraction.py b/src/neuron_proofreader/split_proofreading/split_feature_extraction.py index 88b1e2c..d245032 100644 --- a/src/neuron_proofreader/split_proofreading/split_feature_extraction.py +++ b/src/neuron_proofreader/split_proofreading/split_feature_extraction.py @@ -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): diff --git a/src/neuron_proofreader/split_proofreading/split_inference.py b/src/neuron_proofreader/split_proofreading/split_inference.py index eec470d..9bcdf17 100644 --- a/src/neuron_proofreader/split_proofreading/split_inference.py +++ b/src/neuron_proofreader/split_proofreading/split_inference.py @@ -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) diff --git a/src/neuron_proofreader/utils/img_util.py b/src/neuron_proofreader/utils/img_util.py index 4a4f04f..020685d 100644 --- a/src/neuron_proofreader/utils/img_util.py +++ b/src/neuron_proofreader/utils/img_util.py @@ -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. @@ -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])