# Add two surfaces to vtmkscripts.vmtkSurfaceViewer

**URL:** <https://discourse.slicer.org/t/add-two-surfaces-to-vtmkscripts-vmtksurfaceviewer/25014>\
**Category:** VMTK\
**Created:** [August 30, 2022, 7:09pm UTC](https://discourse.slicer.org/t/add-two-surfaces-to-vtmkscripts-vmtksurfaceviewer/25014 "2022-08-30T19:09:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlosar](https://avatars.discourse-cdn.com/v4/letter/c/49beb7/32.png) [@carlosar](https://discourse.slicer.org/u/carlosar)\
**Post date:** [August 30, 2022, 7:09pm UTC](https://discourse.slicer.org/t/add-two-surfaces-to-vtmkscripts-vmtksurfaceviewer/25014/1 "2022-08-30T19:09:48Z")

</div>

I’d like to compare the pre and post smoothed surface from the marching cubes script. Here is part of my code. I’m building my own pypes script, so I am trying to replicate what is found in this tutorial at the end: [Prepare a surface for mesh generation | vmtk - the Vascular Modelling Toolkit](http://www.vmtk.org/tutorials/SurfaceForMeshing.html)

```auto
surface = vmtkscripts.vmtkMarchingCubes()
surface.Image = voi_selector.Image # image is loaded from CT data and the voi_selector crops the region of interest using vmtkscripts.vmtkImageVOISelector()
surface.Level = l
surface.Connectivity = 1
surface.Execute()

surface_viewer = vmtkscripts.vmtkSurfaceViewer()
surface_viewer.Surface=surface.Surface
surface_viewer.Execute()

smooth = vmtkscripts.vmtkSurfaceSmoothing()
smooth.NumberOfIterations = 10
smooth.PassBand = 0.1
smooth.Surface = surface.Surface
smooth.Execute()
surface_viewer.surface = smooth.Surface
surface_viewer.Execute()

```

What I am trying to do is just add both surfaces to the same viewer. Additionally, I am selecting various locations in my image (by looping through different bounds using the `vmtkscripts.vmtkImageVOISelector()` and I would also like to see them all at the same viewer. Currently, I save the intermediate steps, and open them in a Paraview, but wondering if I can do it all using the viewer.

Thanks in advance,  
Carlos
