Linux attempt to anonymize

  • Hello


    I've been attempting to use the lua/anonymize_script to do some anonymization of studies. Unfortunately I can't get it to work and I'm not entirely sure why. I'm using the following form

    Code
    /dgate --modifystudy:,1.2.3.1212.1232,"lua/anonymize_script('199199')"


    after running this from a bash cmd line I get the following in the serverlog


    Code
    Importconverter-1.0 error: lua/anonymize_script


    I do have lua installed and up to date. I've also tried several other changes in syntax like escaping the single quotes, giving the full path to the script, removing the double quotes altogether but they all result in the same error.
    Does anyone have any suggestions.
    BTW running dgate 1.4.19 on centos 7.3


    Thanks in advance

  • marcel
    I am still seeing the error . However by adding the entire path to lua script as in:

    Code
    /dgate --modifystudy:,1.2.3.1212.1232,"/usr/local/dgate/lua/anonymize_script.lua('199199')"


    I was able to produce a different error. This was


    Code
    lua run error /usr/local/dgate/lua/anonymize_script.lua:80: attempt to index local 'f' (a nil value) in 'dofile('/usr/local/dgate/lua/anonymize_script.lua')'


    Any other hints or suggestions .
    Thanks for looking reviewing this post .


    MrJohnathan Bravo

  • Hi Jonathan,


    use no quotes inside the (). The last error is because it cannot open the logfil, which is at the dgate current folder. Looking at the code in anonymize_script.lua, it seems that backslashes \\ are used, which need to be replaced by a forward slash / in lines 52 and 75.


    I will add that to the bug list.


    Marcel

  • Marcel
    Just to help .
    on line 52 I had to add the full path to the dgate directory so


    Code
    local logroot = "/usr/local/dgate/DicomAnonymized_Log/"


    and also I had changed line 79 . the open mode was set to "wt" , and I think it should be "w+" as I could not find any reference in lua documentation on line for a "wt" mode . I also added the assert so I could see the error on the file open.


    Code
    local f = assert(io.open(logdir .. logfile, "w+"));


    Hope this helps.
    Mr Johnathan Bravo

Participate now!

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