Batch anonymization

  • Hi Marcel,


    I hope you are doing well. At AVL I got a few requests to run anonymization in batch mode, i.e. for multiple patients at once.


    To achieve this I looked at connecting the Conquest DICOM server to ZeroBrane Studio to open up the scripting capabilities. I came up with this solution:


    1. Create a local file e.g. "anonpat.lua" with the following content:



    2. Modify the three lines of code marked with "Change This" to your liking. For large scale anonymization we can optimize this by e.g. reading the pair of new and old names from a text file. Note: the name 'CONQUESTSRV1' has to match with an entry in your ACRNEMA.MAP (4th screen of the Conquest DICOM server).


    3. Start ZeroBrane Studio and connect it to your local DICOM server (this may require to run the install.lua script from the lua folder for the DICOM server first).


    4. Run the script above by pressing the "Play" button twice


    Is this also how you would suggest to do this, or is there a more straightforward approach?


    Best regards,


    Lennert.

  • Hi Lennert,


    this is a perfectly good way to do it. I usually suggest people to create a batch file with dgate --modifystudy: commands but this is just as elegant.


    greeting from Manchester


    Marcel

  • Hi Marcel,


    Thank you for your swift reply. My understanding was that the "'modifystudy" command required a valid StudyInstanceUID, but it seems that it can be left out. In windowsmanual.pdf it is documented as:

    Quote

    --modifystudy:p,s,script Change items in patient or study

    Having a shortcut like "--anonymize:oldpatid,newpatid" would further facilitate this process. Does this sound reasonable?


    Best regards,


    Lennert.

  • Hi Lennert,


    had forgotten about that. I try to keep the manual exact, so I refer to it often myself ;->>>


    servercommand uses tcpip and has a 5 minutes timeout. So I would prefer to do it study by study to avoid running into scripting issues.


    I agree a shortcut like


    dgate --anonymizestudy:patid,studyuid,newpatid


    would be handy.


    although


    dgate "--modifystudy:patid,studyuid,lua/anonymize_script('newpatid')"


    is pretty close and more generic as it can call any script.


    regards,


    Marcel

  • Thanks again Marcel.


    Currently anonymization is only performed on local DICOM servers, so I do not expect that anonymization will take more than 5 minutes this way. Fortunately, we have the technique of using the "modifystudy" command documented this way, so hopefully others can benefit from my hunt for a solution.


    Best regards,


    Lennert.

Participate now!

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