I am using itk and vtk in Python. Specifically I am trying to convert an ITK image to a VTK image using the function itk.ImageToVTKImageFilter. I am currently trying to replicate the code here. If I even try to access this function (just to read the documentation!) then it causes Python to crash and exit.
Has anyone else tested this function and had problems? Should I file a bug report?
Versions:
OS: Windows 7
Python 3.6
ITK v5.0.0.post1 from PyPi
VTK v8.1.2 from PyPi
Hi Matt,
I use the latest itk-vtkglue using this : python -m pip install itk-vtkglue on Ubuntu 18, but when I tried to run the example it coredumped. This is the code sample:
import itk
import sys
Thank you for the detailed, self-contained description of the issue. I was able to reproduce the segfault. I am building in Debug to isolate the issue.
After several gooling and research on code, I was able to use itk.ImageToVTKImageFilter by using my own built ITK source code. For those whose are new comer like me, hope this help you. First of all, I compile source code of ITK release version (ITK Release). Note that I tried the ITK Github (ITK Github), but did not succeed. So I recommend you to compile with Release version. For VTK source code, I also used the the Release version 8.2, not the Github code. The next step I did is to enable the ITK VTK Glue in CMakeCache to ON,adn ITK_WRAP_PYTHON to ON. like this: