Skip to content

Rectangular cells and outline overlays in the channel and trace grids - #9

Merged
cboulay merged 1 commit into
mainfrom
feat/rect-cells-and-outlines
Oct 5, 2026
Merged

cboulay merged 1 commit into
mainfrom
feat/rect-cells-and-outlines

Conversation

@cboulay

@cboulay cboulay commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Lets a grid draw a channel that covers a group of electrode pads, rather than one square per channel at its position.

Changes

  • Rectangles: sizes in ChannelGridConfig and TraceGridConfig may be (n_ch, 2) widths and heights, as well as (n_ch,) square sides.
    • resolve_cell_geometry now returns rects as (x0, y0, width, height). API change: callers that read rects[:, 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: both grids take outlines: tuple[Outline, ...], line segments in position space drawn over the cells.
    • Each outline has its own colour and thickness.
    • Under invert_y they are flipped the same way as the cells.
    • outline_vertices turns 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_geometry change.

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.
@cboulay
cboulay merged commit f163f3d into main Oct 5, 2026
11 checks passed
@cboulay
cboulay deleted the feat/rect-cells-and-outlines branch October 5, 2026 06:47
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.

1 participant