# Level tracing segment editor effect

**URL:** <https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949>\
**Category:** Feature requests\
**Tags:** segmentation\
**Created:** [August 25, 2017, 6:08pm UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949 "2017-08-25T18:08:58Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [August 25, 2017, 6:08pm UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/1 "2017-08-25T18:08:58Z")

</div>

I was wondering if there was a way to get an option in level tracing for the Segment Editor to allow for the corrections to the segmentation performed in the 3rd dimension so that the level tracing can happen outside of the plane you are working with? Also possibly an effect to thread a tubelike segmentation into a gap of a prior segmentation that isn’t straight. I know there is the scizzors option to fill straight lines but it would be useful to start a tubelike segmentation for something like the spinal cord?

---

<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:** [August 25, 2017, 6:42pm UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/2 "2017-08-25T18:42:23Z")

</div>

> [@stevenagl12](#):
>
> I was wondering if there was a way to get an option in level tracing for the Segment Editor to allow for the corrections to the segmentation performed in the 3rd dimension so that the level tracing can happen outside of the plane you are working with?

There is a 3D version of the level tracing algorithm, which may be usable, but integration would take some time and display of 3D preview may be slow. The level trace effect is ported from the legacy Editor module, but compared to all the other effects, I don’t find it very useful. We probably have to either have to improve it or move out from the core (and have it available in some optional extension, for those who find it useful).

For what kind of segmentation did you find level tracing effect useful?

> [@stevenagl12](#):
>
> possibly an effect to thread a tubelike segmentation into a gap of a prior segmentation that isn’t straight. I know there is the scizzors option to fill straight lines but it would be useful to start a tubelike segmentation for something like the spinal cord?

You can create a tube-like segmentation using scissors with circle shape. If you draw in a slice view, you can even limit the depth.

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [August 25, 2017, 7:01pm UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/3 "2017-08-25T19:01:45Z")

</div>

I find the level tracing useful for my noisy images of the lungs to get a little more of the details, as well as the airways. Every time I use the scissors effect in the slice viewers the effect just generates a tube through the entire 3d structure. Is there an option I should be choosing? Also besides the surface cut is there a way to expand or contract a certain region of a segmentation by like pushing or pulling the 3d or 2d visualization if the segmentation is missing a portion?

---

<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:** [August 25, 2017, 8:43pm UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/4 "2017-08-25T20:43:34Z")

</div>

You can restrict the Scissors effect cut “thickness” by the Slice cut option.

---

<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:** [August 25, 2017, 10:17pm UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/5 "2017-08-25T22:17:27Z")

</div>

> [@stevenagl12](#):
>
> is there a way to expand or contract a certain region of a segmentation by like pushing or pulling the 3d or 2d visualization if the segmentation is missing a portion?

One obvious way is to use interpolate between segments. You segment on two or more slices in 2D and this effect fills all the other slices in 3D in between.

You can also expand or contract a segment using Margin effect. You can combine it with masking options to restrict the growth in various ways (stay inside/outside certain segments or intensity regions, etc).

If you can describe what is the exact problem that you try to solve, I can give more specific advice.

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [August 26, 2017, 1:57pm UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/6 "2017-08-26T13:57:27Z")

</div>

> [@stevenagl12](#):
>
> I find the level tracing useful for my noisy images of the lungs to get a little more of the details, as well as the airways.

Did you know there is an extension specifically for lung images processing, and it can segment lungs automatically? Check out Chest imaging platform.

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [August 26, 2017, 10:23pm UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/7 "2017-08-26T22:23:00Z")

</div>

So the problem is that my images are non-contrast enhanced ct images of cadavers donated to my school. I’m slowly working on segmenting all the major organ systems.

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [August 28, 2017, 10:50pm UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/9 "2017-08-28T22:50:28Z")

</div>

Hey Andrey Federov, so I’m not finding the extension either for the chest imaging platform to install it on the nightly build I already have?

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [August 29, 2017, 12:58am UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/10 "2017-08-29T00:58:09Z")

</div>

@stevenagl12 what platform are you on? Are you using the nightly package?

@jonieva it appears that CIP has build errors on Windows - see [http://slicer.cdash.org/viewBuildError.php?buildid=1087165](http://slicer.cdash.org/viewBuildError.php?buildid=1087165).

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [August 29, 2017, 1:50am UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/11 "2017-08-29T01:50:37Z")

</div>

Yes I am using the nightly build. According to the CIP website I’m supposed to download the extension but it’s not there.

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [August 29, 2017, 2:32am UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/12 "2017-08-29T02:32:33Z")

</div>

What operating system do you have?

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [August 29, 2017, 4:28am UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/13 "2017-08-29T04:28:01Z")

</div>

I have Windows 10 on a desktop with 32gbs of ram and an i7 processor.

---

<div class="post-metadata">

**Author:** ![alireza](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/alireza/32/67173_2.png) [@alireza](https://discourse.slicer.org/u/alireza)\
**Post date:** [July 5, 2021, 4:05am UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/14 "2021-07-05T04:05:37Z")

</div>

> [@lassoan](#):
>
> There is a 3D version of the level tracing algorithm

Can you please point me to the 3D version of the level tracing algorithm? is it public?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 5, 2021, 5:55pm UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/15 "2021-07-05T17:55:50Z")

</div>

The underlying ITK code is N-dimensional so you can try it out. I never found the 3D mode very effective but it probably depends a lot on the data and task.

> <https://github.com/Slicer/Slicer/blob/master/Libs/vtkITK/itkLevelTracingImageFilter.h>

---

<div class="post-metadata">

**Author:** ![ferhue](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ferhue/32/82557_2.png) [@ferhue](https://discourse.slicer.org/u/ferhue)\
**Post date:** [June 9, 2022, 9:10am UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/16 "2022-06-09T09:10:33Z")

</div>

Hi, I would welcome such a feature. Are there any plans of implementing this into 3D Slicer? I am segmenting a half cylinder that is not straight, so using the scissors is not working well for me. What I do now is go slice by slice using level tracing, but there are 200 slices, so it would be nice to have a checkbox that enables recursively spreading the level tracing to neighboring slices.

---

<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:** [June 13, 2022, 1:55pm UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/17 "2022-06-13T13:55:06Z")

</div>

You can use the scissors effect on arbitrary slice orientation. You can rotate slices by displaying slice intersections and Ctrl+Alt+Left-click-and-drag in a slice view.

If the cylinder is clearly distinguishable from the surroundings (which is very likely, if you find that level tracing works well) then you should be able to segment in 10-20 seconds using Grow from seeds, Local threshold, or Fast marching effects.

---

<div class="post-metadata">

**Author:** ![Inka\_Saraswati](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/inka_saraswati/32/67631_2.png) [@Inka\_Saraswati](https://discourse.slicer.org/u/Inka_Saraswati)\
**Post date:** [December 27, 2023, 2:04pm UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/18 "2023-12-27T14:04:53Z")

</div>

Is the three dimensional level tracing available in the current Slicer? If so, how to reach it?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [December 27, 2023, 6:19pm UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/19 "2023-12-27T18:19:52Z")

</div>

Three-d level tracing never proved as useful as hoped. Maybe it was just an implementation issue. The underlying code should still exist in the low-level classes but some programming would be required to expose it.

---

<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:** [February 12, 2024, 3:18am UTC](https://discourse.slicer.org/t/level-tracing-segment-editor-effect/949/20 "2024-02-12T03:18:38Z")

</div>

When you use Level Tracing, you use trial and error to find a mouse position that leads to acceptable segmentation. This trial and error would take several magnitudes longer time (minutes instead of seconds) in 3D because there are many more points and also takes much longer to check the segmentation result in dozens of slices than a quick visual check in a single slice
