# Getting an error running ExtractSkin.py

**URL:** <https://discourse.slicer.org/t/getting-an-error-running-extractskin-py/14133>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [October 19, 2020, 12:17pm UTC](https://discourse.slicer.org/t/getting-an-error-running-extractskin-py/14133 "2020-10-19T12:17:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![snish1](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@snish1](https://discourse.slicer.org/u/snish1)\
**Post date:** [October 19, 2020, 12:17pm UTC](https://discourse.slicer.org/t/getting-an-error-running-extractskin-py/14133/1 "2020-10-19T12:17:23Z")

</div>

Operating system:Windows10  
Slicer version:4.1120200930

Hi.  
I am a novice and learning scripting slicer.  
I copied lassoan’s ExtractSkin.py 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?

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [October 19, 2020, 1:11pm UTC](https://discourse.slicer.org/t/getting-an-error-running-extractskin-py/14133/2 "2020-10-19T13:11:09Z")

</div>

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

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

`surfaceMesh = segmentationNode.GetClosedSurfaceInternalRepresentation(addedSegmentID)`

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 19, 2020, 1:21pm UTC](https://discourse.slicer.org/t/getting-an-error-running-extractskin-py/14133/3 "2020-10-19T13:21:33Z")

</div>

Thanks @Sunderlandkyl, I’ve updated the script.

---

<div class="post-metadata">

**Author:** ![snish1](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@snish1](https://discourse.slicer.org/u/snish1)\
**Post date:** [October 22, 2020, 2:47am UTC](https://discourse.slicer.org/t/getting-an-error-running-extractskin-py/14133/4 "2020-10-22T02:47:05Z")

</div>

Thank you. It worked perfectly.
