morphMan
morphMan copied to clipboard
Take better advantage of vtk.util.numpy_support
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.
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/