How to get segment details for a specific frame

Hi,
I am trying to get the number of segmentations done for a frame using python. I am trying this out using the following code

segmentationNodeName = “Segmentation”
segmentationNode = slicer.mrmlScene.GetFirstNodeByName(segmentationNodeName)
segVal = segmentationNode.GetSegmentation()

And what’s the problem?