# How can I load a default segment color config from customized file,like export from itk-snap

**URL:** <https://discourse.slicer.org/t/how-can-i-load-a-default-segment-color-config-from-customized-file-like-export-from-itk-snap/24988>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [August 30, 2022, 1:01am UTC](https://discourse.slicer.org/t/how-can-i-load-a-default-segment-color-config-from-customized-file-like-export-from-itk-snap/24988 "2022-08-30T01:01:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SlicerIsGood](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/slicerisgood/32/16309_2.png) [@SlicerIsGood](https://discourse.slicer.org/u/SlicerIsGood)\
**Post date:** [August 30, 2022, 1:01am UTC](https://discourse.slicer.org/t/how-can-i-load-a-default-segment-color-config-from-customized-file-like-export-from-itk-snap/24988/1 "2022-08-30T01:01:57Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/5/25b47ad8488a7042d0a0394ef82785f43c26b72d.png)

like this, itk-snap has a eport label description file funciton, so I want load this file to slicer to perform segmentation with color described in file, how can I do this?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [August 30, 2022, 8:47pm UTC](https://discourse.slicer.org/t/how-can-i-load-a-default-segment-color-config-from-customized-file-like-export-from-itk-snap/24988/2 "2022-08-30T20:47:07Z")

</div>

One option is just to use the segment editor to make a segmentation with the names/colors you want to have but no segmentations and save it as a .seg.nrrd that you can use as a template. Then reload it for each case you want to segment and add the actual segmentations (setting the master volume and adjusting the segmentation geometry if needed).

---

<div class="post-metadata">

**Author:** ![jay1987](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jay1987/32/16183_2.png) [@jay1987](https://discourse.slicer.org/u/jay1987)\
**Post date:** [August 31, 2022, 1:57am UTC](https://discourse.slicer.org/t/how-can-i-load-a-default-segment-color-config-from-customized-file-like-export-from-itk-snap/24988/3 "2022-08-31T01:57:57Z")

</div>

one code piece i copy from module brain parcellation  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/1/611cb6def8ed617107a86914c2625b6f45671c58.png)  
and the GIFNiftyNet2.ctbl file format

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/e/0e98d342e3d02ea49477e7086f5f622804bd7921.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 31, 2022, 2:44am UTC](https://discourse.slicer.org/t/how-can-i-load-a-default-segment-color-config-from-customized-file-like-export-from-itk-snap/24988/4 "2022-08-31T02:44:41Z")

</div>

I’ve added a reader for this ITK-Snap Label Description file format (`*.txt` or `*.label`), in the Sandbox extension. If you install this extension then you can-drag-and drop these label description files to make Slicer load them as a color table. This color table can then be used when you load a segmentation to set segment names and colors. See some more description [here](https://github.com/PerkLab/SlicerSandbox#ImportItkSnapLabel).

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/d/6d0da8f1073141b27d4e1f6751063c044e0f37d6.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/4/e494579ef82cefed8b77927edf2ff792d2842633.png)

---

<div class="post-metadata">

**Author:** ![Liam\_Swiggard](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/liam_swiggard/32/76886_2.png) [@Liam\_Swiggard](https://discourse.slicer.org/u/Liam_Swiggard)\
**Post date:** [June 7, 2024, 8:54pm UTC](https://discourse.slicer.org/t/how-can-i-load-a-default-segment-color-config-from-customized-file-like-export-from-itk-snap/24988/6 "2024-06-07T20:54:58Z")

</div>

Hi There,When using your ITK snap Label Description software, I noticed that if the Label Transparency is set to any value different than 0 or 1 (i.e 0.5), Sandbox will not detect the labels file as a ITK-SnAP Label Description File. Spesifically, I have two Text Files: Anat\_labels.txt and Anat\_labels\_Altered.txt. Anat\_labels reads as an ITK-SnAP Label Description File, where as Anat\_labels\_Altered does not. The only difference between them is that Anat\_labels\_Altered has Label Transparency values between 0 and 1. However, if I change all the Label Transparency values to be either 0 or 1, Sandbox recognizes it as an ITK-SnAP Label Description File. What do you suggest I do?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 9, 2024, 3:51am UTC](https://discourse.slicer.org/t/how-can-i-load-a-default-segment-color-config-from-customized-file-like-export-from-itk-snap/24988/7 "2024-06-09T03:51:33Z")

</div>

Please provide a sample file and I’ll have a look.
