Discussion:
[ITK-users] ITKModuleTemplate and external modules for use with python
D***@csiro.au
2018-07-12 11:36:06 UTC
Permalink
Hi All,

I'm revisiting making my own external ITK module (for use in Python) after an initial attempt a while back. This time I've managed to get much further and have managed to successfully create python wheels following the directions on https://github.com/InsightSoftwareConsortium/ITKPythonPackage/blob/master/docs/Build_ITK_Module_Python_packages.rst , I've created Windows wheels via AppVeyor and linux wheels with CircleCI in addition to locally built versions via the docker based method. All tests are passed successfully.

However, after installing them with pip in a fresh virtual environment in a Python 3.6 instance (Anaconda), I seem to always get a kernel crash (segmentation fault) when I try and actually use or create one of my custom filters.

To strip everything back to basics I generated a vanilla external module, using only default values with:

python -m cookiecutter gh:InsightSoftwareConsortium/ITKModuleTemplate

I then built the wheels as described and installed them into the virtual environment.

Using the following basic python script below results in a seg fault,

import itk
InputType = itk.Image[itk.F,2]
OutputType = itk.Image[itk.F,2]
test = itk.MinimalStandardRandomVariateGenerator.New()

I get the same result if I try and create any of the classes defined in ITKModuleTemplate, however I can successfully create standard itk filters.

After running the script with gdb I see that it crashes in the call as follows:

#1 0x00007fffe7405373 in PyInit__ModuleTemplatePython () from /home/tho78s/anaconda3/lib/python3.6/site-packages/itk/Configuration/../_ModuleTemplatePython.so

I'm currently out of ideas as to where the problem lies and I seem to get the identical problem in Windows too.

Any help or pointers in to what is going wrong would be greatly appreciated!

I you want any extra info, feel free to contact me.

Regards,

Darren
Dženan Zukić
2018-07-16 16:35:28 UTC
Permalink
Hi Darren,

can you please re-post this question on the forum
<https://discourse.itk.org/>? Many of us were on vacation in the last few
weeks.

Regards,
DÅŸenan
Post by D***@csiro.au
Hi All,
I’m revisiting making my own external ITK module (for use in Python) after
an initial attempt a while back. This time I’ve managed to get much further
and have managed to successfully create python wheels following the
directions on
https://github.com/InsightSoftwareConsortium/ITKPythonPackage/blob/master/docs/Build_ITK_Module_Python_packages.rst
, I’ve created Windows wheels via AppVeyor and linux wheels with CircleCI
in addition to locally built versions via the docker based method. All
tests are passed successfully.
However, after installing them with pip in a fresh virtual environment in
a Python 3.6 instance (Anaconda), I seem to always get a kernel crash
(segmentation fault) when I try and actually use or create one of my custom
filters.
To strip everything back to basics I generated a vanilla external module,
python -m cookiecutter gh:InsightSoftwareConsortium/ITKModuleTemplate
I then built the wheels as described and installed them into the virtual environment.
Using the following basic python script below results in a seg fault,
import itk
InputType = itk.Image[itk.F,2]
OutputType = itk.Image[itk.F,2]
test = itk.MinimalStandardRandomVariateGenerator.New()
I get the same result if I try and create any of the classes defined in
ITKModuleTemplate, however I can successfully create standard itk filters.
#1 0x00007fffe7405373 in PyInit__ModuleTemplatePython () from
/home/tho78s/anaconda3/lib/python3.6/site-packages/itk/Configuration/../_ModuleTemplatePython.so
I’m currently out of ideas as to where the problem lies and I seem to get
the identical problem in Windows too.
Any help or pointers in to what is going wrong would be greatly appreciated!
I you want any extra info, feel free to contact me.
Regards,
Darren
The ITK community is transitioning from this mailing list to
discourse.itk.org. Please join us there!
________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.kitware.com/products/protraining.php
http://www.itk.org/Wiki/ITK_FAQ
https://itk.org/mailman/listinfo/insight-users
Loading...