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

edit_redo

Redo the last undone action

redo

edit_undo

Undo the last action

undo

Segment Editor Actions

Actions specific to the Segment Editor module. Only available when Segment Editor is active.

Action ID

Description

Icon

segment_add

Add new segment

add

segment_editor_erase

Activate Erase effect

erase

segment_editor_paint

Activate Paint effect

paint

segment_next

Select next segment

arrow-down

segment_previous

Select previous segment

arrow-up

Markups Actions

Actions for markup and fiducial operations. Only available when Markups module is active.

Action ID

Description

Icon

markups_delete_point

Delete selected control point

delete

markups_place_fiducial

Start placing fiducial points

fiducial

Volume Rendering Actions

Actions for controlling volume rendering visibility.

Action ID

Description

Icon

volumerendering_toggle

Toggle volume rendering visibility

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.