# Labelmap values changing during conversion from segments back to labels

**URL:** <https://discourse.slicer.org/t/labelmap-values-changing-during-conversion-from-segments-back-to-labels/44663>\
**Category:** Support\
**Created:** [October 3, 2025, 7:12pm UTC](https://discourse.slicer.org/t/labelmap-values-changing-during-conversion-from-segments-back-to-labels/44663 "2025-10-03T19:12:37Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![sulli419](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sulli419/32/78859_2.png) [@sulli419](https://discourse.slicer.org/u/sulli419)\
**Post date:** [October 4, 2025, 7:36pm UTC](https://discourse.slicer.org/t/labelmap-values-changing-during-conversion-from-segments-back-to-labels/44663/3 "2025-10-04T19:36:26Z")

</div>

Thanks for the pointers Mike. So it sounds like there is no way to preserve the pixel identities (with gaps/jumps between pixel values) when I convert from segments back to labelmaps? Can you confirm that it just rebuilds the pixels from the list, starting at the top as 1, and counting up 1 pixel per group. I think this is how it’s behaving but it would help to be certain, so I can relabel in python as you suggest. I am managing 75 labels, so my process is prone to error.

Maybe a whole different problem: but at some point I want to convert back to 8 bit, and suspect there will be low-depth rounding errors that merge the pixel classes. Can I create an 8 bit labelmap file?

Still, does anyone know of a way within slicer to convert from segments to labelmaps and preserve the gaps in assigned pixel values?

I feel like this discussion is related:

> [@Export Segmentation as Labeled LabelMap](https://discourse.slicer.org/t/export-segmentation-as-labeled-labelmap/26468):
>
> Hi everyone! I´m trying to export a segmentation with some segments labed as: And I exported: If I close scene and try to import again this file as a segmentation: Original label is not preserved… I have some other NonSlicerMade labelmaps and if I import them: So I undertand that: Slicer always add string “Segment\_” to labelmap labels Slicer save labelmaps always without original label (just as a ColorTable second file) Is there any way to change t…

---

_[View the full topic](https://discourse.slicer.org/t/labelmap-values-changing-during-conversion-from-segments-back-to-labels/44663)._
