Skip to content

adjusted lookup radius to be multiples of the base resolution #481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 11, 2024
Merged
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
7 changes: 5 additions & 2 deletions pychunkedgraph/app/app_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ def ccs(coordinates_nm_):

coordinates = np.array(coordinates, dtype=int)
coordinates_nm = coordinates * cg.meta.resolution
max_dist_steps = np.array([4, 8, 14, 28], dtype=float) * np.mean(cg.meta.resolution)

node_ids = np.array(node_ids, dtype=np.uint64)
if len(coordinates.shape) != 2:
raise cg_exceptions.BadRequest(
Expand All @@ -242,7 +244,8 @@ def ccs(coordinates_nm_):
node_id_m = node_ids == node_id
for cc in ccs(coordinates_nm[node_id_m]):
m_ids = np.where(node_id_m)[0][cc]
for max_dist_nm in [75, 150, 250, 500]:

for max_dist_nm in max_dist_steps:
atomic_ids_sub = cg.get_atomic_ids_from_coords(
coordinates[m_ids], parent_id=node_id, max_dist_nm=max_dist_nm
)
Expand All @@ -251,7 +254,7 @@ def ccs(coordinates_nm_):
if atomic_ids_sub is None:
raise cg_exceptions.BadRequest(
f"Could not determine supervoxel ID for coordinates "
f"{coordinates} - Validation stage."
f"{coordinates} - Lookup stage."
)
atomic_ids[m_ids] = atomic_ids_sub
return atomic_ids
Expand Down