Getting an error running

Operating system:Windows10
Slicer version:4.1120200930

I am a novice and learning scripting slicer.
I copied lassoan’s to Python Interactor and got Error for line 41:

surfaceMesh = segmentationNode.GetClosedSurfaceRepresentation(addedSegmentID)

Traceback (most recent call last):
File “”, line 1, in
TypeError: GetClosedSurfaceRepresentation() takes exactly 2 arguments (1 given)

Is there any preparation I need before running the example?

There were some updates to the way representation access was handled from segmentation nodes in 4.11. It looks like hasn’t been updated.

If you replace the line with the following, it should work as intended:

surfaceMesh = segmentationNode.GetClosedSurfaceInternalRepresentation(addedSegmentID)

1 Like

Thanks @Sunderlandkyl, I’ve updated the script.

1 Like

Thank you. It worked perfectly.