Doing the obvious

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.

1 comment to Doing the obvious

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>