I had a problem today compiling the PyBuffer extension to WrapITK. I got a bunch of errors like this:
…/ExternalProjects/PyBuffer/itkPyBuffer.txx: In static member function ‘static PyObject* itk::PyBuffer<TImage>::GetArrayFromImage(TImage*) [with TImage = itk::Image<float, 2u>]’:
…/ExternalProjects/PyBuffer/wrap_itkPyBufferPython.cxx:1397: instantiated from here
…/ExternalProjects/PyBuffer/itkPyBuffer.txx:64: error: cannot convert ‘int*’ to ‘npy_intp*’ in argument passing
Well, I spent hours looking at changelogs and searching Google seeing if anyone had found a solution to the problem, like I usually do. After I got home and had dinner, I went back and just changed the line:
int dimensions[ ImageDimension ];
to
npy_intp dimensions[ ImageDimension ];
Such a simple fix! I guess I should stop assuming other people have the answer and just do it myself sometimes.
Wow, glad that you found the problem. This has given me a headache for quite some time. Added the patch to Gentoo.
Many thanks!