Using Python 3.6 and Python for dotNET/pythonnet I have manged to get hold of an image array. This is of type System.Single[,]
I'd like to convert that to a numpy array so that I can actually do something with it in Python. I've set up a function to step through that array and convert it elementwise - but is there something more sensible (and faster) that I could use?
def MeasurementArrayToNumpy(TwoDArray): hBound = TwoDArray.GetUpperBound(0) vBound = TwoDArray.GetUpperBound(1) resultArray = np.zeros([hBound, vBound]) for c in range(TwoDArray.GetUpperBound(0)): for r in range(TwoDArray.GetUpperBound(1)): resultArray[c,r] = TwoDArray[c,r] return resultArray