# Convert a narrow-band level set into a "full-band" level set

**URL:** <https://discourse.itk.org/t/convert-a-narrow-band-level-set-into-a-full-band-level-set/7311>\
**Category:** Uncategorized\
**Created:** [November 14, 2024, 7:47am UTC](https://discourse.itk.org/t/convert-a-narrow-band-level-set-into-a-full-band-level-set/7311 "2024-11-14T07:47:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tossin](https://discourse.itk.org/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@tossin](https://discourse.itk.org/u/tossin)\
**Post date:** [November 14, 2024, 7:47am UTC](https://discourse.itk.org/t/convert-a-narrow-band-level-set-into-a-full-band-level-set/7311/1 "2024-11-14T07:47:23Z")

</div>

Hey all,

I have a narrow-band level set segmentation created from an ITK/VTK-based package (VMTK). However, I’d like to convert this narrow-band level set into a full-band, e.g., get a full distance field from the interpolated isocontour/zero-level set throughout the entire image volume. What is the best way to go about this? I’d specifically like to keep the exact same zero-level set/subvoxel precision, so I want to avoid any method that requires a binary mask conversion.

I’ve tried the IsoContourDistance filter using SimpleITK, but this only outputs another narrow-banded image.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [November 14, 2024, 1:49pm UTC](https://discourse.itk.org/t/convert-a-narrow-band-level-set-into-a-full-band-level-set/7311/2 "2024-11-14T13:49:21Z")

</div>

Have you tried increasing [NarrowBand’s Inner and Total Radius](https://itk.org/Doxygen/html/classitk_1_1NarrowBand.html#a2ed87fcc76389be25cfc5895af74e213)?

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [November 14, 2024, 2:44pm UTC](https://discourse.itk.org/t/convert-a-narrow-band-level-set-into-a-full-band-level-set/7311/3 "2024-11-14T14:44:37Z")

</div>

Hello @tossin,

Would a filter like the [HausdorffDistanceImageFilter](https://HausdorffDistanceImageFilter)[SimpleITK: itk::simple::HausdorffDistanceImageFilter Class Reference](https://simpleitk.org/doxygen/v2_2/html/classitk_1_1simple_1_1HausdorffDistanceImageFilter.html)) meet your needs?

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [November 14, 2024, 9:26pm UTC](https://discourse.itk.org/t/convert-a-narrow-band-level-set-into-a-full-band-level-set/7311/4 "2024-11-14T21:26:04Z")

</div>

Hi,

Welcome to the ITK community! 🌞

The [FastMarchingImageFilter](https://itk.org/Doxygen/html/classitk_1_1FastMarchingImageFilter.html) may be of interest.

---

<div class="post-metadata">

**Author:** ![tossin](https://discourse.itk.org/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@tossin](https://discourse.itk.org/u/tossin)\
**Post date:** [November 21, 2024, 10:19pm UTC](https://discourse.itk.org/t/convert-a-narrow-band-level-set-into-a-full-band-level-set/7311/5 "2024-11-21T22:19:43Z")

</div>

Hey all, thanks for the suggestions. I should mention that I’ve been primarily working in Python and SimpleITK, so there are probably many ITK filters/features that I’m unfamiliar with.

- I haven’t tried manipulating the narrow band characteristics yet for IsoContourDistance. It seems narrow-band related classes and filters in general aren’t exposed in SimpleITK.
- Re: HausdorffDistanceImageFilter, I think the HausdorffDistanceImageFilter works best with two images, but I’m only trying to take one image/level set and then extend the values.

Diving deeper into ITK, I think what I want specifically is [itkReinitializeLevelSetImageFilter](https://itk.org/Doxygen/html/classitk_1_1ReinitializeLevelSetImageFilter.html), which the documentation says uses FastMarchingImageFilter under the hood (and also LevelSetNeighborhoodExtractor, though it doesn’t seem to be available in Python). I’ll have to test it out to be sure.

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [November 22, 2024, 2:09pm UTC](https://discourse.itk.org/t/convert-a-narrow-band-level-set-into-a-full-band-level-set/7311/6 "2024-11-22T14:09:01Z")

</div>

> [@tossin](#):
>
> Diving deeper into ITK, I think what I want specifically is [itkReinitializeLevelSetImageFilter](https://itk.org/Doxygen/html/classitk_1_1ReinitializeLevelSetImageFilter.html), which the documentation says uses FastMarchingImageFilter under the hood (and also LevelSetNeighborhoodExtractor, though it doesn’t seem to be available in Python). I’ll have to test it out to be sure.

This filter seems to be missing in SimpleITK. I’ll look into wrapping it today.

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [November 22, 2024, 5:18pm UTC](https://discourse.itk.org/t/convert-a-narrow-band-level-set-into-a-full-band-level-set/7311/7 "2024-11-22T17:18:04Z")

</div>

I have made a PR with new wrapping for the filter:

> <https://github.com/SimpleITK/SimpleITK/pull/2215>

If testing goes smoothly and the PR is merged tonight. Then the filter will be available in the nightly “latest” binaries:

> **[Release Release latest · SimpleITK/SimpleITK](https://github.com/SimpleITK/SimpleITK/releases/tag/latest)**
>
> This is an automatic pre-release packaging of SimpleITK based on the master branch. It contains the latest features and experimental developments.
> To upgrade to the latest pre-release Python binary...
