DICOM SR and import converters

  • Hi! in a old version of Conquest (14) I used these commands in dicom.ini


    Code
    ExportConverters = 2ExportConverter0 = dgate.exe "+'"'+"--convert_to_jpg:%f,1024,"+ALLTRIM(PATH_DICOM)+"\"+"%b.jpg,//0ExportModality1 = SRExportConverter1 = dsr2xml.exe %f "+ALLTRIM(PATH_DICOM)+"misure.xml


    upgrading to a new version (16 or 17) Marcel suggested me to use import converters instead of export converters, so I changed the first lines in this way:


    Code
    ImportConverters = 2
    ImportConverter0 = save to "+ALLTRIM(PATH_DICOM)+"\temp.dcm
    ImportConverter1 = process with dgate.exe "+'"'+"--convert_to_jpg:"+ALLTRIM(PATH_DICOM)+"\temp.dcm,1024,"+ALLTRIM(PATH_DICOM)+"\"+ALLTRIM(PATHSRVDCM)+",//0"+'"'+";destroy


    Now I need to use also SR modality, so how would I change the previous ExportConverter1 into ImportConverter2 to make it work?


    PS ALLTRIM(PATH_DICOM) and ALLTRIM(PATHSRVDCM) are 2 variables that contains the path of the folder to store images.


    Let me know....and regards!

  • Hi,


    try e.g.:


    ImportConverter0 = save to tempfile.dcm
    ImportConverter1 = system dgate.exe --convert_to_jpg:tempfile.dcm,1024,tempfile.jpg,//0
    ImportConverter2 = system dsr2xml.exe tempfile.dcm misure.xml
    ImportConverter3 = rm tempfile.dcm
    ImportConverter4 = destroy


    Marcel

  • Hi Marcel!


    I don't understand....


    before SR I have
    ImportConverters = 2
    ImportConverter0 = save to "+ALLTRIM(PATH_DICOM)+"\temp.dcm
    ImportConverter1 = process with dgate.exe "+'"'+"--convert_to_jpg:"+ALLTRIM(PATH_DICOM)+"\temp.dcm,1024,"+ALLTRIM(PATH_DICOM)+"\"+ALLTRIM(PATHSRVDCM)+",//0"+'"'+";destroy


    so the import convertes should change from 2 to 3, and is not sufficient to add this line??:
    ImportModality2 = SR
    ImportConverter2 = dsr2xml.exe %f "+ALLTRIM(PATH_DICOM)+"misure.xml


    I don't understand your example:


    ImportConverter0 = save to tempfile.dcm
    ImportConverter1 = system dgate.exe --convert_to_jpg:tempfile.dcm,1024,tempfile.jpg,//0
    ImportConverter2 = system dsr2xml.exe tempfile.dcm misure.xml (I NEED ONLY THIS????)
    ImportConverter3 = rm tempfile.dcm
    ImportConverter4 = destroy

  • Hi,


    ImportConverters is not necessary, but filtration may still be applied, e.g.,


    ImportModality2 = SR
    ImportConverter0 = save to tempfile.dcm
    ImportConverter1 = system dgate.exe --convert_to_jpg:tempfile.dcm,1024,tempfile.jpg,//0
    ImportConverter2 = system dsr2xml.exe tempfile.dcm misure.xml
    ImportConverter3 = rm tempfile.dcm
    ImportConverter4 = destroy


    They will just be called one by one in order. But if you want to set ImportConverters it should now be set to 5.


    Marcel

  • what I don't understand is that the SR file is received at the end of the study (in US machines)
    so, I can get the single dicom image with


    Code
    ImportConverter0 = save to "+ALLTRIM(PATH_DICOM)+"\temp.dcmImportConverter1 = process with dgate.exe "+'"'+"--convert_to_jpg:"+ALLTRIM(PATH_DICOM)+"\temp.dcm,1024,"+ALLTRIM(PATH_DICOM)+"\"+ALLTRIM(PATHSRVDCM)+",//0"+'"'+";destroy


    and then only the SR with


    Code
    ImportModality2 = SRImportConverter2 = dsr2xml.exe %f "+ALLTRIM(PATH_DICOM)+"misure.xml


    with export converters all worked in this sequence:

    Code
    ExportConverters = 2
    ExportConverter0 = dgate.exe "+'"'+"--convert_to_jpg:%f,1024,"+ALLTRIM(PATH_DICOM)+"\"+"%b.jpg,//0
    ExportModality1 = SR
    ExportConverter1 = dsr2xml.exe %f "+ALLTRIM(PATH_DICOM)+"misure.xml


    another question: where I can find the last dsr2xml.exe utility?

  • Ah,


    I get the point, you need to filter both lines. Maybe this is a bit clearer:


    ImportConverter0 = save to tempfile.dcm
    ImportConverter1 = ifequal "%m","SR"; stop; system dgate.exe --convert_to_jpg:tempfile.dcm,1024,tempfile.jpg,//0
    ImportConverter2 = ifnotequal "%m","SR"; stop; system dsr2xml.exe tempfile.dcm misure.xml
    ImportConverter3 = rm tempfile.dcm
    ImportConverter4 = destroy


    Marcel

  • Ok Marcel, I understand!


    but should not be in this way???


    Code
    ImportConverter0 = save to tempfile.dcm
    ImportConverter1 = ifnotequal "%m","SR"; stop; system dgate.exe --convert_to_jpg:tempfile.dcm,1024,tempfile.jpg,//0
    ImportConverter2 = ifequal "%m","SR"; stop; system dsr2xml.exe tempfile.dcm misure.xml
    ImportConverter3 = rm tempfile.dcm
    ImportConverter4 = destroy
  • It doesn't work Marcel!!!


    I've tried this way:


    Code
    ImportConverters = 5ImportConverter0 = save to C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\EG20130316\temp.dcmImportConverter1 = ifequal "%m","SR";stop;process with dgate.exe "--convert_to_jpg:C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\EG20130316\temp.dcm,1024,C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\EG20130316\%V0020,0013.jpg,//0"ImportConverter2 = ifnotequal "%m","SR";stop;dsr2xml.exe C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\EG20130316\temp.dcm C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\EG20130316\misure.xmlImportConverter3 = rm C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\EG20130316\temp.dcmImportConverter4 = destroy


    but it seems that if I'm sending an image (slide) it works (import converter 1), while when I send the SR report the importconverter 2 is skipped, on the server page I find only import converter 0 and 4, why????????


    if I try with export converters?


    infact, if I put only this in dicom.ini it works (no slide retrieving)

    Code
    ExportConverters=1
    ExportModality0 = SR
    ExportConverter0 = dsr2xml.exe %f "+C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\EG20130316\misure.xml


    an example with both image and SR retrieving?

  • Hi,


    importconverters require 'system ' to call an external program!


    ImportConverter2 = ifnotequal "%m","SR";stop; system dsr2xml.exe C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\EG20130316\temp.dcm C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\EG20130316\misure.xml


    If am advocating lua now for these kind of tasks because the syntax is easier.


    Marcel

  • Hi Marcel!


    today at 3 p.m. I'll try your hint


    by the way, could you supply me also an exportconverter example to test if the import doesn't work?


    Sorry but I can use this US machine only when the clinic is closed, just one afternoon a week


    regards,


    ciro

  • Hi Marcel!


    I've this in dicom.ini

    Code
    # Configuration of disk(s) to store imagesMAGDeviceThreshhold = 0MAGDevices = 1MAGDevice0 = C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\PT20130316\NightlyCleanThreshhold = 0ImportConverters = 5ImportConverter0 = save to C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\PT20130316\temp.dcmImportConverter1 = ifequal '%m','SR';stop;process with dgate.exe "--convert_to_jpg:C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\PT20130316\temp.dcm,1024,C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\PT20130316\%V0020,0013.jpg,//0ImportConverter2 = ifnotequal '%m','SR';stop;system dsr2xml.exe C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\PT20130316\temp.dcm C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\PT20130316\misure.xmlImportConverter3 = rm C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\PT20130316\temp.dcmImportConverter4 = destroy


    I've also tested the %m and this is the result

    Code
    [CONQUESTSRV1] Importconverter1.0: nop ImportConverter logs modality: SR


    this is what happens in the server status window


    Code
    [CONQUESTSRV1] DGATE (1.4.15, build Wed Jul 14 15:56:50 2010, bits 64) is running as threaded server[CONQUESTSRV1] Database type: NULL driver (black hole)[CONQUESTSRV1] User interface test: local server is running![CONQUESTSRV1] [CONQUESTSRV1] UPACS THREAD 0: STARTED AT: Thu Mar 21 15:19:14 2013[CONQUESTSRV1] Calling Application Title : "TEST "[CONQUESTSRV1] Called Application Title : "ALPHA10 "[CONQUESTSRV1] Application Context : "1.2.840.10008.3.1.1.1", PDU length: 27740[CONQUESTSRV1] Presentation Context 0 "1.2.840.10008.1.1" 1[CONQUESTSRV1] Presentation Context 1 "1.2.840.10008.5.1.4.1.1.88.22" 1[CONQUESTSRV1] Presentation Context 2 "1.2.840.10008.5.1.4.1.1.88.33" 1[CONQUESTSRV1] Importconverter0.0 executes: save to C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\PT20130316\temp.dcm[CONQUESTSRV1] Importconverter4.0: destroyed received image[CONQUESTSRV1] Importconverter0.0 executes: save to C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\PT20130316\temp.dcm[CONQUESTSRV1] Importconverter4.0: destroyed received image[CONQUESTSRV1] UPACS THREAD 0: ENDED AT: Thu Mar 21 15:19:15 2013[CONQUESTSRV1] UPACS THREAD 0: TOTAL RUNNING TIME: 1 SECONDS


    this is in debug mode

  • Hi,


    Sorry, you need to use " rather than ' around strings in the import converters. My mistake. Also a small 'bug': rm does not log even if it works.


    ImportConverters = 5
    ImportConverter0 = save to C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\PT20130316\temp.dcm
    ImportConverter1 = ifequal "%m","SR";stop;process with dgate.exe etc
    ImportConverter2 = ifnotequal "%m","SR";stop;system dsr2xml.exe etc
    ImportConverter3 = rm C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\PT20130316\temp.dcm
    ImportConverter4 = destroy


    Marcel

  • Ok, I've found it!


    but now I'm getting problems with dsr2xml utility....


    if I put

    Code
    ImportConverter2 = ifequal "%m","SR";process with dsr2xml.exe C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\PT20130316\temp.dcm C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\PT20130316\misure.xml


    on the conquest server window I get


    Code
    [CONQUESTSRV1] Importconverter2.1 executes: process with dsr2xml.exe C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\PT20130316\temp.dcm C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\PT20130316\misure.xml C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\PT20130316\printer_files\1.2.826.0.1.3680043.2.135.730956.43877812.6.1363878834.760.0.dcm


    and, of course, doesn't work, why is the %f added at the end?
    If i put the same command in a .bat file and launch it, it works! maybe I need some particular syntax for parameters???


    PS if I launch with system doesn't work, with process to it works!


    thanks!!

  • Hi,


    process with does: save image %f, run exe %f, load image %f, so the command itself adds the %f on the end.


    system does nothing of that all, so you should replace "process with" also with "system"


    Marcel

  • If I put


    Code
    ImportConverter3 = ifequal "%m","SR";system dsr2xml.exe C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\MR20130210\misure.dcm C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\MR20130210\misure.xml


    doesn't work! no conversion at all


  • Hi, does


    dsr2xml.exe C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\MR20130210\misure.dcm C:\SOFTWARE_EMMECI\DESKTOP\IMG_ECO\P000001\MR20130210\misure.xml


    work?


    Maybe it cannot locate the dictionary or dsr2xml.exe.


    system maps onto c++ system() function and should work. You can also try e.g.,


    system notepad


    or use the full path of dsr2xml.exe


    Marcel

Participate now!

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