# Set parameters with python code. Skullstripper

**URL:** <https://discourse.slicer.org/t/set-parameters-with-python-code-skullstripper/6172>\
**Category:** Support\
**Created:** [March 17, 2019, 12:04pm UTC](https://discourse.slicer.org/t/set-parameters-with-python-code-skullstripper/6172 "2019-03-17T12:04:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![skagsoset](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@skagsoset](https://discourse.slicer.org/u/skagsoset)\
**Post date:** [March 17, 2019, 12:04pm UTC](https://discourse.slicer.org/t/set-parameters-with-python-code-skullstripper/6172/1 "2019-03-17T12:04:38Z")

</div>

Hey!  
Does someone know how to set the parrameters of the skullstripper extension with the use of python code?

skullWidget = slicer.modules.Skullstripper.widgetRepresentation()  
— need to set the inputs here first  
skullWidget.appry()

I know like Segment editor you can write something like this;  
segmentEditorWidget = slicer.qMRMLSegmentEditorWidget()  
segmentEditorWidget.setMRMLScene(slicer.mrmlScene)  
segmentEditorNode = slicer.vtkMRMLSegmentEditorNode()  
slicer.mrmlScene.AddNode(segmentEditorNode)  
segmentEditorWidget.setMRMLSegmentEditorNode(segmentEditorNode)  
segmentEditorWidget.setMasterVolumeNode(some\_volume)

I cant understand how to reach this for skullstripping.

All help is appreciate 🙂

---

<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:** [March 18, 2019, 5:28am UTC](https://discourse.slicer.org/t/set-parameters-with-python-code-skullstripper/6172/2 "2019-03-18T05:28:15Z")

</div>

This is a CLI module that you can run from Python as described here: [https://www.slicer.org/wiki/Documentation/Nightly/Developers/Python\_scripting#Running\_a\_CLI\_from\_Python](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Python_scripting#Running_a_CLI_from_Python)

Give [SwissSkullStripper extension](https://www.slicer.org/wiki/Documentation/Nightly/Modules/SwissSkullStripper) a try, too. It may work better.

---

<div class="post-metadata">

**Author:** ![skagsoset](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@skagsoset](https://discourse.slicer.org/u/skagsoset)\
**Post date:** [March 18, 2019, 2:45pm UTC](https://discourse.slicer.org/t/set-parameters-with-python-code-skullstripper/6172/3 "2019-03-18T14:45:32Z")

</div>

Thanks for the tip, found a way 🙂

Here is a part of my code:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/e/6e8b11a3a84f985b80bd42f378e7650c8ad2e80e.png)

---

<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:** [March 18, 2019, 5:24pm UTC](https://discourse.slicer.org/t/set-parameters-with-python-code-skullstripper/6172/4 "2019-03-18T17:24:12Z")

</div>

Thanks for the update and sharing the end result.

Please always include source code as text instead of screenshot, because others will not be able to easily copy-paste this code snippet picture and images also take thousand times more storage space. You can add triple ` character before and after the text to display it as source code.
