make segmentation labelmap from markupsclosedcurve

slicer version: 4.11.10

I’m trying to make a binary label mask from a closed curve markup. Here is my code

curves=slicer.util.getNodesByClass(“vtkMRMLMarkupsClosedCurveNode”)
areaMm2 = slicer.modules.markups.logic().GetClosedCurveSurfaceArea(curves[0], crossSectionSurface)
modelNode = slicer.modules.models.logic().AddModel(crossSectionSurface)

inputModel=getNode(“Model_1”)
referenceVolumeNode=getNode(“1: No series description_1”)
seg = slicer.mrmlScene.AddNewNodeByClass(‘vtkMRMLSegmentationNode’)
seg.SetReferenceImageGeometryParameterFromVolumeNode(referenceVolumeNode)
slicer.modules.segmentations.logic().ImportModelToSegmentationNode(inputModel, seg)
seg.CreateBinaryLabelmapRepresentation()

outputLabelmapVolumeNode = slicer.mrmlScene.AddNewNodeByClass(‘vtkMRMLLabelMapVolumeNode’)
slicer.modules.segmentations.logic().ExportVisibleSegmentsToLabelmapNode(seg, outputLabelmapVolumeNode, referenceVolumeNode)
outputLabelmapVolumeArray = (slicer.util.arrayFromVolume(outputLabelmapVolumeNode) * 100).astype(‘int8’)

Here is what I get

I can only see the segmentation in 3D view however I couldn’t see it in other view and also the lablemap is empty.
I think it is because the segmentation is closed surface representation not binary labelmap representation. Nevertheless I couldn’t get binary labelmap representation though this code seg.CreateBinaryLabelmapRepresentation()
How can I fix it?