You can also look at file metadicom.lua. It shows how to process a dicom object element by element.
Marcel
You can also look at file metadicom.lua. It shows how to process a dicom object element by element.
Marcel
Display MoreHi,
to only get the metadata, read the object
x:Read(patientid..':'..sopistanceuid)
and then clear the pixel data
x.PixelData=nil
To query on number say:
q["00231001"]=""
or q[string]="", where you fill the string with eg 00231001
Marcel
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:
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]])'
function scommand(obj, region, rows, columns, contentType, transferSyntax, anonymize, annotation, bridge,
local lwfq=string.format("%d/%d/%d/%d", windowCenter, windowWidth, tonumber(frameNumber), tonumber(imageQuality))
#140 pass a table e.g. t({a=1, b=2}) function t (a) print (a.a) end
#141 wadorequest prints to stdout itself, so it does not return anything
Marcel
You need to call it directly wthout lua, it may actually return the object.
Marcel
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:
function scommand(obj, region, rows, columns, contentType, transferSyntax, anonymize, annotation, bridge,
local lwfq=string.format("%d/%d/%d/%d", windowCenter, windowWidth, tonumber(frameNumber), tonumber(imageQuality))
In that format it returns the data try servercommand(command , "cgibinary")
Marcel
Hi Marcel,
The response from server command is something as:
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?
d:Script(string.format("save gif size %s frame %s quality %s level %d window %d to %s", rows, frameNumber, imageQuality, windowCenter, windowWidth, tempname))
d:Script(string.format("save gif size %s frame %s quality %s level %d window %d to %s", rows, frameNumber, imageQuality, windowCenter, windowWidth, tempname))
d:Script(string.format("save gif size %s frame %d quality %s level %d window %d to %s", rows, 10000+5, imageQuality, windowCenter, windowWidth, tempname))
Never mind, I solved it as:
d:Script(string.format("save gif size %s frame %s quality %s level %d window %d to %s", rows, frameNumber, imageQuality, windowCenter, windowWidth, tempname))
d:Script(string.format("save gif size %s frame %s quality %s level %d window %d to %s", rows, frameNumber, imageQuality, windowCenter, windowWidth, tempname))
d:Script(string.format("save gif size %s frame %d quality %s level %d window %d to %s", rows, 10000+5, imageQuality, windowCenter, windowWidth, tempname))
Hi,
that works too. Your first response was a binary jpeg image and I think correct.
Marcel
Marcel,
I have sent a PM with qido API(some resources are incompletes) and a cornerstone viewer.
Regards, Luiz
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.
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:
[{"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
[CONQUESTSRV1] Issue Query on Columns: DICOMImages.ImageDate, DICOMImages.ImageTime, DICOMImages.ImageNumbe, DICOMSeries.SeriesInst, DICOMStudies.PatientNam, DICOMStudies.PatientID,DICOMImages.ObjectFile,DICOMImages.DeviceName
#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
Ok,
I can reproduce the issue. It must be a problem with the json parser. I will try to fix it now.
Marcel
Display MoreHi,
fixed a few bugs in the json parser (you are the first actual user!) and an issue serialising empty sequences.
Hope this works allright: dgate.zip
Marcel
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:
Am the result is a jpeg image, but there is no annotations.
function wadocgicommand(obj, lwfq, size, region, contentType, transferSyntax, anonymize, annotation, bridge)
local command=string.format("wadorequest:%s,%s,%s,%s,%s,%s,%s,%s,%s", obj, lwfq, size, region, contentType, transferSyntax, anonymize, annotation, bridge)
Hi,
annotations are not implemented. Sorry about that.
Marcel
Hi,
annotations are not implemented. Sorry about that.
Marcel
All right. Thanks
Don’t have an account yet? Register yourself now and be a part of our community!