Insert sequence Browser Toolbar in a python module


I am trying to develop a python scripted module using Sequences extension. I already successfully create a sequence (although it appears as a vtkMRMLScalarVolumeNode) and I can display the sequence by using the Sequence Browser Toolbar of 3D slicer 4.11.

I want to insert the sequence browser toolbar in my own module but it does not activate when the sequence is created.

Can you explained me what is missing or what is wrong in my code please? Thank you!

self.sequenceBrowserToolbarButton = slicer.qMRMLSequenceBrowserToolBar()

self.sequenceBrowserToolbarButton.connect('activeBrowserNodeChanged(vtkMRMLNode*)', self.oncreateSequenceButton)

def oncreateSequenceButton(self):
    exitString = logic.createSequence(patient.fourDCT)

    if exitString:

MRML widgets such as qMRMLSequenceBrowserToolBar in this case require that the MRML scene be set.

1 Like

Thank you it worked! Another question: Is it possible to change the width of the widget?

There are various methods for manipulating a QWidget’s size which you can review at