Skip to content

Commit 1713639

Browse files
committed
added layer selector for second structure and filtering logic to query for vesicle_pool_widget
1 parent 951fe24 commit 1713639

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

synapse_net/tools/vesicle_pool_widget.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,15 @@ def _compute_vesicle_pool(
150150
distances = pd.DataFrame(distances).drop(columns=["index"])
151151
morphology = pd.DataFrame(morphology).drop(columns=["index"])
152152
merged_df = morphology.merge(distances, left_on="label", right_on="label", suffixes=("_morph", "_dist"))
153-
153+
# Add distances2 if present.
154+
if distances2 is not None:
155+
distance_ids = distances2.get("label", [])
156+
if set(distance_ids) != set(morphology_ids):
157+
show_info("ERROR: The IDs in distances2 and morphology are not identical.")
158+
return
159+
distances2 = pd.DataFrame(distances2).drop(columns=["index"])
160+
merged_df = merged_df.merge(distances2, left_on="label", right_on="label", suffixes=("", "2"))
161+
print(merged_df)
154162
# Assign the vesicles to the current pool by filtering the mergeddataframe based on the query.
155163
filtered_df = self._parse_query(query, merged_df)
156164
if len(filtered_df) == 0:

0 commit comments

Comments
 (0)