19

I am trying to use VTK from python. I tried to find and could not realy find anything on the web which can be used for documentation. I tried looking at the c++ documentation but the methods are very different.

Thanks a lot

Shan
  • 18,563
  • 39
  • 97
  • 132
  • I guess you already found the [FAQ](http://www.vtk.org/Wiki/VTK/Python_Wrapping_FAQ#Documentation) and the linked textfiles. (Not really a documentation, but a start) – Jacob Aug 03 '11 at 13:45

3 Answers3

15

You could see the python examples at VTK's wiki. There is another resource by going to the official nightly documentation and looking for a particular class; in the section examples for many (not all) classes you can find implementations in python (also in c++ and tcl). A third option is to go to the source folder of your last downloaded release of VTK; look for the folder "Examples", there you will also find different VTK implementations in python (besides C++ and tcl)

CodificandoBits
  • 970
  • 9
  • 18
10

I recommend you use Mayavi and TVTK from Enthought, the API is much pythonic:

http://code.enthought.com/projects/mayavi/

HYRY
  • 94,853
  • 25
  • 187
  • 187
  • 10
    This is poor advice for the purpose of finding vtk documentation, because mayavi documentation documents mayavi which is much more streamlined and different from vtk, and tvtk doesn't have any unique non-vtk documentation because its literally just pythonic vtk – aestrivex Nov 18 '13 at 20:48
  • I don't think this is poor advice. The point is that VTK has proprietary documentation (the books). Pointing someone to a better documented wrapper IS good advice. – polarise Feb 19 '16 at 15:06
  • Very poor advice, mayavi is not kept updating and I could not install it on windows 10 64bit. – Khalil Al Hooti Mar 23 '18 at 05:44
  • @KhalilAlHooti, you can download ETS, VTK, mayavi whl files from here: https://www.lfd.uci.edu/~gohlke/pythonlibs/#mayavi – HYRY Mar 23 '18 at 08:04
  • @HYRY Thank you very much, really appreciate it. – Khalil Al Hooti Mar 24 '18 at 08:38
  • @HYRY I am getting this error, Invalid Qt API 'pyqt5', valid values are: 'pyqt' or 'pyside', using latest anaconda python 3.6.4 – Khalil Al Hooti Mar 24 '18 at 09:38
  • @KhalilAlHooti I think mayavi use pyqt4, but you installed pyqt5. – HYRY Mar 24 '18 at 09:53
  • @HYRY Thank you for your support and help, I am using anaconda distribution, pyqt5 is probably pre installed, and is the one used by spyder the ide I am using – Khalil Al Hooti Mar 24 '18 at 20:08
0

On the VTK website you can find the VTK User's Guide. It is pretty thorough.

Poiex
  • 138
  • 10