Available Actions
Complete reference of actions that can be assigned to mouse buttons.
Note
This documentation is auto-generated from the ActionRegistry.
Run test_generate_actions_reference.py in Slicer to regenerate.
Editing Actions
Actions for editing operations like undo and redo.
Action ID |
Description |
Icon |
|---|---|---|
|
Redo the last undone action |
|
|
Undo the last action |
|
Segment Editor Actions
Actions specific to the Segment Editor module. Only available when Segment Editor is active.
Action ID |
Description |
Icon |
|---|---|---|
|
Add new segment |
|
|
Activate Erase effect |
|
|
Activate Paint effect |
|
|
Select next segment |
|
|
Select previous segment |
|
Markups Actions
Actions for markup and fiducial operations. Only available when Markups module is active.
Action ID |
Description |
Icon |
|---|---|---|
|
Delete selected control point |
|
|
Start placing fiducial points |
|
Volume Rendering Actions
Actions for controlling volume rendering visibility.
Action ID |
Description |
Icon |
|---|---|---|
|
Toggle volume rendering visibility |
|
Discovered Slicer Actions
MouseMaster can discover additional actions from Slicer’s menu system at runtime.
Use ActionRegistry.discover_slicer_actions() to populate the registry with
all available QActions from Slicer’s main window.
These actions have IDs prefixed with slicer_menu_ followed by the Qt object name.
Example:
from MouseMasterLib.action_registry import ActionRegistry
registry = ActionRegistry.get_instance()
count = registry.discover_slicer_actions()
print(f'Discovered {count} menu actions')
Custom Actions
You can define custom actions using:
Python Commands
Execute arbitrary Python code:
{
"action": "python_command",
"parameters": {
"command": "slicer.util.selectModule('SegmentEditor')"
}
}
Keyboard Shortcuts
Simulate keyboard input:
{
"action": "keyboard_shortcut",
"parameters": {
"key": "Z",
"modifiers": ["ctrl"]
}
}
See Adding Actions for details on creating custom actions.
Action Availability
Actions may only be available in certain contexts:
- Always
Action works in any module
- Segment Editor
Action only works when Segment Editor is active
- When X selected/loaded
Action requires specific state (item selected, volume loaded, etc.)
MouseMaster checks availability before executing. Unavailable actions are silently skipped.
Implementing Custom Actions
See Adding Actions for how to create new actions.