Visualization bug in subject hierarchy

I have solved by forcing the view to display another node

    for color in ['Red', 'Yellow', 'Green']:
        slicer.app.layoutManager().sliceWidget(color).sliceLogic().GetSliceCompositeNode().SetBackgroundVolumeID(minCTID)
        slicer.app.layoutManager().sliceWidget(color).sliceLogic().GetSliceCompositeNode().SetForegroundVolumeID(minSPECTID)

This way the shnode is forced to refresh, I still don’t know how to do that but this trick worked out

The above does not work for tables, charts and plots, actually now is even worse than before:

So How can I create Display nodes for tables, charts and plots to be handled by the folder display node?

Thanks for the feedback.

Why did you need to add this?

Because otherwise the folder is created without a Display node, (No eye in the view)

Currently this is how you can set the folder visibility from code. The generic setItemVisibility uses CreateDefaultDisplayNodes in the displayable node and since the folder does not have a displayable node, it uses a function in the plugin that creates the special folder display node that is needed. I have not found a solution for this yet (and was not a high priority either).

@Alex_Vergara The folder visibility is considered by the displayable managers, so to fix show/hiding certain types of nodes in folders this has to be added to the corresponding displayable manager.

The old behavior is still available: right-click on the eye icon and choose “Show all children” or “Hide all children”.

How could we apply this to for example volumes, tables, and plots? They do not have displayable managers. Should the volumes plugin observe the parent folder visibility and change visibility accordingly (perform the same action when clicking on the eye icon of the individual SH item)?

Very good point.

Something like this would work. However I probably wouldn’t include volumes in this. Volumes did not change visibility in the past based on folder visibility, because they are so differently visualized. There is a ‘Show volumes in study’ option for this if I remember correctly.