# Understanding the Behavior of the SegmentEditor with converted models

**URL:** <https://discourse.slicer.org/t/understanding-the-behavior-of-the-segmenteditor-with-converted-models/22245>\
**Category:** Support\
**Created:** [March 1, 2022, 7:05pm UTC](https://discourse.slicer.org/t/understanding-the-behavior-of-the-segmenteditor-with-converted-models/22245 "2022-03-01T19:05:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fluvio\_Lobo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fluvio_lobo/32/81262_2.png) [@Fluvio\_Lobo](https://discourse.slicer.org/u/Fluvio_Lobo)\
**Post date:** [March 1, 2022, 7:05pm UTC](https://discourse.slicer.org/t/understanding-the-behavior-of-the-segmenteditor-with-converted-models/22245/1 "2022-03-01T19:05:42Z")

</div>

Hello,

When applying a **segmentation effect** on **surface models** (converted into segments), the effect needs to be applied twice to get the desired result. For instance, below I try to apply a Gaussian filter to a tube model generated using markups-to-model module.

 ![step1](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/c/7c4c44bb9bca3c7ff627e0768a91ee80dea7d135.jpeg)

If I hit apply on the filter, then the tube becomes voxelated but not smooth.

 ![step2](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/f/ef9bc37ebbb350011f5ef00f894dc7fa83a9f8bb.jpeg)

When I apply the filter again however, the filter seems to be applied correctly.

 ![step3](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/6/8619606aa86120da62180928f3cd709f31ff24c4.jpeg)

In code, I do this;

```auto
splintSegmentID = inputSegmentIDs.GetValue(0)
segmentEditorWidget.setCurrentSegmentID(splintSegmentID)
segmentEditorWidget.setActiveEffectByName("Smoothing")
effect = segmentEditorWidget.activeEffect()
effect.setParameter("SmoothingMethod", "GAUSSIAN")
effect.setParameter("KernelSizeMm", 1)
#effect.setParameter("ApplyToAllVisibleSegments", str(1))
effect.self().onApply()

segmentEditorWidget.setActiveEffectByName("Smoothing")
effect = segmentEditorWidget.activeEffect()
effect.setParameter("SmoothingMethod", "GAUSSIAN")
effect.setParameter("KernelSizeMm", 1)
#effect.setParameter("ApplyToAllVisibleSegments", str(1))
effect.self().onApply()

```

What am I doing wrong and what is the appropriate way of applying effects on these models?
