Why does the color of the label map change when I save the label map?

I am currently working on outputting Dicom as a 3D Slicer and annotating it.
Annotation completed file is saved as nrrd file. If I load the saved file again, the color was changed. Why is the color changing?

Original Annotation Data

Load Data

If you save the segmentation as a segmentation node (4D .seq.nrrd file) then colors are preserved.

If you export to merged labelmap then voxels are saved to a 3D .nrrd file and segment names and colors are saved to a separate color table (.ctbl file). If you save and load the entire scene, association between labelmap and color table is preserved. If you load the labelmap volume separately, you also need to load the color table and set the labelmap volume to use it for display.

I would recommend to keep using segmentation node format until final export. Use latest Slicer stable release and Segment Editor module for editing.

Hi lassoan.
Thanks for your relply.
And I have another question.
I created a program that can open nrrd files and i trying to open Segmentation.seg.nrrd. but i cannot open.
Segmentation.seg.nrrd file is cannot open alone but i need to open nrrd file alone.
if i open nrrd file, i must open origin file.
how to open Segmentation.seg.nrrd file alone.

Segmentation is stored in a 4D nrrd file with a couple of custom fields to store additional metadata - see detailed description here.

You can use any nrrd reader that is capable to read 4D files. If your software cannot read such files then you can export to 3D labelmap (nrrd file) + color table (text file) and read those.