[Insight-users] How to build ITK+WrapITK-python+PyBuffer?
Julien Lamy
lamy at unistra.fr
Fri Jan 8 13:21:07 EST 2010
Le 08/01/10 18:29, Benjamin M. Schwartz a écrit :
> Julien Lamy wrote:
>> Le 08/01/2010 16:50, Benjamin M. Schwartz a écrit :
>>> Dear ITKists,
>>>
>>> I've spent the past few days trying to build ITK with the WrapITK python
>>> bindings, including the PyBuffer class that links ITK to NumPy. I have
>>> tried, for example, enabling WRAP_ITK_PYTHON and ITK_USE_PYTHON_NUMARRAY.
>>> The build runs, but PyBuffer is not produced.
>>>
>>> How can I get PyBuffer and WrapITK out of itk-3.16.0?
>>
>> Hi Ben,
>> Did you configure your PyBuffer build using
>> ExternalProjects/WrapITK/CMakeLists.txt ?
>
> I don't have any directory of the form */ExternalProjects/WrapITK/. Do
> you mean WrapITK/ExternalProjects/PyBuffer/?
Yes, the paths were relative to the root directory of WrapITK.
>> PyBuffer is what WrapITK calls
>> an "external project", and so must be configured, built and installed
>> /after/ you installed WrapITK. Use the CMakeLists.txt in
>> ExternalProjects/WrapITK, tell it where you installed WrapITK, and you
>> should be good to go.
>
> Hmm. That does make sense. I just tried it, but it can't find my numpy
> installation. I get PYTHON_NUMARRAY_INCLUDE_DIR-NOTFOUND. I don't know
> why PyBuffer/FindNUMARRAY.cmake isn't working.
If you're using Linux, it's possible that Numpy is split in two packages
: a "normal", and a "-dev" which includes the .h files that CMake is
looking for. Whatever your OS is, look for a file called
"arrayobject.h", which should be in a path containing something like
"numpy/core/include/numpy". That path (or one of its parents, I can't
remember exactly, but it's explained somewhere in the CMake docs) is the
one CMake is looking for : if auto-detection fails, enter it manually.
If you're missing arrayobject.h, then your numpy installation is incomplete.
--
Julien
More information about the Insight-users
mailing list