Missing Examples ImportPixelBufferIntoAnImage/Code.py, and WRAP_PYTHON question

Hi,

I’m building InsightToolkit-5.1.0 on Ubuntu 20.04 with BUILD_EXAMPLES ON and ITK_WRAP_PYTHON ON. Two questions.

The make command succeeded. The make install command generated an errror:
Make Error at Modules/Remote/SphinxExamples/src/Core/Common/ImportPixelBufferIntoAnImage/cmake_install.cmake:57 (file):
file INSTALL cannot find
“/data/pkg/InsightToolkit-5.1.0/Modules/Remote/SphinxExamples/src/Core/Common/ImportPixelBufferIntoAnImage/Code.py”:

I see that ImportPixelBufferIntoAnImage/CMakeLists.txt tries to install that file:
install(FILES Code.cxx CMakeLists.txt Code.py
DESTINATION share/ITKExamples/Code/Core/Common/ImportPixelBufferIntoAnImage/
COMPONENT Code
)

Should I try to get that file or take it out of the CMakeLists install list ?
I see my Example tar file does not have the Code.py file:

tar -vtf InsightSphinxExamples-5.1.0.tar | grep ImportPixelBufferIntoAnImage
drwxrwxr-x root/root 0 2020-06-02 12:41 InsightSphinxExamples-5.1.0/src/Core/Common/ImportPixelBufferIntoAnImage/
-rw-rw-r-- root/root 746 2020-06-02 12:41 InsightSphinxExamples-5.1.0/src/Core/Common/ImportPixelBufferIntoAnImage/CMakeLists.txt
-rw-rw-r-- root/root 4960 2020-06-02 12:41 InsightSphinxExamples-5.1.0/src/Core/Common/ImportPixelBufferIntoAnImage/Code.cxx
-rw-rw-r-- root/root 1007 2020-06-02 12:41 InsightSphinxExamples-5.1.0/src/Core/Common/ImportPixelBufferIntoAnImage/Documentation.rst
-rw-rw-r-- root/root 128 2020-06-02 12:41 InsightSphinxExamples-5.1.0/src/Core/Common/ImportPixelBufferIntoAnImage/OutputBaseline.png.sha512

Does ITK python wrapping support Python2 ?
I set my
PYTHON_EXECUTABLE to a Python2 executable, but I see these
Python3 settings came up in ccmake:
Python3_LIBRARY_DEBUG:FILEPATH=
Python3_LIBRARY_RELEASE:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so
_Python3_INCLUDE_DIR:PATH=/usr/include/python3.8
_Python3_LIBRARY_RELEASE:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so

thanks
Kate

I am not surprised that ImportPixelBufferIntoAnImage/Code.py does not exist, as that example demonstrates a lower-level feature. Code.py should be removed from install(FILES list. It is probably a copy-paste from another example (which contained Python version) that was not cleaned up 100%.

Thanks very much, removing Code.py from install(FILES list in CMakeLists.txt worked. I can now make and make install.
Note I also had to remove Code.py in the ConvertArrayToImage folder, and, I had to change Create3DVolume.cxx, ReadMesh.cxx to Code.cxx in the InsightToolkit-5.1.0/Modules/Remote/SphinxExamples/src/Filtering/ImageGrid/Create3DVolume and src/IO/Mesh/ReadMesh folders.

2 Likes

That sounds like a good cleanup. Can you submit your changes as a patch?

1 Like

I have created Pull Request #200 on https://github.com/InsightSoftwareConsortium/ITKExamples

2 Likes