Command (lua?) passed to dgate to modify Study

  • I though I could figure this out, but to no avail...

    When utilizing the "Modify -> this Series (advanced)", what is the command/format passed to dgate?


    I was attempting the following to programmaticly anonymize an exam (without the additional Lua script additional modifications). Lua script finds the exam, but does not appear to run 'anonymize_script.lua'.


    Script:

    a = newdicomobject()

    a.PatientID='0123456789'

    a.StudyInstanceUID='1.2.826.0.1.3680043.2.135.737371.41451203.7.1577747799.500.2'


    local threadno_forprogressinfo=123

    local copy=1

    newdicommodify(a, 'anonymize_script.lua', threadno_forprogressinfo, copy);


    Output:

    [AIA_LAB] Server command sent using DGATE -- option

    [AIA_LAB] Importconverter-1.0 executes: set PatientID to "0123456789"

    [AIA_LAB] Importconverter-1.0 executes: set StudyInstanceUID to "1.2.826.0.1.3680043.2.135.737371.41451203.7.1577747799.500.2"

    [AIA_LAB] Query On Image

    [AIA_LAB] Issue Query on Columns: DICOMStudies.PatientID, DICOMStudies.StudyInsta

    [AIA_LAB] Values: DICOMStudies.PatientID = '0123456789' and DICOMStudies.StudyInsta = '1.2.826.0.1.3680043.2.135.737371.41451203.7.1577747799.500.2' and DICOMSeries.StudyInsta = DICOMStudies.StudyInsta and DICOMImages.SeriesInst = DICOMSeries.SeriesInst

    [AIA_LAB] Tables: DICOMImages, DICOMSeries, DICOMStudies

    [AIA_LAB] Query Distinct Tables: DICOMImages, DICOMSeries, DICOMStudies

    [AIA_LAB] Columns : DICOMStudies.PatientID, DICOMStudies.StudyInsta

    [AIA_LAB] Where : DICOMStudies.PatientID = '0123456789' and DICOMStudies.StudyInsta = '1.2.826.0.1.3680043.2.135.737371.41451203.7.1577747799.500.2' and DICOMSeries.StudyInsta = DICOMStudies.StudyInsta and DICOMImages.SeriesInst = DICOMSeries.SeriesInst

    [AIA_LAB] Order : (null)

    [AIA_LAB] Records = 1

    [AIA_LAB] Link.Connected false in PDU:Read

    [AIA_LAB] Connected by address: 0100007f


    What am I missing?

    Thanks,

    Scott

  • Hi,


    the script in this window is run for every object, which is passed in Data.


    So you can just do e.g.:


    dofile('lua/anonymize_script.lua')

    Data.PatientID='0123456789'

    Data.StudyInstanceUID='1.2.826.0.1.3680043.2.135.737371.41451203.7.1577747799.500.2'


    regards


    Marcel

  • That makes sense to me, but how to pass a Study (i.e. Data) to a ZeroBrain lua script:



    And then pass parameters to anonymize_script.lua per:


    -- 20130813 mvh Command line overrules generated patientid and patientname


    Thank you and Happy New Year!

    Scott

  • Hi,


    it uses global command_line, which is hardcoded in anoymize_script.lua


    command_line = '0123456789'

    dofile('lua/anonymize_script.lua')


    New versions also accept DICOM tag 0x9999,0x1234 as patient ID.


    Marcel

Participate now!

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