# Can Python interpretor be used to call Slicer IGT "create models" ?

**URL:** <https://discourse.slicer.org/t/can-python-interpretor-be-used-to-call-slicer-igt-create-models/20948>\
**Category:** Support\
**Tags:** python\
**Created:** [December 7, 2021, 1:44pm UTC](https://discourse.slicer.org/t/can-python-interpretor-be-used-to-call-slicer-igt-create-models/20948 "2021-12-07T13:44:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![clement\_laplace](https://avatars.discourse-cdn.com/v4/letter/c/a4c791/32.png) [@clement\_laplace](https://discourse.slicer.org/u/clement_laplace)\
**Post date:** [December 7, 2021, 1:44pm UTC](https://discourse.slicer.org/t/can-python-interpretor-be-used-to-call-slicer-igt-create-models/20948/1 "2021-12-07T13:44:05Z")

</div>

Hello,

I am a fairly new user of 3D Slicer. I was wondering if it is possible to call the “CreateModels” functions of the Slicer IGT module from a python script.  
I need to create cylinder models in a more automated way, thus I wanted to combine python and Slicer IGT for this.

A more general questions: Can all the modules be called from python ?

Thank you

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [December 8, 2021, 11:11pm UTC](https://discourse.slicer.org/t/can-python-interpretor-be-used-to-call-slicer-igt-create-models/20948/2 "2021-12-08T23:11:17Z")

</div>

The short answer is yes, all Slicer modules can be accessed from python.

Here’s a very long answer: [Developer Guide — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/developer_guide/index.html)

Self tests can be a good place to look to try to find examples of code in use. Here’s one I found which seems to use the IGT create models functionality in a basic way:

> <https://github.com/SlicerIGT/SlicerIGT/blob/983b9f08efa201df6f44a94d8f6b4a3d220bde86/BreachWarning/Testing/Python/BreachWarningSelfTest.py#L86>

Here is the C++ code for the Create Models module: [SlicerIGT/vtkSlicerCreateModelsLogic.cxx at 39dfcfa3c83e07981054b6e2164c5f26552b93bb · SlicerIGT/SlicerIGT · GitHub](https://github.com/SlicerIGT/SlicerIGT/blob/39dfcfa3c83e07981054b6e2164c5f26552b93bb/CreateModels/Logic/vtkSlicerCreateModelsLogic.cxx)

Those C++ functions are wrapped and accessible via python.
