bunch of random questions/problems

  • Hi


    I've accumulated few questions and problems over the past few years. I'd appreciate any help.


    1)

    I'd like to limit the query results based on the calling AET.

    For example - if calling AET ='XX' then replace modality of the query with 'CT'. In other words I'd like station XX to be able to see ONLY CTs no matter how broad the initial query was.


    Reading thru the manual I'm pretty sure it can be done using QueryConverter0 (or maybe RetrieveConverter0 ?) using %c in place of calling AET but that's all I've got :( There is no example in the manual unfortunately.


    2)

    I'd like one dicom node to be a 'dedicated forwarding node'. It's the only one visible the the outside world and it's only job is to do all the routing based on few dicom tags.

    Routing part is easy but I have problems deleting stuff. This node should keep the study only until it has been forwarded, then delete it. (which may take days, cause external nodes may be offline)


    I thought it would be as simple as sth like that:

    ExportConverter0 = ifequal "%V0032,1033", "example"; forward to SomeDicomNode; destroy;


    Unfortunately it's not that simple.. I get this:

    ***Exportconverter0: Spawning 'destroy' failed (argv=\\archiwum\1.3.12.2.1107.5.1.4.54058.30000021020206553043700016703.dcm)


    Not sure what I'm doing wrong here :(


    3)

    Is there some kind of a more 'robust' GUI which allows us to edit stuff like dicom tags or delete study? It's quite frequent that I have to change some tags in a study. Right now I'm using DicomBrowser (tool from Washington University) and it works fine but I'm looking for something better


    4)

    Using 1.5.0.b I'm getting some serious gui freezes every few seconds. (tested on 2 different PCs win2003 and win2012, same behavior)

    Service is working properly but gui becomes completely unresponsive (as in 'this program is not responding'). I *think* it's influenced by how much is going on (log scrolling) but tbh I'm not sure.


    Best Regards

    Patryk

  • Use Lua as much as possible.


    1)


    [Lua]

    QueryConverter0 = if Association.Calling=='xx' then Data.Modality='CT' end


    2) commands destroy and reject (lua destroy() and reject()) work on incoming data. You can try e.g. forward series after and delete series after but very likely it will not detect down nodes properly.

    Not an easy solution. You could try "process study after 50 by blabla.lua(%VStudyInstanceUID)" and write send and delete code in blabla.lua.

    E.g.:

    x=DicomObject:new(); x.PatientID='118'; x.QueryRetrieveLevel='PATIENT'; print(dicommove('CONQUESTSRV1','CONQUESTSRV10',x))

    ***dicommove: remote DICOM error


    3) I only maintain the conquest GUI, and it can do these things but not very easy (especially editing DICOM tags). You could write one in Lua with iup. All the parts are there, see e.g. console.lua.


    4) Noted. Could it be the progress socket blocking things? The serverstatus socket is UDP and that should not block. I still think the server should just log to a file and the GUI refresh once in a while.
    If you can see which version changed this behavior that would be good. It does unfreeze though, doesn't it?


    Marcel

  • Hi Marcel


    Thank you for your help.


    1)

    I tried it and it *almost* works.

    QueryConverter seems to work just fine but I think sth is wrong with the Data.Modality field.


    My query is asking for PatiendID='1234' and Modality='CT' (query from aet='qc_efilm')


    If I do something like this it's working as intended (I'm asking for id 1234 and getting patient with id 4321 as a result):

    if Association.Calling=='qc_efilm' then Data.PatientID='4321' end


    however if I do sth like this I'm still getting CT, not PX:

    if Association.Calling=='qc_efilm' then Data.Modality='PX' end


    So it looked to me like Data.Modality was not the right field... so I tried Data.StudyModality but it also did not work :(

    While debugging I tried to print Data.PatientID, Data.Modality, Data.StudyModality - I got 1234, nil, nil in return.


    I'm new to lua and have no idea how could print out whole Data structure. I thought it might be a table but it's not... so I'm stuck. Is there a full list of Data.xxxx fields somewhere?

    I looked thru the files and I'm pretty sure the 'StudyModality' is the right answer here.. no idea why it's nil :(


    2)

    work on incoming data

    aaahhh.. ok. This explains everything. OK, in that case I'll try the custom lua script solution.


    3)

    :( I'm using dgate for over 10 years and this is the only thing I'm missing... so close to perfection :D


    4)

    I'm pretty sure this was introduced with the 1.5 version. I just didn't report it earlier cause I had a per-release version of 1.5 so I just assumed it was due to some debug stuff running in the background or sth. Then I upgraded to the current version (1.5.0b) and it's still happening. Before that I had 1.4.19 but honestly I'm not sure about the letter.. I *think* d. So probably between 1419d and 150


    Yes it does unfreeze, then it's working for few seconds, then freezes again etc etc etc

  • 1) Modality is stored is at the series level. So that explains I think. You may need to fiter the query response with QueryResultConverter0 to throw out eg. non-CT. Can you share the types of queries it makes?


    2) Getting the retry to work may be hard though. Try calling defer() if things fail.


    3) What would a tag editor look like:


    select tag editor on image

    show:

    tag value changed y/n

    tag value changed y/n

    tag value changed y/n


    if one or more tags changed apply to: patient/study/series/image


    Sure you can code it in lua! (https://metacpan.org/pod/IUP::Matrix)


    4) Will look into it.


    Marcel

  • 1)

    99% of queries from this station will be sth like this:

    studydate==today, everything_else==any


    All I want to do is to force the modality filter on it, so in short I want it to become:

    studydate==today, modality=CT, everything_else==any


    I see QueryResultConverter0 is iterating thru all the results so (like you said) it would be enough to throw out all non-CT results... but how? How can I access the result modality (cause Data.Modality and StudyModality is still nil)? and How can I 'skip' this particular result if modality != CT


    4)

    No it doesn't. Logging to file makes the problem go away so I guess it's a socket-related problem like you suspected.

  • Hello again


    ad 1)

    After some experimenting I actually got it working with the QueryConverter (not QueryResultConverter!)


    in dicom.ini I have this:

    Code
    [Lua]
    QueryConverter0 = dofile('queryFilter.lua')


    and in the queryFilter.lua I have this:



    And it's actually working as intended. Now, no matter what modality was in the query, the client will get only CTs as a result. It may ask for MR but will always get CT in return - exactly what I wanted.


    One thing I don't understand is why Data:SetVR(0x0008, 0x0061,"CT") is working while Data.Modality='CT' nor Data.StudyModality='CT' nor Data.ModalitiesInStudy='CT' is not working. I guess none of those 'user-friendly' field names are correct but I have no idea cause I can't find any list of those.


    ad 4)

    I'm unable to run this exe. It throws 2 access violation errors right away even if 'run as admin'

  • OK... this is embarrassing. :oops:

    Data.ModalitiesInStudy='CT' is totally working... no idea what I was doing wrong. I must have misspelled it I guess :( That's what you get for messing with the code late at night.


    so it's even simpler now:

    Now I wonder how would it look like if I wanted lets say 2 modalities.. sth like ("CT" or "MR"). ModalitiesInStudy is defined as 1..n so I guess it should be possible to pass more than one at once. Can I pass a list/table somehow?

    This is completely new to me so I'm just guessing here... but maybe sth like Data.ModalitiesInStudy={'CT','MR'} ?? (<- this is not working, I checked)

    Just curious. Fortunately I need only 1 modality limit per AET.


    As for the errors I'm getting those 2 right at the start. (attached)

  • Hi,


    ModalitiesInStudy uses a backslash, e.g. 'CT\\MR'


    not sure if the query works though.


    I uploaded two copies. Is it the latest that you are testing? It seems to be crashing where I made a fix later.


    Marcel

  • Ok,


    was just checking.


    I think it crashes on when it tries to write dgatesop.lst. And on the refresh timer for the serverstatus display.


    Is it in in a normally installed dicom server folder? That's how I tested it.


    Attached is a debug build, please try if this gives some more information.


    ConquestDICOMServer.zip


    Marcel

  • I think you fixed it. No more freezing.

    I didn't test it *extensively* but in 300 seconds of serverstatus scrolling non-stop (sending images with debug lvl 1 so it was a LOT of text) - 0 freezes. :thumbup:


    While testing I've noticed another thing - the progress bar, nor the text updates are not happening while transferring studies.

    After I click "copy to destination" I get this (attached) and it stays like that forever. It IS WORKING.. just not updating. It should do the "copied X out of Y images", right? Green progress bar is frozen like that too.

    It stopped working around the time I turned off the EnableComputedFields because of some Agfa dicom clients butchering my database with stupid/unnecessary queries about image count so I thought maybe it was related to that...

    ... but I also updated to 1.5.0 pre-release at about the same time... so maybe it's just a bug?

  • Good!.


    The progress bar intends to replace the text updates.


    But it should say finished copying and update the progress bar. There are changes on both ends though. What is your dgate version?


    Marcel

Participate now!

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