Resample segmentation to higher resolution

Operating system: Windows 10
Slicer version: 5.6.2

Hi,
I am trying to run the code of the script repository: Script repository — 3D Slicer documentation

However, I get: NameError: name ‘segmentationGeometryLogic’ is not defined.

And if I add, segmentationGeometryLogic = slicer.vtkSlicerSegmentationGeometryLogic()

AttributeError: ‘vtkSlicerSegmentationsModuleLogicPython.vtkSlicerS’ object has no attribute ‘SetReferenceImageGeometryInSegmentationNode’

Any help would be greatly appreciated!
Thanks,
Maria