Set Image Direction from numpy array

Here is the matrix

eigenVectors.npy (200 Bytes)

I obtain it from the following :

# Main axes computation
objectImageFilter.Update()
mainConnComp = itk.GetArrayViewFromImage(objectImageFilter.GetOutput())
pointsCoords = numpy.asarray(numpy.where(mainConnComp)).T
# rotationCenter = [round(i/2) for i in mainConnComp.shape]  # rotate around the image center
rotationCenter = [int(i) for i in numpy.mean(
    pointsCoords, axis=0)]  # rotate around the object center
covarianceMatrix = numpy.cov(pointsCoords, rowvar=False)
pointsCoords = None
eigenValues, eigenVectors = numpy.linalg.eigh(covarianceMatrix)
covarianceMatrix = None
descendantIndices = numpy.argsort(eigenValues)[::-1]
eigenVectors = eigenVectors[:, descendantIndices]