Invoke script when CT received

  • I'm recently interested in setting up a server to do some automated tasks.


    (1) Run plastimatch to generate atlas-based segmentation
    (2) Run IQWorks to generate CT QA report


    The scripting is really powerful.
    So far I am successful getting my script to run for each slice using ImportConverter0.
    Is there any way to run a script after all slices of a CT arrive?
    What do you recommend?


    Thank you,
    Greg

  • Hi Greg,


    Use 1.4.17beta2 and try e.g.,


    importconverter0 = process series after 60 with script.lua %PatientID:%SeriesInstanceUID


    This starts the script once for each series 60 s after receiving first slice. You can do this at series or study level.


    The lua variable command_line gives you the parameters.


    Marcel

  • Thank you Marcel! Looks promising.


    I'm assuming that the 60 second delay is a heuristic to make sure all the slices have arrived. Do you know of any method for achieving a guarantee? For example, dicom workflow?


    -Greg

  • Hi Marcel,


    A little follow-up. I have tested your suggestion, and it seems to be working very well indeed! For example, I can execute a perl script like this:


    ImportConverter0 = process image after 5 by /usr/bin/perl test.pl


    Of course, I next try a lua script using "process by" which has access to conquest database. My testing suggests this is not possible. Am I missing something?


    Thank you,
    Greg

  • Hi Greg,


    lua scripts can indeed access the database using dbquery() and sql() commands, or do dicom queries usifn dicomquery(). See:


    http://forum.image-systems.biz…pic.php?f=33&t=2478#p8564


    for details. You have to pass a command line from the importconverter though to know what to query. The 60 second is based on heuristics, there is no workflow implemented. In practice I use 600 s for real live code to be on the safe side, and 10 s for tests.


    Marcel

Participate now!

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