Resample segments in segmentation using Python scripting

This should resample all the segments in the segmentation using the current geometry:

segmentationNode = getNode('Segmentation')
segGeomLogic = slicer.vtkSlicerSegmentationGeometryLogic()
segGeomLogic.SetInputSegmentationNode(segmentationNode)
segGeomLogic.SetSourceGeometryNode(segmentationNode)
segGeomLogic.CalculateOutputGeometry()
segGeomLogic.ResampleLabelmapsInSegmentationNode()