morphMan icon indicating copy to clipboard operation
morphMan copied to clipboard

Take better advantage of vtk.util.numpy_support

Open aslakbergersen opened this issue 7 years ago • 1 comments

In common.py there are many examples of looping over vtk arrays and insert values into python lists or numpy arrays. These should instead be converted using numpy_support functions.

Furthermore, there might be for-loops that can be vectorized, providing some speed-up to the algorithms.

aslakbergersen avatar Oct 10 '18 22:10 aslakbergersen

If you're not aware, native numpy support is available via VMTK 1.4. Check out the tutorial here: http://www.vmtk.org/tutorials/WorkingWithNumpyArrays.html

Also, tutorials from kitware which are really useful:

  • https://blog.kitware.com/improved-vtk-numpy-integration/
  • https://blog.kitware.com/improved-vtk-numpy-integration-part-2/
  • https://blog.kitware.com/improved-vtk-numpy-integration-part-3/
  • https://blog.kitware.com/improved-vtk-numpy-integration-part-4/
  • https://blog.kitware.com/improved-vtk-numpy-integration-part-5/

rlizzo avatar Nov 06 '18 03:11 rlizzo