minhtan16
(Minh Nguyen)
August 9, 2022, 12:41pm
1
Hi everyone,
I’m looking to retrieve every sequence browser names using python. Considering I have multiple sequence browser :
I would like to retrieve an array containing : SequenceBrowser_1, SequenceBrowser_2, etc
I’m not sure which API to use.
Thanks in advance!
mau_igna_06
(Mauro I. Dominguez)
August 9, 2022, 12:51pm
2
Hi. You should use
nodes = slicer.util.getNodesByClass("vtkMRMLSequenceBrowserNode")
Please let me know if that works
Mauro
minhtan16
(Minh Nguyen)
August 9, 2022, 12:54pm
3
Hi thank you for the quick reply, this works!
1 Like
minhtan16
(Minh Nguyen)
August 9, 2022, 1:44pm
4
I’ve been looking into the api of vtkMRMLSequenceBrowserNode,
I’m now trying to retrieve the sequence nodes associated with the sequence browser.
E.g:
I want to retrieve ThorasicSeq_1_Scans and ThorasicSeq_1_Tracker, do you know a way to do it?
I’m able to retrieve ThorasicSeq_1_Scans by using GetMasterSequenceNode but how do I retrieve every sequence nodes of the current SequenceBrowser?
Here’s the information that I have when printing the sequence browser:
vtkMRMLSequenceBrowserNode (000001D310DB9640)
ID: vtkMRMLSequenceBrowserNode1
ClassName: vtkMRMLSequenceBrowserNode
Name: SequenceBrowser_1
Debug: false
MTime: 253532
Description: (none)
SingletonTag: (none)
HideFromEditors: false
Selectable: true
Selected: false
UndoEnabled: false
Node references:
dataNodeRef0: vtkMRMLScalarVolumeNode1
dataNodeRef1: vtkMRMLLinearTransformNode4
rootNodeRef0: (none)
rootNodeRef1: (none)
sequenceNodeRef0: vtkMRMLSequenceNode1
sequenceNodeRef1: vtkMRMLSequenceNode2
Playback active: false
Playback rate (fps): 10
Playback item skipping enabled: true
Playback looped: true
Selected item number: 95
Recording active: false
Recording on master modified only: false
Recording sampling mode: limitedToPlaybackFrameRate
Index display mode: [indexValue]
Index display format: %.2f
Sequence nodes:
Sequence: ThoracicSeq_1__Scans, Proxy: (none), Playback: 1, Recording: 1, OverwriteProxyName: 0, SaveChanges: 0
Sequence: ThoracicSeq_1__Tracker-ThoracicSeq_1__Tracker-Seq, Proxy: (none), Playback: 1, Recording: 1, OverwriteProxyName: 0, SaveChanges: 0
The function is GetSynchronizedSequenceNodes.
Slicer: vtkMRMLSequenceBrowserNode Class Reference
collection = vtk.vtkCollection()
sequenceBrowserNode.GetSynchronizedSequenceNodes(collection, True)
for i in range(collection.GetNumberOfItems()):
sequenceNode = collection.GetItemAsObject(i)
2 Likes