Parsing a json file for specifying the terminology for segment editor


I have a json file that contains the necessary information for specifying the terminology for the segment editor, similar to this.

To use this file, I see that I can do something like:
terminologyFile = path_to_json_file
tlogic = slicer.modules.terminologies.logic()
terminologyName = tlogic.LoadTerminologyFromFile(terminologyFile)

However, if I have a different json file that contains the terminology specification as well as other additional fields, I cannot use the above method. Has anyone tried to parse and set the terminology correctly in this case?

So far I have tried using tlogic.DeserializeTerminologyEntry, but I encounter errors in failing to get the terminology category.

Thank you,


you may want to check whether your JSON file is valid using this tool.

Sorry, perhaps I didn’t explain it properly.

My original json file is valid, here is a snippet:


However the new json file I am creating contains the fields for the terminology along with extra fields required for the extension I’m working on. For instance, something like this.

Therefore, I need to parse this new json file to set up the terminology appropriately.

Thank you,