Labelmap volume visibility toggle in Python

I’d like to be able to toggle a labelmap volume in the slicer viewer. I thought it would work the same like with a segmentation.
laNode = slicer.util.getNodesByClass("vtkMRMLLabelMapVolumeNode")[0] laNode.GetDisplayNode().SetVisibility(False)

However the display still shows the labelmap volume although laNode.GetDisplayNode().GetVisibility() does return 0. Am I doing something wrong here?

Volume layers work differently. You can use this method instead:

https://slicer.readthedocs.io/en/latest/developer_guide/slicer.html#slicer.util.setSliceViewerLayers