Set parameters with python code. Skullstripper

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 :slight_smile:

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

Give SwissSkullStripper extension a try, too. It may work better.

1 Like

Thanks for the tip, found a way :slight_smile:

Here is a part of my code:
image

1 Like

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.

1 Like