How to maintained consistent colortable across different segmentation annotation

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:


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. 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?