Changing terminology files at runtime

Hello everyone.

I need to change the set of segmentation terminology entries I am able to select in the segment editor (when I double click the color of a segment in the segments table) depending on the context I am working on.

For example, I want to have a method that only allows bone categories to appear when I am changing my segment color, but then I want to run segmentation of different tissues at another scale in other context, then I would change the categories appearing to another set, by running a different method (hopefully in Python).

I tried creating different *.term.json files and put them in share/$SLICER_APP/qt-loadable-modules/Terminologies but I have no clue how to change between them when using Slicer. I read the documentation on the Terminologies module and also tried understanding the code, but still I was not able to do so.

Do you have any tips on how to do that?

Also, does Slicer read every terminology file in that Terminologies folder, or only a specific filename?

Thank you beforehand for your attention.

I ended up discovering how to use terminology categories and storing every entry in the same JSON file. I did not see the left arrow to open the category filter there before I made this post.

1 Like