MeVisLab Scripting Reference
Python NumPy Support

MeVisLab supports NumPy nd-arrays in various places. Using NumPy arrays makes sense when you want to pass large amounts of data between Python and C++ wrappers. NumPy arrays are automatically converted to QList<[double|float|int|...]> or QVariantList when passed into a wrapper methods. As a general convention, we use the term NumPyArray whenever we mean a numpy.ndarray, because ndarray is not commonly known to people that don't use NumPy a lot.

The following classes support NumPy:

You can find details on the NumPy API itself at: https://docs.scipy.org/doc/numpy/reference/

The following code shows an example how to create a WEM triangle patch using NumPy:

import numpy
points = numpy.asarray(([0,0,0], [2,0,0], [2,1,0], [0,1,0]), numpy.float64)
triangles = numpy.asarray(([0,1,2], [1,2,3]), numpy.uint32)
patch = wem.addTrianglePatchFromNumPyArray(points, triangles)
QObject * createMLBaseObject(const QString &baseClassName, const QVariantList &arguments=QVariantList())
Creates a new reference-counted ml::Base object, conveniently wrapped for scripting; which arguments ...