Missing Examples ImportPixelBufferIntoAnImage/Code.py, and WRAP_PYTHON question


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

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/

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:


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.

1 Like

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