Repository navigation
Rectangular cells and outline overlays in the channel and trace grids - #9
Merged
Merged
Conversation
sizes may be (n_ch, 2) widths and heights, so a channel can cover a rectangle (a group of electrode pads, say) rather than only a square; resolve_cell_geometry returns (x0, y0, width, height). Both grids take outlines: line segments in position space drawn over the cells (pad boundaries, cell borders), flipped with them under invert_y.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets a grid draw a channel that covers a group of electrode pads, rather than one square per channel at its position.
Changes
sizesinChannelGridConfigandTraceGridConfigmay be(n_ch, 2)widths and heights, as well as(n_ch,)square sides.resolve_cell_geometrynow returns rects as(x0, y0, width, height). API change: callers that readrects[:, 2]as the side should read width[:, 2]and height[:, 3].build_quad_mesh_arrays, the hit-testing in both grids, and the trace grid's sample placement all use width and height.outlines: tuple[Outline, ...], line segments in position space drawn over the cells.invert_ythey are flipped the same way as the cells.outline_verticesturns segments into one NaN-separated polyline per outline.Used by intent-tools to draw uECoG like BISC, with pad, channel and cell borders.
Testing
134 passed. New tests cover width/height sizes, the flip of a rectangle, rectangle tessellation, outline vertices and the flip, hit-testing a rectangle, and drawing outlines. ruff is clean.
A minor release (0.10.0) is suggested because of the
resolve_cell_geometrychange.