I am creating multiple lineNodes and storing them in multiple folders with Python console in Slicer. E.g. I have folder1 with line1-1, line2-2 and folder2 with line2-1, line2-2. After creating, I want to set visibility to 0 and deexpand the folders. But the following code works only for deexpanding the folders and it just ignores the first line.
for folderID in folderIDsList: shNode.SetItemDisplayVisibility(folderID,0) shNode.SetItemExpanded(folderID, 0)
Lets say ‘folderIDsList = [30,42]’. If I then run single line command ‘shNode.SetItemDisplayVisibility(42,0)’ it also does not do anything.
But if I click with my mouse on the Eye by the folder in the module panel and run the for-loop again, it works!
Could you please explain this behavior to me?
Thank a lot!
Ps.: ‘shNode = slicer.mrmlScene.GetSubjectHierarchyNode()’