Issue with Margin Effect margin value sign

Hello,

I have a weird issue with the margin effect in the Segmentation module. The mask seems to grow when I try to shrink it. I apologize in advance if there might be a simple oversight.

Code:

slicer.app.processEvents()
segmentEditorWidget.setActiveEffectByName(“Margin”)
effect = segmentEditorWidget.activeEffect()
effect.setParameter(“Operation”, “Shrink”)
effect.setParameter(“MarginSize”, “1”)
effect.self().onApply()

Before:

After:

What am I doing wrong?

Thanks,
Sharada

Never mind, I had to pass in -1 instead of 1 for margin size. It seems a little strange to do when the operation is already specified as shrink.

1 Like

There is no such parameter of the Margin Effect as Operation or MarginSize. The list of parameter names are described in the [Developer documentation]) Segment editor — 3D Slicer documentation).

Okay, makes perfect sense what I was doing wrong now. Thank you!