TriageSession Widget
Overview
The TriageSession_Widget provides the Qt UI for the TriageSession core library and integrates it into the EditorState/EditorRegistry framework.
Source Location
src/WhiskerToolbox/TriageSession_Widget/
Directory Structure
TriageSession_Widget/
├── CMakeLists.txt
├── TriageSessionWidgetRegistration.hpp/cpp ← Module registration
├── Core/
│ └── TriageSessionState.hpp/cpp ← EditorState subclass
└── UI/
├── CommandPickerDialog.hpp/cpp ← Modal command selection dialog
├── CommandRowWidget.hpp/cpp ← Expandable command row with AutoParamWidget
├── GuidedPipelineEditor.hpp/cpp ← Visual command list editor
└── TriageSessionProperties_Widget.hpp/cpp ← Properties panel
Library
- CMake target:
TriageSession_Widget(static library) - Dependencies:
Qt6::Widgets,Qt6::Core,Qt6::Gui,AutoParamWidget,EditorState,DataManager,StateManagement,TriageSession
Architecture
TriageSessionState (EditorState)
Follows the standard EditorState pattern with a reflect-cpp serializable data struct:
struct TriageSessionStateData {
std::string instance_id;
std::string display_name = "Triage Session";
std::optional<std::string> pipeline_json; // CommandSequenceDescriptor
std::string tracked_regions_key = "tracked_regions"; // DigitalIntervalSeries key
};Key design decisions:
- State machine is NOT serialized. The
TriageSessionstate machine always resets toIdleon workspace load — never resume mid-triage. - Pipeline JSON is serialized. The user’s configured pipeline persists across workspace save/restore.
- Tracked regions key is serialized. References the
DigitalIntervalSeriesthat records which frame ranges have been triaged.
Registration
Registered via TriageSessionWidgetModule::registerTypes() using create_editor_custom to provide EditorRegistry access for time tracking:
- Type ID:
"TriageSessionWidget" - Display Name:
"Triage Session" - Menu Path:
"View/Tools" - Zone: Right (properties as tab)
- Allow Multiple: false
- Custom Editor: Uses
create_editor_custom(needsEditorRegistryfortimeChanged)
Widget UI
The TriageSessionProperties_Widget provides the complete triage workflow UI:
Status Section
Displays the current state machine state (Idle / Marking) and the current frame number. When marking, also shows the mark frame.
Controls Section
Three buttons for the triage workflow:
- Mark — Starts marking from the current frame. Enabled only in
Idlestate. - Commit — Executes the pipeline for
[mark_frame, current_frame]. Enabled only inMarkingstate with a valid pipeline loaded. - Recall — Aborts the current marking and returns to
Idle. Enabled only inMarkingstate.
Pipeline Section
- Pipeline name — Displays the name from
CommandSequenceDescriptor::name - Load JSON… button — Opens a file dialog (via
AppFileDialog) to load a pipeline JSON file - Guided Pipeline Editor — Visual command list populated by
commands::getAvailableCommands(). Each command is an expandable row with anAutoParamWidgetfor parameter editing. Supports add, remove, and reorder. Text fields accept${variable}references (e.g.${mark_frame}). - Raw JSON (collapsible) — Inline editor for viewing/editing pipeline JSON directly. Bidirectionally synced with the guided editor. Changes in either direction update the session pipeline and the other view.
Guided Editor Components
- CommandPickerDialog — Modal dialog listing all registered commands from
commands::getAvailableCommands(). Shows command description and category. - CommandRowWidget — Expandable row with command name header, move-up/down buttons, remove button, and a collapsible
AutoParamWidgetfor parameters. - GuidedPipelineEditor — Container managing the list of
CommandRowWidgets plus an “Add Command…” button. ProvidestoSequence()/fromSequence()for bidirectionalCommandSequenceDescriptorconversion.
Tracked Regions Section
Displays a summary of the tracked regions DigitalIntervalSeries:
- Interval count
- Total frame count across all intervals
- Shows the tracked regions key if no data exists yet
The summary updates automatically when the time position changes (on each EditorRegistry::timeChanged signal) to reflect newly committed regions.
Signals
| Signal | Description |
|---|---|
pipelineChanged() |
Emitted when the pipeline JSON changes |
stateChanged() |
Standard EditorState signal (tracked regions key, etc.) |
See Also
- TriageSession Core Library — non-Qt state machine
- Command Architecture — underlying command system
- Command Architecture Roadmap — implementation plan