Create a segmentation from a contour file using python

We have a standard workflow that uses a LabelMap file which is then converted to a Segment node.

Is it possible to convert a LabelMapVolume to a Segmentation using the python API?

For reference this is the solution I worked out.

    labelMapNode = slicer.util.getNodesByClass('vtkMRMLLabelMapVolumeNode')[0]
    segNode = slicer.util.getNodesByClass('vtkMRMLSegmentationNode')[0]
    logic = slicer.util.getModuleLogic('Segmentations')
    logic.ImportLabelmapToSegmentationNodeWithTerminology(contourImageNode, segNode, "")