Web server

  • Hi Marcel,


    I need to pass a long list of params(in json format) to a lua function and I´d like to access that params key/values:

    Code
    function wadouri(params)
    // I´d like to access the params details here
    // as params.studyUID,  params.seriesUID .....   
    end

    How could I do that?

  • Hi, Marcel,


    I am trying adapt wado.lua script to get a console output. I get an error:


    *** lua run error ...r\server_iclindoctor/api/dicomapi/queryfunctions.lua:166: bad argument #1 to 'write' (string expected, got nil) in 'dofile([[F:\Programas\vuejs\nuxt-iclindoctor\server_iclindoctor/api/dicomapi/queryfunctions.lua]]);wado([[1.3.46.670589.5.2.10.2156913941.892665384.993397]],[[1.3.46.670589.5.2.10.2156913941.892665339.860724]],[[1.3.46.670589.5.2.10.2156913941.892665339.718742]])'




  • You need to call it directly wthout lua, it may actually return the object.


    Marcel

    Hi, Marcel

    I called directly without lua. But I have no console output.


    The conquest log is:

    Code
    ...
    [CONQUESTSRV1] Server Command := 0030
    [CONQUESTSRV1] Message ID := 0002
    [CONQUESTSRV1] C-Echo
    [CONQUESTSRV1] UPACS THREAD 14: ENDED AT: Sun Jul 31 10:20:40 2022
    [CONQUESTSRV1] UPACS THREAD 14: TOTAL RUNNING TIME: 0 SECONDS
    [CONQUESTSRV1] Locating file:MAG0 86542\1.3.46.670589.30.1.6.1.116520970982.1491318133781.1_0001_000001_16575404210002.dcm



  • Hi Marcel,


    The response from server command is something as:


    Code
    Content-type: image/jpeg
    Access-Control-Allow-Origin:*
    ÿØÿà►JFIF☺☺☺☺ÿÛC☻☺☺☺☺☺☻☺☺☺☻☻☻☻☻♦♥☻☻☻☻♣♦♦♥♦♠♣♠♠♠♣♠♠♠ ♠ ♠♂
    ♂♀♂
    ÿÛC☺☻☻☻☻☻☻♣♥♥♣
    ÿÀ☺@☺@♥☺"☻◄☺♥◄☺ÿÄ▼☺♣☺☺☺☺☺☺☺☻♥♦♣♠
    ♂ÿĵ►☻☺♥♥☻♦♥♣♣♦♦☺}☺☻♥♦◄♣↕!1A♠‼Qa"q¶2#B±Á§RÑð$3br
    ▬↨↑↓→%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz

    So, I was taking a wrong way.

    I change the code to the next.

    I still get no valid image response. Could you help on it?

  • Never mind, I solved it as:

  • Hi, Marcel


    In the next command, what is the format to size params?

    Does it accept differents formats?

    I have seen some places with size calculated as size=rows/cols and others with size=N where N is a single integer.


    Code
    x:Script('save '..ographic..' level '..math.floor(c)..' window '..(math.ceil(w/2))..' size '..osize..' frame '..oframe..' to '..outfile)
  • Hi, Marcel

    Why SOPInstanceUID is not appearing into results with this query?

    And if I add "StudyInstanceUID' It doesn´t appeas as well.


    It seems the line code "DicomObject:new(params)" at "function images(server,params)" is getting ridding of some params attribute passed to the function.


    I have tried a workaround using "Copy" to preserve parameters passed to the function, but no look.


    The results sample is:

    Code
    [{"TransferSyntaxUID":"1.2.840.10008.1.2","ContentDate":"20161210","ConquestImageTime":"185904","QueryRetrieveLevel":"IMAGE","PatientName":"paciente009","PatientID":"86557","SeriesInstanceUID":"1.3.46.670589.30.1.6.1.116520970982.1481396381781.1","InstanceNumber":"1 ","ConquestObjectFile":"86557\\1.3.46.670589.30.1.6.1.116520970982.1481396381781.1_0001_000001_16593095180000.dcm","ConquestDevice":"MAG0"},{"TransferSyntaxUID":"1.2.840.10008.1.2","ContentDate":"20161210","ConquestImageTime":"185927","QueryRetrieveLevel":"IMAGE","PatientName":"paciente009","PatientID":"86557","SeriesInstanceUID":"1.3.46.670589.30.1.6.1.116520970982.1481396383125.1","InstanceNumber":"1 ","ConquestObjectFile":"86557\\1.3.46.670589.30.1.6.1.116520970982.1481396383125.1_0002_000001_16593095180001.dcm","ConquestDevice":"MAG0"},{"TransferSyntaxUID":"1.2.840.10008.1.2","ContentDate":"20170428","ConquestImageTime":"220621","QueryRetrieveLevel":"IMAGE","PatientName":"paciente009","PatientID":"86557","SeriesInstanceUID":"1.3.46.670589.30.1.6.1.116520970982.1493417300375.1","InstanceNumber":"1 ","ConquestObjectFile":"86557\\1.3.46.670589.30.1.6.1.116520970982.1493417300375.1_0001_000001_16593095180002.dcm","ConquestDevice":"MAG0"},{"TransferSyntaxUID":"1.2.840.10008.1.2","ContentDate":"20170428","ConquestImageTime":"220730","QueryRetrieveLevel":"IMAGE","PatientName":"paciente009","PatientID":"86557","SeriesInstanceUID":"1.3.46.670589.30.1.6.1.116520970982.1493417301687.1","InstanceNumber":"1 ","ConquestObjectFile":"86557\\1.3.46.670589.30.1.6.1.116520970982.1493417301687.1_0002_000001_16593095190003.dcm","ConquestDevice":"MAG0"},{"TransferSyntaxUID":"1.2.840.10008.1.2","ContentDate":"20170428","ConquestImageTime":"220747","QueryRetrieveLevel":"IMAGE","PatientName":"paciente009","PatientID":"86557","SeriesInstanceUID":"1.3.46.670589.30.1.6.1.116520970982.1493417302625.1","InstanceNumber":"1 ","ConquestObjectFile":"86557\\1.3.46.670589.30.1.6.1.116520970982.1493417302625.1_0003_000001_16593095190004.dcm","ConquestDevice":"MAG0"}]


    My params is:



    Conquest log

    Code
    [CONQUESTSRV1] (StudyRootQuery) search level: IMAGE
    [CONQUESTSRV1] Query On Image
    [CONQUESTSRV1] Issue Query on Columns: DICOMImages.ImageDate, DICOMImages.ImageTime, DICOMImages.ImageNumbe, DICOMSeries.SeriesInst, DICOMStudies.PatientNam, DICOMStudies.PatientID,DICOMImages.ObjectFile,DICOMImages.DeviceName
    [CONQUESTSRV1] Values: DICOMStudies.PatientID = '86557' and DICOMSeries.StudyInsta = DICOMStudies.StudyInsta and DICOMImages.SeriesInst = DICOMSeries.SeriesInst
    [CONQUESTSRV1] Tables: DICOMImages, DICOMSeries, DICOMStudies
    [CONQUESTSRV1] Records = 5
    [CONQUESTSRV1] C-Find (StudyRoot) located 5 records
    [CONQUESTSRV1] UPACS THREAD 26: ENDED AT: Tue Aug 02 12:14:13 2022
    [CONQUESTSRV1] UPACS THREAD 26: TOTAL RUNNING TIME: 0 SECONDS
  • #145: conquest only has a downsize with a single parameter, it will downsize such that the largest dimension is <size. WADO has two parameters, but these are not trully implemented.


    #146: I do not know, can you print a.SOPInstanceUID in function images and see if it is passed?


    Marcel

  • Hi Marcel


    I printed params before "a=DicomObject:new(params)" in the function images. The parameters are ok and passed.

    Here is the params printed:

    {"ConquestDevice":"","ConquestObjectFile":"","ConquestImageDate":"","ConquestImageTime":"","PatientID":"66971","PatientName":"","SeriesInstanceUID":"","InstanceNumber":"","ImageDate":"","ImageTime":"","StudyInstanceUID":"","SOPInstanceUID":"","NumberOfFrames":""}


    the problem is in this line: "a=DicomObject:new(params)".

    I think this line is taking away some json parameters as SOPInstanceUID.


    function images(server,params)

    local ae = server or servercommand('get_param:MyACRNema')

    io.write(params) --test

    a=DicomObject:new(params)

    b=remotequery(ae, 'IMAGE', a);

    io.write(b or '')

    end;

  • Hi, Marcel

    Thank you. It´s working.

    Other question, please.

    I´m playing with wadorequest as well. I´d like to know how annotation param works.


    I tested with:

    Code
    localhost:3002/api/dicom/wadocgi?requestType=WADO&contentType=image/jpeg&seriesUID=1.3.46.670589.5.2.10.2156913941.892665339.860724&studyUID=1.3.46.670589.5.2.10.2156913941.892665384.993397&objectUID=1.3.46.670589.5.2.10.2156913941.892665339.718742&annotation=patient

    Am the result is a jpeg image, but there is no annotations.




Participate now!

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