# How to maintained consistent colortable across different segmentation annotation

**URL:** <https://discourse.slicer.org/t/how-to-maintained-consistent-colortable-across-different-segmentation-annotation/14296>\
**Category:** Support\
**Created:** [October 29, 2020, 2:01am UTC](https://discourse.slicer.org/t/how-to-maintained-consistent-colortable-across-different-segmentation-annotation/14296 "2020-10-29T02:01:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ButuiHu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/butuihu/32/2386_2.png) [@ButuiHu](https://discourse.slicer.org/u/ButuiHu)\
**Post date:** [October 29, 2020, 2:01am UTC](https://discourse.slicer.org/t/how-to-maintained-consistent-colortable-across-different-segmentation-annotation/14296/1 "2020-10-29T02:01:12Z")

</div>

I have a lot of segmentation annotation exported from 3dslicer. But the label value is not consistent. So I would like to do some data clean. I got `.seg.nrrd` (segmentation file export from 3dslicer), `.ctbl` (color table), and `-label.nrrd` (labelmap file export from 3dslicer) for each input image. I check `seg.nrrd`'s metadatakeys, and I notice that there are keys:

```auto
Segment0_Color
Segment0_ColorAutoGenerated
Segment0_ID
Segment0_Name
Segment0_NameAutoGenerated

```

So I could simply update these keys, and the data (converted to numpy array, remap to correct label value, and then convert back to nrrd) according to the `.ctbl` file. Is that OK?  
Then I found this [post](https://discourse.slicer.org/t/how-to-automatically-convert-a-labelmap-volume-to-a-segmentation-node-upon-loading-labelmap-volume/9931/9). I only need to update the labelmap file (`-label.nrrd`) file. Am I right? Maybe 3dslicer could merge `.seg.nrrd` & `-label.nrrd` to save space.

For now, our workflow:

1. load data
2. switch to Segment Editor module, add Segment
3. switch to Segmentations module, export segmentation to Labelmap
4. save files, including Segmentation (`.seg.nrrd`), label map (`-label.nrrd`), and Color Table (`.ctbl`).
5. close scene, and restart from step 1 for the next input image.

In step 2, we have 3 classes, but there might only be one class, so the user would only add one class, and set the proper class name. I think that’s why we got an inconsistent color table. Any suggestions to improve this workflow?
