How to add an observer to the Sequence-Browser of module Sequences?

Hi everyone,

I am trying to write my first extension module, and would like to synchronize the sequence browser in module Sequences and the module I am working on.

How can I add an observer to the Sequence Browser of module Sequences?
And how to change the selection of the sequence browser of module Sequences using codes?

Thank you so much in advance!

Found it. Instead of calling the sequences widget (no signal), we need to call toolBar().
Signal: slicer.modules.sequences.toolBar().activeBrowserNodeChanged.connect()
Aquire: slicer.modules.sequences.toolBar().activeBrowserNode()
Assign: slicer.modules.sequences.widgetRepresentation().setActiveBrowserNode()

1 Like