<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Darren,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">can you please re-post this question on the <a href="https://discourse.itk.org/">forum</a>? Many of us were on vacation in the last few weeks.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Dženan</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jul 12, 2018 at 7:47 AM <Darren.Thompson@csiro.au> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-AU" link="#0563C1" vlink="#954F72">
<div class="m_1997716889707673519WordSection1">
<p class="MsoNormal">Hi All,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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
<a href="https://github.com/InsightSoftwareConsortium/ITKPythonPackage/blob/master/docs/Build_ITK_Module_Python_packages.rst" target="_blank">
https://github.com/InsightSoftwareConsortium/ITKPythonPackage/blob/master/docs/Build_ITK_Module_Python_packages.rst</a> , 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.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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.
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">To strip everything back to basics I generated a vanilla external module, using only default values with:
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">python -m cookiecutter gh:InsightSoftwareConsortium/ITKModuleTemplate<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I then built the wheels as described and installed them into the virtual environment.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Using the following basic python script below results in a seg fault,
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">import itk<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">InputType = itk.Image[itk.F,2]<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">OutputType = itk.Image[itk.F,2]<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">test = itk.MinimalStandardRandomVariateGenerator.New()
<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">After running the script with gdb I see that it crashes in the call as follows:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">#1 0x00007fffe7405373 in PyInit__ModuleTemplatePython () from /home/tho78s/anaconda3/lib/python3.6/site-packages/itk/Configuration/../_ModuleTemplatePython.so<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’m currently out of ideas as to where the problem lies and I seem to get the identical problem in Windows too.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Any help or pointers in to what is going wrong would be greatly appreciated!<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I you want any extra info, feel free to contact me.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Regards,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Darren<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
The ITK community is transitioning from this mailing list to <a href="http://discourse.itk.org" rel="noreferrer" target="_blank">discourse.itk.org</a>. Please join us there!<br>
________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://itk.org/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">https://itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div>