Original identifiers remaining in DICOM header for anonymized studies.

  • I noticed that the original identifiers can be found in the header information for anonymized studies. I'm just using the anonymize_script.lua, which is the default option. I've tried changing the "reversible" option to false and tried a few other changes, but I either break it or the change doesn't work. Below is how it appears in the header. Any way to ensure this information isn't retained?

    >>0008,1030 28 LO StudyDescription "DX FOOT COMP MIN 3 VIEWS LT "

    >>0010,0010 12 PN PatientName "NAME^ORIGINAL"

    >>0010,0020 14 LO PatientID "ORIGINAL PATIENT ID"

    >>0010,0030 8 DA PatientBirthDate "ORIGINAL DOB"

    >>0010,0040 2 CS PatientSex "M "


  • Hi Jeff,

    this information is in a sequence (as I see from the >>), so not in its official place at the top level. It is easy to modify ananymize_script to delete the whole sequence. E.g. by adding its name to TagsToRemove.

    reversible relates to it storing patientID in a key table on the database.


  • Trying to work out one more thing with the anonymization. I'd like to set the study date to the current date. Is there a way I could adapt the current ananymize_script to incorporate that? I've seen mention of a lua script library, but I can't seem to find it on this site, so hoping for some direction to that or more direct help with how to accomplish this. Sorry, not a programmer. Thanks for whatever help you can give.


  • Hi,

    you can add e.g. these lines:

    Data.SeriesDate = os.date("%Y%m%d")

    Data.StudyDate = os.date("%Y%m%d")

    Data.AcquisitionDate = os.date("%Y%m%d")

    Data.ContentDate = os.date("%Y%m%d")


    This sets the current date (and time) formatted as DICOM format. You can do this anywhere close to the end of anonymize_script.lua


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!