Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
ITK package requires numpy array be of order='C' before using ITK.GetImageFromArray #1243
Regarding the conversion of Numpy arrays to ITK Images, I have found that an ITK package will report an error if the numpy array is not of order type 'C'. Specifically, when using an ITK Image that has been created from the conversion of a numpy array with itk.CoocurrenceTextureFeaturesImageFilter(), I will get the following error:
Changing the numpy array to order 'C' resolved this issue. This doesn't seem to happen with arbitrarily created arrays using, for example, np.random.rand(), but does happen in my case with a pre-processed image.
The proper format for a numpy array before conversion to ITKImage type.
itk 5.0.1 pypi_0 pypi