Skip to content

Commit 064ff2d

Browse files
Fix issues in ribbon postprocessing
1 parent 57b7258 commit 064ff2d

File tree

1 file changed

+5
-5
lines changed
  • synaptic_reconstruction/tools

1 file changed

+5
-5
lines changed

synaptic_reconstruction/tools/util.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ def _segment_ribbon_AZ(image, model, tiling, scale, verbose, **kwargs):
7272

7373
# If the vesicles were passed then run additional post-processing.
7474
if vesicles is None:
75+
segmentation = predictions
76+
77+
# Otherwise, just return the predictions.
78+
else:
7579
from synaptic_reconstruction.inference.postprocessing import (
7680
segment_ribbon, segment_presynaptic_density, segment_membrane_distance_based,
7781
)
@@ -85,15 +89,11 @@ def _segment_ribbon_AZ(image, model, tiling, scale, verbose, **kwargs):
8589
)
8690
ref_segmentation = PD if PD.sum() > 0 else ribbon
8791
membrane = segment_membrane_distance_based(
88-
predictions["membrane"], ref_segmentation, n_sclices_exclude=n_slices_exclude, max_distance=500
92+
predictions["membrane"], ref_segmentation, max_distance=500, n_slices_exclude=n_slices_exclude,
8993
)
9094

9195
segmentation = {"ribbon": ribbon, "PD": PD, "membrane": membrane}
9296

93-
# Otherwise, just return the predictions.
94-
else:
95-
segmentation = predictions
96-
9797
return segmentation
9898

9999

0 commit comments

Comments
 (0)