# API for Surface Models -\> Model Maker for Python Access?

**URL:** <https://discourse.slicer.org/t/api-for-surface-models-model-maker-for-python-access/329>\
**Category:** Support\
**Created:** [May 16, 2017, 7:31pm UTC](https://discourse.slicer.org/t/api-for-surface-models-model-maker-for-python-access/329 "2017-05-16T19:31:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jks1995](https://avatars.discourse-cdn.com/v4/letter/j/90db22/32.png) [@jks1995](https://discourse.slicer.org/u/jks1995)\
**Post date:** [May 16, 2017, 7:31pm UTC](https://discourse.slicer.org/t/api-for-surface-models-model-maker-for-python-access/329/1 "2017-05-16T19:31:49Z")

</div>

Does the surface models module have an api that will allow you to access its features via python?

---

<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:** [May 16, 2017, 7:32pm UTC](https://discourse.slicer.org/t/api-for-surface-models-model-maker-for-python-access/329/2 "2017-05-16T19:32:23Z")

</div>

Yes, all features of all modules are accessible from Python. What would you like to achieve?

---

<div class="post-metadata">

**Author:** ![jks1995](https://avatars.discourse-cdn.com/v4/letter/j/90db22/32.png) [@jks1995](https://discourse.slicer.org/u/jks1995)\
**Post date:** [May 18, 2017, 2:31pm UTC](https://discourse.slicer.org/t/api-for-surface-models-model-maker-for-python-access/329/3 "2017-05-18T14:31:10Z")

</div>

I would like to be able to render a 3D view in a slicelete and then display the model in a 3D view. I have a label map I would like to provide as input.

---

<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:** [May 18, 2017, 8:45pm UTC](https://discourse.slicer.org/t/api-for-surface-models-model-maker-for-python-access/329/4 "2017-05-18T20:45:15Z")

</div>

The simplest way of showing segmentation in 2D and 3D is to convert your labelmap node to a segmentation node:

```
seg=slicer.mrmlScene.AddNewNodeByClass('vtkMRMLSegmentationNode')
slicer.modules.segmentations.logic().ImportLabelmapToSegmentationNode(getNode('label'), seg)
seg.CreateClosedSurfaceRepresentation()

```

After this conversion you can delete your original labelmap node.
