How to automatically run a software after receiving a all the images of a study (exam)?

  • Hello,

    I just installed the Conquest Dicom server and it can receive images of a study (exam) acquired from scanner now.

    I would like to make this Dicom server to automatically :

    1. copy the images of the study to a folder

    2. start a program, say myApp.exe, AFTER all the images of the study have been received,

    I copied myApp.exe into the Dicom server folder and added following at the end of the dicom.ini file:

    # Configuration of rules to modify, log or reject incoming DICOM slices

    ImportConverters = 1

    ImportModality0 = MR

    ImportConverter0 = mkdir D:\temp\PACS\Incoming\%V0008,0050\; copy %f to D:\temp\PACS\Incoming\%V0008,0050\%f.dcm

    ExportConverters = 1

    ExportModality0 = MR

    ExportConverter0 = myApp.exe D:\temp\PACS\Processed\%V0008,0050

    After sending a study to this server, the problems are found:

    a. no file is copied as expected

    b. myApp.exe is triggered after receiving each image.

    Could anyone help?

    Thank you!


  • instead of

    copy %f to D:\temp\PACS\Incoming\%V0008,0050\%f.dcm


    save dcm as D:\temp\PACS\Incoming\%V0008,0050\%f.dcm

    and use:

    process study by myApp.exe D:\temp\PACS\Processed\%V0008,0050


  • A further question: how to add current date and time as a subfolder name?

    For example:

    I used the command

    ImportConverter0 = mkdir D:\temp\PACS\Incoming\%V0008,0050\%d

    The folder is D:\temp\PACS\Incoming\474199019\Fri, Jan .

    Is there any way to control the format of %d, make it as yyyymmddhhmmss ?

    Thank you!

  • Thank you!

    I have never used lua in dicom.ini before.

    I tried following, but not working.


    mydate ='%Y'..'/%m/'..'%d')

    ExportConverter1 = mkdir D:\temp\PACS\Processed\%V0010,0020\%V0020,0010\%mydate%;


    ExportConverter1 = mkdir D:\temp\PACS\Processed\%V0010,0020\%V0020,0010\ works.

  • Try this:


    Association = local mydate

    ImportConverter0 ='%Y'..'/%m/'..'%d'); script("mkdir D:\temp\PACS\Processed\%V0010,0020\%V0020,0010\"..mydate);

    ImportConverter1 = Data:Write("D:\temp\PACS\Processed\%V0010,0020\%V0020,0010\"..mydate..Data.SOPInstanceUID);

    Export converters run asynchronous, so you cannot rely on any order, I would avoid using lua in them. script() runs a 'normal' import converter

    Or call a dofile to run an external script file.


  • Hi Marcel,

    Before I read your reply, I wrote a windows batch script for this purpose and called the script in the ExportConverter.

    Thank you very much for providing the lua solution!

Participate now!

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