# Feedback on custom color table creation

**URL:** <https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963>\
**Category:** Support\
**Created:** [March 4, 2025, 6:04pm UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963 "2025-03-04T18:04:33Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 4, 2025, 6:04pm UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/1 "2025-03-04T18:04:33Z")

</div>

I am reviewing the newly integrated functionality. Everything seems to work well, but I think we need some clarification and some minor functionality tweak.

1. When I am creating my own custom color table with terminologies, do I need to create 0 Background entry with color (0,0,0) or is that automatically appended? Because all color tables I am aware of that has that entry. and it wasn’t clear to me. If it is necessary, perhaps auto-populate that field.
2. I have a little issue with opacity being always 0 for all blank entries, which complicated setting the color from the palette. But it is a minor one. I suspect most of the time people will either choose from the terminology module or enter the RGB code in the table. Otherwise table creation seems to work well.
3. When I am using this color table during segmentation, Terminology selector seems to keep defaulting to Slicer’s own terminology. Can we make the change that Terminology module opens with the latest selected terminology/color table from the top drow down.

I will keep reviewing more thoroughly, but things seems to work well for me beyond these minor issues.

Thanks @lassoan @cpinter and everyone else who contributed to the discussion and implementation.

---

<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:** [March 4, 2025, 8:39pm UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/2 "2025-03-04T20:39:49Z")

</div>

> [@muratmaga](#):
>
> When I am creating my own custom color table with terminologies, do I need to create 0 Background entry with color (0,0,0) or is that automatically appended?

No need for defining a color for the 0 value for segmentations.

0 always corresponds to background, so it is never mapped to a segment. Its only use is when somebody applies the color table to display a labelmap volume and he wants to set a background color&opacity.

> [@muratmaga](#):
>
> I have a little issue with opacity being always 0 for all blank entries, which complicated setting the color from the palette. But it is a minor one. I suspect most of the time people will either choose from the terminology module or enter the RGB code in the table. Otherwise table creation seems to work well.

An entry can be made undefined by clicking the delete color (red `-`) button above the color table. The color will not be undefined if you set to a specific color (even if you set it to, RGBA=(0,0,0,0)).

> [@muratmaga](#):
>
> When I am using this color table during segmentation, Terminology selector seems to keep defaulting to Slicer’s own terminology. Can we make the change that Terminology module opens with the latest selected terminology/color table from the top drow down.

The terminology for a segment is copied from the previous segment. You got the default terminology because you added all your segments, which were all set to the default terminology entry.

The solution is to add the first segment, set the terminology from the color table, and then add all the other segments.

We could tune this behavior to make it more intuitive. We could probably avoid setting a default terminology when adding a new segment (leave the terminology undefined). Then we would always look up the context from any previous segment that has defined terminology.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 5, 2025, 12:51am UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/3 "2025-03-05T00:51:24Z")

</div>

> [@lassoan](#):
>
> The solution is to add the first segment, set the terminology from the color table, and then add all the other segments.

OK. That helped, and it kept bringing the right color table. However, after adding a few more segments, this message popped up:

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

I presume I need to choose “Keep using the terminology selector”?

---

<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:** [March 5, 2025, 1:14am UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/4 "2025-03-05T01:14:47Z")

</div>

It seems that you keep clicking on the color box, so the application is guessing that you just want to change colors and may be frustrated to see a terminology selector. You can confirm that you want to keep using the terminology selector even when clicking the color box by selecting “Keep using terminology selector”.

It is all supposed to be self-explanatory, so the fact that you need to ask for clarification means that we need to improve things. Let us know if you have any suggestions about what and how to change.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 5, 2025, 1:46am UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/5 "2025-03-05T01:46:11Z")

</div>

> [@lassoan](#):
>
> It is all supposed to be self-explanatory, so the fact that you need to ask for clarification means that we need to improve things. Let us know if you have any suggestions about what and how to change.

I don’t think I clicked on the colors, but the actual terms. So here are my steps:

1. I created a custom color table with 6 entries from Uberon
2. Loaded a volume and right-click to start the segmentation
3. I added a blank segments, which initialized as Segment\_1, I double-click the name and the terminology module came. I chose my color table, and then picked up a term.
4. I added another blank segment, which came as Segment\_1 (or might have been Segment\_2), which I double-clicked to set. Terminology selector came with my color table prepopulated (as I wanted it to be). I picked up another term.
5. I repeat this procedure and at the 5th or 6th one, this window came up.

Am I missing a step?

---

<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:** [March 5, 2025, 5:31am UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/6 "2025-03-05T05:31:09Z")

</div>

Thanks for the further testing. I’ve checked the implementation and the actions that we count is the number of times the user selects a custom segment name or color (it does not matter if you double-click on the color box or the segment name). However, when the user chose a color from the color table, it was always counted as a custom segment name/color selection. I’ll submit a fix tomorrow.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [March 5, 2025, 2:37pm UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/7 "2025-03-05T14:37:22Z")

</div>

Thanks for the discussion!

I don’t understand the issue with the custom colors/names. Can you please explain what you @lassoan found the problem was and how should we fix it?

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 5, 2025, 4:30pm UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/8 "2025-03-05T16:30:06Z")

</div>

I think the main issue is clicks to choose a proper label for a segment from color table should not count towards that popup message, because that’s the intended usage, and it confuses the user (making them think they are not doing something right).

The popup meant to bring back the older renaming style for people who do NOT want to use terminology module.

At least that’s the issue I am trying to resolve.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [March 5, 2025, 4:42pm UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/9 "2025-03-05T16:42:10Z")

</div>

Thanks! I’m curious of the explanation of @lassoan because as I recall this feature was not supposed to do this, so just want to know what went wrong and what we want to do instead.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 7, 2025, 5:41am UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/10 "2025-03-07T05:41:40Z")

</div>

> [@lassoan](#):
>
> No need for defining a color for the 0 value for segmentations.
> 
> 0 always corresponds to background, so it is never mapped to a segment. Its only use is when somebody applies the color table to display a labelmap volume and he wants to set a background color&opacity.

Maybe I am doing something wrong, but this is the labelmap I am getting when I use `Segmentations` module to export a labelmap from a segmentation I created using color table:

This is the actual segmentation

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/0/d09e76eab5ec973adb9552f546f4b88b117317fd.jpeg)

This is with the exported labelmap

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/d/0df277992a9337506546c1c9639a5478e5c9e017.jpeg)

To create the labelmap, I went to the segmentations module, choose Export labelmap, click on `Use Color Table Values` and specified my custom color table.

If I don’t do that, but simply right-click in SH to export as a labelmap, I don’t get my Color Table 0 being assigned to the background, but then assigned indices are not the ones I specified in the color table (Based on color table lateral parasympasial foramen, blue segment, should have label value of 3, but instead it got 1, since it is the first segment)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/3/837ebffb0326e6d76d956a54c5eb5701691efd66.jpeg)

Perhaps these types of color table entries should start from 1, instead of 0?

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [March 7, 2025, 10:41am UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/11 "2025-03-07T10:41:43Z")

</div>

Thanks for the feedback! I’ll look into this today.

---

<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:** [March 7, 2025, 12:16pm UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/12 "2025-03-07T12:16:33Z")

</div>

> [@muratmaga](#):
>
> Perhaps these types of color table entries should start from 1, instead of 0?

Yes, the issue is that the bacground label is missing.

Did you create the color table manually? Did you set a color and terminology for the background (label value=0)?

If yes then we have to somehow make it more difficult to specify a color and terminology for label=0, because a custom background is very rarely needed (and never needed if you use the color table for segmentation conversion). Maybe a warning popup or hiding the label=0 entry by default would be sufficient?

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 7, 2025, 3:43pm UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/13 "2025-03-07T15:43:37Z")

</div>

> [@lassoan](#):
>
> Did you create the color table manually? Did you set a color and terminology for the background (label value=0)?

I used the colors module to create the table. The first entry for “0”, hence I asked whether I should create a background label at the beginning of this thread. So it appears, while I don’t need to create an explicit 0=background label, I also shouldn’t have created a specific label entry at 0, but instead start from 1.

is that correct way of explaining? Is there any reason 0 is not auto-populated as a background?

---

<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:** [March 7, 2025, 7:10pm UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/14 "2025-03-07T19:10:51Z")

</div>

The label=0 entry is always left empty by default. You only ever see the background label if you explicitly uncheck the “Hide empty colors” checkbox. If you add colors using the green “+” button (same way as for segments) then you never ever see the background label and never get tempted to specify some custom name or color for it.

But I completely understand that since the spinbox for modifying the number of colors is displayed quite prominently, you may decide to use that to increase the table size, and then you don’t understand why you don’t see any change, so you uncheck the “Hide empty colors” checkbox, which then shows the background color as well.

Maybe moving the “Number of colors” entry to some advanced section could help. Or maybe even better would be to have a separate checkbox to show the background label (in an advanced section, so that only very advanced users would find it)?

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 7, 2025, 9:59pm UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/15 "2025-03-07T21:59:01Z")

</div>

> [@lassoan](#):
>
> You only ever see the background label if you explicitly uncheck the “Hide empty colors” checkbox. If you add colors using the green “+” button (same way as for segments) then you never ever see the background label and never get tempted to specify some custom name or color for it.

Actually my usage was different: After I click on create a new color table button, instead of using + or -, I simply entered the number of labels I wanted in the field that says “Number of Colors”, as I thought that was expected of me.

Now, I understand for this use case I need to use the + and - buttons, but I am not sure it is quite obvious.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 7, 2025, 9:59pm UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/16 "2025-03-07T21:59:57Z")

</div>

I still think it might be a good idea to slightly differentiate this type of color table creation from regular color table? That way maybe the number of colors is not an editable field?

---

<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:** [March 7, 2025, 10:10pm UTC](https://discourse.slicer.org/t/feedback-on-custom-color-table-creation/41963/17 "2025-03-07T22:10:07Z")

</div>

Yes, we definitely need to change the GUI to make it easier to use as intended. Hiding the background color even if showing other undefined colors will be needed but maybe also the number of colors spinbox can be moved to an advanced section.
