Skip to content

Include skeleton source in segmentation layer for neuroglancer links#222

Merged
fcollman merged 2 commits into
masterfrom
copilot/default-include-skeleton-source-segmentation-layer
Apr 30, 2026
Merged

Include skeleton source in segmentation layer for neuroglancer links#222
fcollman merged 2 commits into
masterfrom
copilot/default-include-skeleton-source-segmentation-layer

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

Neuroglancer links generated for materialized tables were not including the skeleton source in the segmentation layer, even when one was defined in the datastack info.

Changes

  • make_seg_prop_ng_link and make_precomputed_annotation_link: Both functions now check for a skeleton_source field in the datastack info and append it to the segmentation layer's source list if present.
# Before: fixed source list
seg_layer = nglui.statebuilder.SegmentationLayerConfig(
    source=[seg_source, seg_info_source], name="seg"
)

# After: skeleton source appended when it exists
seg_sources = [seg_source, seg_info_source]
datastack_info = client.info.get_datastack_info()
skeleton_source = datastack_info.get("skeleton_source", None)
if skeleton_source:
    seg_sources.append(skeleton_source)

seg_layer = nglui.statebuilder.SegmentationLayerConfig(
    source=seg_sources, name="seg"
)

The get_datastack_info() call is zero-cost here — client.info.segmentation_source() (called just before) already populates InfoServiceClient's internal info_cache. Also cleaned up the source URL variable name from seg_layer to seg_source to remove the shadowing issue with the SegmentationLayerConfig object.

Copilot AI changed the title [WIP] Add default skeleton source inclusion in neuroglancer links Include skeleton source in segmentation layer for neuroglancer links Apr 30, 2026
Copilot AI requested a review from bdpedigo April 30, 2026 21:23
@bdpedigo bdpedigo marked this pull request as ready for review April 30, 2026 21:28
@fcollman fcollman merged commit 832fe18 into master Apr 30, 2026
1 check passed
@bdpedigo bdpedigo deleted the copilot/default-include-skeleton-source-segmentation-layer branch May 1, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default to including skeleton source in the segmentation layer (if one exists) for generated neuroglancer links for materialized tables

3 participants