QA: Regions¶
Test cases for drawing, selecting and editing regions on the image, undo/redo, the right-click region actions and the related keyboard shortcuts. See How to use the plan. Reference: Region tools, Region actions, Keyboard shortcuts.
Unless a case says otherwise, use img01.png in the Image view with no regions, and press S before each
case to start from no armed tool.
Toolbar availability¶
| ID | Title | Pri | Preconditions / data | Steps | Expected result |
|---|---|---|---|---|---|
| REG-001 | Region tools in the Image view | P1 | img01.png |
1. Hover each region button. | In order: Region Editor ("Open the Region Editor"), Selection mode (s), Draw a rectangular region (r), Draw a polyline (l), Draw a freeform region (f), Brush, Polygon, Add a vertex, Delete a vertex, Wand (w), Vertex eraser (e), Undo, Redo, Delete selected region (Del). |
| REG-002 | No tool armed by default | P2 | img01.png freshly opened |
1. Look at the region tools. | All tool buttons are in their plain (text) state. |
| REG-003 | Armed tool is highlighted | P2 | img01.png |
1. Click Wand. | The Wand button is filled and its icon turns white; a Sens. slider appears right after it. |
| REG-004 | Clicking the armed tool disarms it | P2 | Wand armed | 1. Click Wand again. | The Wand is disarmed and the slider disappears. |
| REG-005 | Vertex tools only where supported | P2 | img01.png |
1. Switch to Heatmap. | Polygon, Add a vertex and Delete a vertex are hidden; rectangle, polyline, freeform, brush, wand, eraser remain. |
| REG-006 | Volume view shows selection-only tools | P2 | micro-ct z-stack, Volume | 1. Look at the toolbar. | Only Region Editor, Selection, Undo, Redo, Delete and Slice editor. |
| REG-007 | Spatial 3D hides polyline and brush | P3 | Allen atlas dataset, Spatial omics 3D | 1. Look at the region tools. | Polyline and Brush are hidden (3D regions are screen-space lassos). |
| REG-008 | Plot-type switch disarms the tool | P2 | img01.png, f armed |
1. Pick Heatmap. | No tool is armed. |
Drawing tools¶
| ID | Title | Pri | Preconditions / data | Steps | Expected result |
|---|---|---|---|---|---|
| REG-020 | Rectangle | P1 | 1. Press R. 2. Drag a box. | A rectangle region appears (cyan #00FFFF outline, 2 px) and is listed in the Region Editor with class "Region". |
|
| REG-021 | Polyline | P1 | 1. Press L. 2. Click and drag a path. | An open line is drawn (not closed). | |
| REG-022 | Freeform | P1 | 1. Press F. 2. Drag a closed shape. | A closed freeform polygon is created. | |
| REG-023 | Polygon | P1 | 1. Click Polygon. 2. Click 5 points. 3. Click within 8 px of the first point. | Each click places a vertex; the polygon closes when the first point is clicked (at least 3 vertices). | |
| REG-024 | Polygon needs three vertices | P3 | 1. Polygon tool: place 2 points, click the first. | The polygon does not close with fewer than 3 vertices. | |
| REG-025 | Cancel an unfinished polygon | P3 | 1. Place 3 points. 2. Press Esc. | Record behaviour. No Escape handler is known to cancel it. ⚠ see Known issues (KI-18). | |
| REG-026 | Brush paints a region | P1 | 1. Click Brush. 2. Drag across the image. | A Size slider (default 40, 5–300, step 5, tooltip "Brush diameter in image pixels.") appears; the painted stroke becomes a region. | |
| REG-027 | Brush size | P2 | Brush armed | 1. Set Size to 100 and paint. 2. Set 10 and paint. | The stroke width follows the slider. ⚠ see Known issues (KI-17): on the Image view the size follows screen pixels, so the stroke covers more image when zoomed out. |
| REG-028 | Brush extends a region | P2 | One brush region | 1. Start a stroke inside the region and paint outward. | The existing region grows (it is adopted, no new region). |
| REG-029 | Brush merges regions it touches | P2 | Two separate regions | 1. Paint from one into the other. | The two become one region. |
| REG-030 | Brush erase with Shift | P1 | One brush region | 1. Hold Shift and paint across the region. | The painted area is removed from the region. |
| REG-031 | Shift-brush on empty space | P3 | Brush armed | 1. Hold Shift and paint on empty image. | Nothing happens. |
| REG-032 | Brush donut | P2 | Brush armed | 1. Paint a closed ring, leaving the centre unpainted. | The region has a hole: the centre is not part of it (outline drawn on both rings; Region Editor area excludes the hole). |
| REG-033 | New stroke outside starts a new region | P3 | One brush region | 1. Start a new stroke away from the region. | A second region is created. |
| REG-034 | Wand grows a region | P1 | 1. Press W. 2. Click inside a muscle fibre. | A region follows the fibre's similar-value pixels. Sens. slider shows 2.0 (0.5–10.0, step 0.1). | |
| REG-035 | Wand sensitivity | P2 | Wand armed | 1. Set Sens. to 6, click a fibre. 2. Undo, set 0.8, click again. | Higher values give a smaller, stricter region; lower values a larger one. The new value applies from the next click. |
| REG-036 | Wand drag extends | P2 | Wand armed | 1. Click and drag across neighbouring fibres. | The region keeps growing while dragging. |
| REG-037 | Wand click inside a region adopts it | P3 | One wand region | 1. Click inside it and drag outward. | The same region grows (no new region). |
| REG-038 | Wand merges into other regions | P3 | Two regions | 1. Grow from one into the other. | They merge into one. |
| REG-039 | Wand exact match | P3 | Wand armed | 1. Hold Ctrl (Cmd on macOS) and click. | An exact-match flood fill (no smoothing) is used; the region follows identical pixel values only. |
| REG-040 | Wand erase | P2 | One wand region | 1. Hold Shift and click or drag on the region. | Pixels are removed from the region. Shift-click on empty space does nothing. |
| REG-041 | Wand depends on the display | P3 | img04.png |
1. Wand-click a cell. 2. Undo. 3. Change Min/Max in Channels & Histogram. 4. Click the same point. | The result can differ: the wand reads the displayed pixels (contrast, colour and zoom matter). |
| REG-042 | Vertex eraser | P1 | One freeform region | 1. Press E. 2. Drag the circle across the outline. | A circle cursor of the Radius (default 20, 5–300, step 5) shows; vertices inside it are removed and the outline rejoins at the circle's edge. |
| REG-043 | Eraser deletes small polygons | P2 | A small rectangle-like polygon | 1. Erase until fewer than 3 vertices remain. | The polygon is deleted. |
| REG-044 | Eraser on a polyline | P3 | One polyline | 1. Erase until fewer than 2 vertices remain. | The polyline is deleted. |
| REG-045 | Eraser on a hole | P3 | A donut (REG-032) | 1. Erase the inner ring's vertices. | A hole reduced below 3 vertices is removed (the donut becomes solid). |
| REG-046 | Slider values are per viewer | P3 | Brush size 100 | 1. Open another image. 2. Reload the page. | The value is kept while the viewer exists; after a reload it is back to the default. |
| REG-047 | Drawing in Heatmap | P2 | img01.png, Heatmap |
1. Draw a rectangle, a freeform and a polyline. | All three are drawn on the heatmap and listed in the Region Editor. |
| REG-048 | Regions are per image | P1 | Regions on img01.png |
1. Open img03.png. 2. Re-open img01.png. |
img03.png shows none of them; returning to img01.png restores them. |
| REG-049 | Regions per slice | P2 | micro-ct z-stack, Image view | 1. Draw on slice 10. 2. Step to slice 11. 3. Back to 10. | The region shows only on slice 10. |
Selecting, moving and editing¶
| ID | Title | Pri | Preconditions / data | Steps | Expected result |
|---|---|---|---|---|---|
| REG-060 | Select a region | P1 | Two regions | 1. Press S. 2. Click a region. | It is selected: thicker outline (4 px) and light fill; the matching Region Editor row is highlighted. |
| REG-061 | Add to the selection | P1 | Two regions | 1. Click one. 2. Shift-click (or Ctrl/Cmd-click) the other. | Both are selected. Shift/Ctrl/Cmd-clicking a selected region removes it from the selection. |
| REG-062 | Rubber-band selection | P2 | Three regions | 1. Selection mode. 2. Drag a box on empty space across two regions. | Every region the box intersects is selected. |
| REG-063 | Move a region | P1 | One selected region | 1. Drag its body. | The region moves with the pointer. |
| REG-064 | Resize a rectangle | P2 | One selected rectangle | 1. Drag a corner handle. | The rectangle resizes. |
| REG-065 | Drag a polygon vertex | P2 | One selected polygon | 1. Drag a vertex. | The vertex moves; neighbouring edges follow. Hit tolerance is about 8 px. |
| REG-066 | Edit a hole's vertices | P3 | A selected donut | 1. Drag an inner-ring vertex. | The hole's shape changes. |
| REG-067 | Add a vertex | P2 | One selected polygon | 1. Click Add a vertex. 2. Click an edge. | A new vertex is inserted on that edge. |
| REG-068 | Delete a vertex | P2 | One selected polygon | 1. Click Delete a vertex. 2. Click a vertex. | The vertex is removed. |
| REG-069 | Selection mode disarms drawing | P2 | Wand armed | 1. Press S. | The wand is disarmed; Selection is highlighted; the Sens. slider disappears. |
Deleting, undo and redo¶
| ID | Title | Pri | Preconditions / data | Steps | Expected result |
|---|---|---|---|---|---|
| REG-080 | Delete with the trash button | P1 | Two selected regions | 1. Click Delete selected region. | Both selected regions are deleted. |
| REG-081 | Delete with keys | P1 | One selected region each time | 1. Press Del. 2. Repeat with Backspace. 3. Repeat with D. | Each key deletes the selection. ⚠ see Known issues (KI-01): d may also pan the image when the canvas has focus. |
| REG-082 | Undo | P1 | Draw one rectangle | 1. Press Ctrl+Z (Cmd+Z). | The rectangle disappears. The Undo button greys out when nothing is left to undo. |
| REG-083 | Redo | P1 | After REG-082 | 1. Press Ctrl+Shift+Z. 2. Undo again, then press Ctrl+Y. | The rectangle comes back each time. |
| REG-084 | Undo depth is 10 | P2 | 1. Draw 12 rectangles. 2. Press undo 12 times. | Only the last 10 are undone; 2 rectangles remain and Undo is greyed out. | |
| REG-085 | A drag is one undo step | P2 | 1. Paint one long brush stroke. 2. Undo once. | The whole stroke is undone in one step (same for wand drag, eraser drag and a move). | |
| REG-086 | New action clears redo | P2 | 1. Draw A, undo. 2. Draw B. 3. Try redo. | Redo is greyed out; A does not come back. | |
| REG-087 | Image switch clears history | P2 | Draw on img01.png |
1. Open img03.png, then img01.png. 2. Press undo. |
The regions are still on img01.png but nothing can be undone. |
| REG-088 | Undo covers region actions | P2 | Two regions merged (REG-101) | 1. Undo. | The merge is reversed: the two original regions are back. |
| REG-089 | Undo/redo buttons tooltips | P3 | 1. Hover Undo and Redo. | "Undo the last region action (Ctrl+Z). Up to 10 actions can be undone." and "Redo the last undone region action (Ctrl+Shift+Z / Ctrl+Y)." |
Region actions (right-click)¶
| ID | Title | Pri | Preconditions / data | Steps | Expected result |
|---|---|---|---|---|---|
| REG-100 | Region entries appear with regions | P1 | One region, nothing selected | 1. Right-click the image. | Select all regions is at the top of the menu; the selection actions are not shown until something is selected. |
| REG-101 | Select all regions | P1 | Three regions and one intensity line | 1. Right-click → Select all regions. | All three regions are selected; the intensity line is not. |
| REG-102 | Right-click acts on the current selection | P2 | Two regions, A selected | 1. Right-click on B → Delete region. | A (the selection) is deleted, not B. ⚠ see Known issues (KI-19). |
| REG-103 | Merge / group (touching) | P1 | Two overlapping freeform regions, both selected | 1. Right-click → Merge / group. | One region replaces them, taking the first selected region's colour and class. The result is selected. |
| REG-104 | Merge / group (disjoint) | P2 | Two separate regions selected | 1. Merge / group. | One multi-part region (two pieces, one row in the Region Editor). |
| REG-105 | Merge needs two closed regions | P3 | One region and one polyline selected | 1. Right-click. | Merge / group is not offered (polylines are excluded; at least 2 closed regions are needed). |
| REG-106 | Ungroup | P2 | The multi-part region from REG-104 | 1. Right-click → Ungroup. | One region per piece. Ungroup is only offered when a multi-part region is selected. |
| REG-107 | Inverse | P1 | Two regions selected | 1. Right-click → Inverse. | A single region covering the whole image with the two regions as holes replaces the selection. |
| REG-108 | Inverse of a donut | P3 | A donut selected | 1. Inverse. | The donut's hole becomes a solid island inside the inverse. |
| REG-109 | Inverse with nothing eligible | P3 | Only a polyline selected | 1. Right-click. | Inverse is not offered; if triggered with nothing closed, a warning "Nothing to invert — select one or more closed regions first." shows. |
| REG-110 | Simplify presets | P2 | A wand region (many vertices) selected | 1. Right-click → Simplify → Light (1 px), then Medium (3 px), then Strong (8 px). | The vertex count drops each time; holes are simplified too; rectangles and polylines are unchanged. |
| REG-111 | Simplify custom | P2 | A wand region selected | 1. Simplify → Custom…. 2. Set 6 px. 3. Apply. | Modal "Simplify region(s)" with "Altitude threshold: N px", slider 1–20 (default 3), hint "Vertices within this distance of the line between their neighbours are removed.", Cancel / Apply. Apply simplifies. |
| REG-112 | Simplify keeps tiny rings | P3 | A small triangle-like region | 1. Simplify → Strong. | A ring that would drop below 3 vertices keeps its original points. |
| REG-113 | Convert to Bézier | P2 | A polygon selected, Image view | 1. Right-click → Convert to Bézier. | The region becomes a smooth curve with draggable handles. |
| REG-114 | Convert to polygon | P2 | The Bézier region selected | 1. Right-click → Convert to polygon. | It becomes a straight-edged polygon again. |
| REG-115 | Bézier entries only in the Image view | P3 | img01.png, Heatmap |
1. Select a polygon, right-click. | Convert to Bézier / to polygon are not offered. ⚠ see Known issues (KI-16) for the napari Image view. |
| REG-116 | Simplify drops Bézier smoothing | P3 | A Bézier region | 1. Simplify → Light. | The region becomes a plain polygon. |
| REG-117 | Delete region from the menu | P2 | One region selected | 1. Right-click → Delete region. | The region is deleted. |
| REG-118 | Large merges are approximate | P3 | WSI CMU-1, two very large regions (bounding box above ~16 MP) |
1. Merge them. | The merge succeeds; the boundary may be slightly less exact (rasterised at reduced resolution). |
| REG-119 | Each action is one undo step | P2 | After REG-107 | 1. Undo once. | The original two regions are back. |
Region appearance and Plotly specifics¶
| ID | Title | Pri | Preconditions / data | Steps | Expected result |
|---|---|---|---|---|---|
| REG-130 | Unselected vs selected look | P3 | Two regions, one selected | 1. Compare. | Unselected: 2 px outline, no fill. Selected: 4 px outline, 35% fill. |
| REG-131 | Donut in Heatmap | P3 | A donut, Heatmap | 1. Switch to Heatmap. | Record how the hole is drawn (exterior only fill is suspected). ⚠ see Known issues (KI-20). |
| REG-132 | Region sources not drawn in Plotly | P3 | A large GeoJSON (≥ 1,000,000 characters) imported (see RED cases) | 1. Switch to Heatmap. | The region-source features are not drawn; only regions already taken from the source show. |