I’m wondering how to script some simple steps from the Segment Editor. I know that there are a few recipes from Andras and others in this forum, which are great, thanks for the continuous support.
In one of the recipes, there is a good example for thresholding:
#Thresholding segmentEditorWidget.setActiveEffectByName("Threshold") effect = segmentEditorWidget.activeEffect() effect.setParameter("MinimumThreshold","35") effect.setParameter("MaximumThreshold","695") effect.self().onApply()
Now, the effect I wanna use programmatically is “Logical operators”, specifically I wanna create a hull, i.e. one segment that sums up all the other segments (in other words, a logical_or of all segments contained in the segmentation node), which is easy to automate. The steps I need to do are:
- Create a new segment (via node_seg.GetSegmentation().AddSegment(‘hull’))
- Copy the first segment into ‘hull’
- Add all other segments into ‘hull’.
For this, and other simple steps… Is there a documentation on all the parameters of all effects.
I was trying something like:
segmentEditorWidget.setActiveEffectByName("Logical operators") effect = segmentEditorWidget.activeEffect() effect.setParameter('Operation','Copy')
But I have no idea whether these parameters are correct (and there are no error messages, even if I enter random strings).
Thanks in advance!