Inserting new tags and sequences into incoming DICOM

Hi,

Does anyone know if it is possible to create new tags within an incoming DICOM file? I know how to modify the values of tags which already exist but not how to create new ones.

For example, I have a RTDose object, where the tag (300c,0002) does not exist and needs to be created. I then need to add a sequence to this tag containing (0008,1150) and (0008,1155) tags.

I have been able to do this with a python script using the pydicom library but I'm wondering if I can achieve the same thing using Orthanc.

Many thanks for any advice,

Ben

Yes, you could, with a lua script, there are some examples on the docs.

You just have to define the tag.

This is and example for removing one tag on FilterRequest … but the idea it’s the same for storing filters.

[filterAEMED.lua]

function IncomingFindRequestFilter(source, origin)
PrintRecursive(source)
PrintRecursive(origin)
local v = source
v[‘5555,0010’] = nil
return v
end

[…]