# Change value of label for segmentation

**URL:** <https://discourse.slicer.org/t/change-value-of-label-for-segmentation/21772>\
**Category:** Support\
**Created:** [February 3, 2022, 5:55am UTC](https://discourse.slicer.org/t/change-value-of-label-for-segmentation/21772 "2022-02-03T05:55:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![codeenthusiast](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/codeenthusiast/32/14136_2.png) [@codeenthusiast](https://discourse.slicer.org/u/codeenthusiast)\
**Post date:** [February 3, 2022, 5:55am UTC](https://discourse.slicer.org/t/change-value-of-label-for-segmentation/21772/1 "2022-02-03T05:55:07Z")

</div>

Operating system: MacOS  
Slicer version: 4.11

Hi there, I am developing a script to perform radiomics extraction from a set of images with associated segmentations.

Unfortunately, the label values are inconsistent in the segmentations and therefore, I am getting an error when running the script as all label values must be the same. I have read in another forum post [How to change the label value of binary labelmap volume? - #9 by lassoan](https://discourse.slicer.org/t/how-to-change-the-label-value-of-binary-labelmap-volume/12511/9) in changing the label value.

However, I am getting an error where it is stating that read\_segmentation\_info and segmentation\_info are not defined. Could you please advise? Thank you!

---

<div class="post-metadata">

**Author:** ![ebrahim](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ebrahim/32/13403_2.png) [@ebrahim](https://discourse.slicer.org/u/ebrahim)\
**Post date:** [February 3, 2022, 12:10pm UTC](https://discourse.slicer.org/t/change-value-of-label-for-segmentation/21772/2 "2022-02-03T12:10:03Z")

</div>

The example you are looking at [was added here](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#use-segmentation-files-in-python-outside-slicer) in the script repository, which is probably the better place to look.

> However, I am getting an error where it is stating that read\_segmentation\_info and segmentation\_info are not defined. Could you please advise? Thank you!

Those come from the `slicerio` package. The [slicerio page here](https://pypi.org/project/slicerio/) is also useful and shows you what was the intended meaning of those objects that were not defined.

---

<div class="post-metadata">

**Author:** ![codeenthusiast](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/codeenthusiast/32/14136_2.png) [@codeenthusiast](https://discourse.slicer.org/u/codeenthusiast)\
**Post date:** [February 3, 2022, 12:56pm UTC](https://discourse.slicer.org/t/change-value-of-label-for-segmentation/21772/3 "2022-02-03T12:56:54Z")

</div>

Thank you Ebrahim. Yes, I was able to reference the slicerio library and sort out the issue. Thanks again.
