Using lua to import and move DICOM from disk

  • Hello again. I'm hoping someone can give me some pointers.


    I'm setting up conquest as a QA image server (replacing KPACS plus manual archiving). I have created a lua makefilename file so images that are sent directly from modalities can be placed into a logical human-friendly files structure for ease of subsequent analysis using a variety if tools. The makefilename script uses modalities, station names and serial numbers to work out which bit of kit/site etc each image comes from.


    A good proportion of our QA images however are copied onto the server from USB or CD/DVD. I'd like to be able to 'dump' these into a folder, then run a script to import them to conquest, with the objects being moved to the locations determined by the same makefilname.lua script.


    I'm assuming I'd need to do something along the following lines; am I right?


    Code
    -- iterate through folder, or somehow get individual DICOM objects to read
    new_dcm = readdicom(filename)
    new_filename = dofile('makefilename.lua') -- or is that just in dicom.ini, and either way how do I pass my DICOM object?
    os.rename(filename, new_filename)
    new_dcm = readdicom(new_filename)
    addimage(new_dcm)


    Any help or advice would be most welcome. I could also upload an abbreviated version of my makefilename.lua if anyone might find it useful?


    Ed

Participate now!

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