# Using vmtk scripts within Slicer with vmtk-extension

**URL:** https://discourse.slicer.org/t/using-vmtk-scripts-within-slicer-with-vmtk-extension/24757
**Category:** VMTK
**Created:** [August 15, 2022, 5:09am UTC](https://discourse.slicer.org/t/using-vmtk-scripts-within-slicer-with-vmtk-extension/24757 "2022-08-15T05:09:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Doodads](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Doodads](https://discourse.slicer.org/u/Doodads)
#### Post date: [August 15, 2022, 5:09am UTC](https://discourse.slicer.org/t/using-vmtk-scripts-within-slicer-with-vmtk-extension/24757/1 "2022-08-15T05:09:10Z")

</div>

Hi, I have a vessel modelling workflow written in python which makes use of vmtk to convert a surface file (.vtk) to a mesh file (.vtu). I would like to migrate the workflow to use the Slicer environment as well as replace some of the scripts (e.g. vmtkcenterlines, vmtkcenterlinesnetwork) with those used in the slicer vmtk-extension.

The workflow makes use of the following vmtk scripts: _vmtksurfacereader, vmtksurfacekiteremoval, vmtksurfacesmoothing, vmtkvmtkcenterlines, vmtkcenterlinesnetwork, vmtksurfaceclipper, vmtkbranchclipper, vmtksurfaceconnectivity, vmtkflowextensions, vmtkdistancetocenterlines, vmtksurfaceremeshing, vmtkmeshgenerator, vmtksurfacewriter, vmtkmeshwriter_. Apart from the above vmtk rendering scripts like _vmtksurfaceviewer_, etc… were used as well. Visualization can be handled by Slicer so I did not include those to the list.

May I confirm that all the vmtk scripts are contained within slicer when I install the extension, or is access limited to those used for the functions present within the extension? (e.g. Can I use vmtkmeshgenerator from within the slicer python interactor?)

Additionally, how to access vmtk from slicer? I can’t import vmtk within the slicer python interactor. I get the following error when I input `import vmtk`

```auto
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ModuleNotFoundError: No module named 'vmtk'

```

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [August 15, 2022, 3:05pm UTC](https://discourse.slicer.org/t/using-vmtk-scripts-within-slicer-with-vmtk-extension/24757/2 "2022-08-15T15:05:00Z")

</div>

I believe the packaging is different in the extension. Have a look in the scripted modules to see how they access the vmtk filters and you should be able to do the same.

---

<div class="post-metadata">

### Author: ![nmg-earthling](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@nmg-earthling](https://discourse.slicer.org/u/nmg-earthling)
#### Post date: [February 9, 2024, 7:35pm UTC](https://discourse.slicer.org/t/using-vmtk-scripts-within-slicer-with-vmtk-extension/24757/3 "2024-02-09T19:35:15Z")

</div>

Doodads, did you have any success. I’m struggling with the same problem.
