How to use ITK functionalities inside scripted modules

Operating system: Linux Mint 18
Slicer version: 4.10
Expected behavior: Import ITK to be recognized
Actual behavior: Cmake crashes when configuring and generating.

Hi guys,

I’d like to know how can i use ITK package inside my (python) scripted module for 3d Slicer 4.10.
I created the standard extension using extension wizard and then try to modify the .py file inserting “Import itk” comand in the file’s header. However, I can’t go further because CMake start to bug in the configuration errors in the configuring/generating step.
Sometimes, I can config., gen. and make. But then when I open 3DSlicer, it cannot even find the module on its module options.

Thanks in advance.

You can use ITK proper in CLI modules or C++ loadable modules, while in scripted modules you can use ITK via its more user-friendly SimpleITK interface.

Great. I imported SimpleITK and it worked.

But would I install a random python package that I maybe interested in using inside python script?

Thank you, Lasso.

Currently, you cannot install arbitrary Python packages on all operating systems, but hopefully in 1-2 months you’ll be able to do that. See some information in this topic: Rpy2 pip installation fails.