# How to use ITK functionalities inside scripted modules

**URL:** <https://discourse.slicer.org/t/how-to-use-itk-functionalities-inside-scripted-modules/5468>\
**Category:** Support\
**Created:** [January 22, 2019, 6:09pm UTC](https://discourse.slicer.org/t/how-to-use-itk-functionalities-inside-scripted-modules/5468 "2019-01-22T18:09:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MachadoL](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/machadol/32/3372_2.png) [@MachadoL](https://discourse.slicer.org/u/MachadoL)\
**Post date:** [January 22, 2019, 6:09pm UTC](https://discourse.slicer.org/t/how-to-use-itk-functionalities-inside-scripted-modules/5468/1 "2019-01-22T18:09:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 22, 2019, 6:31pm UTC](https://discourse.slicer.org/t/how-to-use-itk-functionalities-inside-scripted-modules/5468/2 "2019-01-22T18:31:37Z")

</div>

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](http://www.simpleitk.org/) interface.

---

<div class="post-metadata">

**Author:** ![MachadoL](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/machadol/32/3372_2.png) [@MachadoL](https://discourse.slicer.org/u/MachadoL)\
**Post date:** [January 22, 2019, 8:01pm UTC](https://discourse.slicer.org/t/how-to-use-itk-functionalities-inside-scripted-modules/5468/3 "2019-01-22T20:01:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 22, 2019, 9:00pm UTC](https://discourse.slicer.org/t/how-to-use-itk-functionalities-inside-scripted-modules/5468/4 "2019-01-22T21:00:55Z")

</div>

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](https://discourse.slicer.org/t/rpy2-pip-installation-fails/4883).
