Posts by BenE

    One other test I had an issue with is testing if the ImageType attribute is correct. I wanted to only accept images with the image attribute equal to "ORIGINAL\\PRIMARY\\PORTAL". However, because of the double backslash I think Data.ImageType becomes "ORIGINAL\PRIMARY\PORTAL" when viewed by lua. See this example:


    This test doesn't work as expected:


    Code
    if (Data.ImageType ~= [[ORIGINAL\\PRIMARY\\PORTAL]]) thenscript('reject')print("RT image not acquired by EPID - image rejected")end


    But this does work:


    Code
    if (Data.ImageType ~= [[ORIGINAL\PRIMARY\PORTAL]]) then
    script('reject')
    print("RT image not acquired by EPID - image rejected")
    end


    Is this a bug or something to expect when testing attributes with special characters?


    Also, I was wondering is there a way when rejecting an image to pass a message back to the SCU of the reason for the image rejection? At the moment it's just blank.


    Thanks for your help,


    Ben

    I have been trying to do something similar in 1.4.17 - rejecting images without a patient ID using lua. Here's my code:


    local n = Data.PatientID
    --Reject images without patient ID
    if not n then
    script('reject')
    print ("No patient ID - image rejected")
    end


    This rejects the images. However, the server won't accept any further store requests - i have to kill and restart the server. Do I need to cleanly close the association somehow when using script('reject')?


    Ben

    Is it possible within Conquest to base the file structure upon related DICOM files which are referenced within one the sent files? For example:


    If I sent an RT PLAN and CT to Conquest I would like to save the RT Plan as follows:


    Patient ID\Plan Name


    This would be straightforward for the RT Plan as I could use obtain both the patient ID and plan name from the RT Plan file. However, I would also like to save the CT in the same format. Since the plan name is not contained in the CT, would I have to make use of the frame of reference UID to relate it to the RT Plan, then extract the plan name from the RT Plan?


    I would be intrigued to hear if Conquest can do this through Lua or otherwise.


    Thanks,


    Ben

    I had to adjust my lua code in 'RPMFilter.lua' to get the right output see below:


    Code
    if Data.ProtocolName == "RTP Retrospective Gating" then str = Data.SeriesDescription str = str:match('[^/]*' ) Data.SeriesDescription = str print (Data.SeriesDescription) print (str)end


    In the log file str prints as "RG Ph 0%" but Data.SeriesDescription prints as "RG Ph 0%/15.00bpm 2.0 RTP RTP Body HALF". I can't see why the line:


    Code
    Data.SeriesDescription = str


    is not setting the SeriesDescription to "RG Ph 0%". What am I missing?


    Thanks for your help so far it makes much more sense now!


    Ben


    Edit: I have just been reading the manual, I now understand that the % needs to be sent as a %% to appear as a % as this is an escape character in Conquest

    Hi,


    I would like to auto-route dicom files through ConQuest where the string in the SeriesDescription tag is shortened to remove some unwanted text. E.g. I would like "RG Ph 0%/15.00bpm 2.0 RTP RTP Body HALF" to become "RG Ph 0%". However, I only want this to happen for files which have been scanned using the following protocol "RTP Retrospective Gating", I believe this is contained in the tag 0018,1030.


    I've been reading the manual and this site and attempted it in version 1.4.16. However, I haven't been very successful, so I was hoping someone here might be able to point me in the right direction!


    So far I have added the following code to dicom.ini:


    Code
    # Configuration of rules to modify, log or reject incoming DICOM slicesImportconverters = 1ImportConverter0 = call RPMFilter.cq# Configuration of rules to auto-export incoming DICOM slicesForwardAssociationLevel = IMAGEForwardAssociationCloseDelay = 5ForwardAssociationRefreshDelay = 3600Exportconverters = 1ExportConverter0 = ifnotequal "%V0018,1030","RTP Retrospective Gating";stop;forward Series to PINN810S1 org %u


    Then in RPMFilter.cq I have the following code:


    Code
    ifnotequal "%V0018,1030","RTP Retrospective Gating";stop; s = Data.SeriesDescription; key = string.match(s, "/"); key = key - 1; Data.SeriesDescription = string.sub(s, 1, key) end;


    Now the I think the RPMFilter.cq is causing the problem, likely because I'm not familar with Lua! Here's a sample from the log:


    Code
    [CONQUESTSRV1] *** Importconverter-1.2 error: s = Data.SeriesDescription
    [CONQUESTSRV1] *** Importconverter-1.3 error: key = string.match(s, "/")
    [CONQUESTSRV1] *** Importconverter-1.4 error: key = key - 1
    [CONQUESTSRV1] *** Importconverter-1.5 error: Data.SeriesDescription = string.sub(s, 1, key) end


    I'm not sure the variables are being picked up correctly? Do I need to delcare that I would like to use Lua somewhere or does it expect Lua?
    Apologies if these are trivial questions but this is rather new to me so any help would be much appreciated.


    Many thanks,


    Ben