# Level tracing on a single slice from a 3D volume

**URL:** <https://discourse.slicer.org/t/level-tracing-on-a-single-slice-from-a-3d-volume/16693>\
**Category:** Support\
**Tags:** segmentation, dicom\
**Created:** [March 22, 2021, 3:02pm UTC](https://discourse.slicer.org/t/level-tracing-on-a-single-slice-from-a-3d-volume/16693 "2021-03-22T15:02:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc0](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/marc0/32/10388_2.png) [@Marc0](https://discourse.slicer.org/u/Marc0)\
**Post date:** [March 22, 2021, 3:02pm UTC](https://discourse.slicer.org/t/level-tracing-on-a-single-slice-from-a-3d-volume/16693/1 "2021-03-22T15:02:13Z")

</div>

I would like to load a single slice out of a DICOM volume on 3DSlicer and to segment it via the Level Tracing tool. The level tracing works on the full volume but it does not work if I load a single slice out of this volume. Is there a way to perform this task?

Thank you very much

---

<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:** [March 24, 2021, 5:34pm UTC](https://discourse.slicer.org/t/level-tracing-on-a-single-slice-from-a-3d-volume/16693/2 "2021-03-24T17:34:33Z")

</div>

Level tracing effect cannot operate at the slice boundary and there is a somewhat too simplistic [check](https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Segmentations/EditorEffects/Python/SegmentEditorLevelTracingEffect.py#L166-L170) that ensures that the current position is not at the boundary. Since it checks all 3 axes (and not just within the slice axes), this check also prevents using it on the first and last slice of the volume. You can simply comment out the check, but it would be even better if you updated the check so that it is done only in the current image plane (see how the current image plane is detected [here](https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Segmentations/EditorEffects/Python/SegmentEditorLevelTracingEffect.py#L181-L186)) and send a pull request with the fix. Thank you!

---

<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 6, 2021, 2:09pm UTC](https://discourse.slicer.org/t/level-tracing-on-a-single-slice-from-a-3d-volume/16693/3 "2021-07-06T14:09:09Z")

</div>

@lassoan if the level tracing in 3D slicer is 2d, does it make sense to comment out the simplistic check in the upstream? I don’t understand why a 2D algorithm cannot be run on first and last slice.

---

<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 6, 2021, 7:38pm UTC](https://discourse.slicer.org/t/level-tracing-on-a-single-slice-from-a-3d-volume/16693/4 "2021-07-06T19:38:10Z")

</div>

Yes, it’s just some faulty logic that needs to be sorted out. I don’t think it’s a huge task but someone would need to dig in a bit on both the C++ and python code.

---

<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 7, 2021, 4:14pm UTC](https://discourse.slicer.org/t/level-tracing-on-a-single-slice-from-a-3d-volume/16693/5 "2021-07-07T16:14:52Z")

</div>

I created a PR here [BUG: Fix the check for 3D while tool logic is 2D in levelTracing tool by sedghi · Pull Request #5728 · Slicer/Slicer · GitHub](https://github.com/Slicer/Slicer/pull/5728)
