# Error while passing a VTK object in VmtkNetworkExtraction

**URL:** https://discourse.vtk.org/t/error-while-passing-a-vtk-object-in-vmtknetworkextraction/3131
**Category:** Support
**Created:** [April 23, 2020, 3:20pm UTC](https://discourse.vtk.org/t/error-while-passing-a-vtk-object-in-vmtknetworkextraction/3131 "2020-04-23T15:20:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Deepa](https://discourse.vtk.org/user_avatar/discourse.vtk.org/deepa/32/1680_2.png) [@Deepa](https://discourse.vtk.org/u/Deepa)
#### Post date: [April 23, 2020, 3:20pm UTC](https://discourse.vtk.org/t/error-while-passing-a-vtk-object-in-vmtknetworkextraction/3131/1 "2020-04-23T15:20:27Z")

</div>

Hello Everyone,  
I’m trying to skeletonize a 3D volume n VMTK using the following code in python

```auto
vmtkCommand = '''vmtksurfacereader -ifile foo.stl
                 --pipe vmtksurfacewriter -ofile foo_net.vtp'''

p = pypes.PypeRun(vmtkCommand)

networkExtraction = vmtkscripts.vmtkNetworkExtraction()
networkExtraction.Surface = 'foo_net.vtp'
networkExtraction.Execute()
network = networkExtraction.Network

```

But I get the following error while passing `surface` in the line networkExtraction.Surface = ‘foo\_net.vtp’.

```auto
line 23, in <module>
    networkExtraction.Execute()
 networkExtraction.SetInputData(self.Surface)
TypeError: SetInputData argument 1: method requires a VTK object

```

Any suggestions to how to resolve this error will be really helpful.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [April 23, 2020, 3:52pm UTC](https://discourse.vtk.org/t/error-while-passing-a-vtk-object-in-vmtknetworkextraction/3131/2 "2020-04-23T15:52:07Z")

</div>

`'foo_net.vtp'` is a string. You’ll need to use a reader to load the file then connect that reader with the extraction object in a pipeline.
