The folders have a special folder display node, but it is only created when you show/hide it in the Data module (you’ll notice because the color item will appear in its row). In theory you can create it programmatically, but as I see that function is not python wrapped. This is the code:
pluginHandlerSingleton = slicer.qSlicerSubjectHierarchyPluginHandler.instance()
folderPlugin = pluginHandlerSingleton.pluginByName('Folder')
folderPlugin.createDisplayNodeForItem(folderItemID)
If you need to create the display node programmatically, there are two ways:
- Do in Python what this
createDisplayNodeForItem
function does - Fix Python wrapping of the function