Keep a grop of tags (gggg-****) during anonymization

Is it possible to specify that a group of tags be kept? That is, all elements eeee for a given group gggg?

I see in all the lua examples that most keep statements specify specific gggg-eeee combinations.

However, I would like to keep all elements belonging to a specific group (gggg-*). Essentially, I’d like to keep one of the manufacturer sets of tags, but have Orthanc still strip the other odd numbered manufacturer tags.

Just for fun, I tried adding ‘0019-’ and ‘0019-*’ to the keep list, but neither worked, generating lua script errors.

I suppose I could query the first image for all tags matching the desired group and then use that to generate the keep list.

I could


No, specifying kind of a wildcard to define a set of tags during anonymization is not possible for the time being.

You’ll have to specify each tag generated by your manufacturer one-by-one. Note that this list of tags should be available in the DICOM conformance statement of your modality.

I have just added a card on the Wishlist board:


Thanks for the response, Sebastien.

I was able to implement a solution in lua. I query the incoming DICOM prior to anonymization and make a table of all items encountered in the 0019 group. Then I add those to the keep list during anonymization. The solution takes more time reading the files, but luckily this particular group of researchers tend to send only single images per series in their studies.