@staticmethod
    def getFirstLabelmapNode():
        nodes = slicer.mrmlScene.GetNodesByClass("vtkMRMLLabelMapVolumeNode")
        nodes.UnRegister(nodes)
        if nodes.GetNumberOfItems() > 0:
            return nodes.GetItemAsObject(0)
        return None
Get the first vtkMRMLLabelMapVolumeNode in the scene
dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/CIP_Common/CIP/logic/SlicerUtil.py/SlicerUtil.getFirstLabelmapNode