Mr Marcel,
I found my problem. Thank you. The code was correct. The values were empties and I thought they were wrong.
When I finish my work I I intend post all web server lua scripts as reference to newbies( including me). I will do, If you agree.
I don´t know if you have a files repository on site.
I'm moving faster now after your help, but not always a bed of roses , mainly for a newbie.
Can you help me with the next cases?
1. First Case:
I have SOPInstanceUID and other fields of a image.
With these data, How do I can retrieve the parameter "lw" (level/window) of the image for use in this line:
print("<IMG SRC=dgate%s?%s&mode=slice&slice=%s&size=%s&graphic=%s&lw=%s HEIGHT=%s>", ex, extra, slice, dsize, graphic, lw, size);
I did the next function, but I have always nil on results and I don´t know if the return values would be the correct to use with the code above.
function get_lw(n,siuid)
local b,s,a
s = servercommand('get_param:MyACRNema')
b=newdicomobject();
b.QueryRetrieveLevel='IMAGE'
b['0028,1050']=''
b['0028,1051']=''
b.SOPInstanceUID = siuid
b.ImageNumber = n;
b.PatientName ='';
a=dicomquery(s, 'IMAGE', b);
return a[0]['0028,1050'], a[0]['0028,1051']
end
2. Second Case:
I am also trying getting the header info from image to show in web browse. Searching on files sample and manual, I have tried some options with no success.
I did:
local ss=CGI("slice") -->PatientID:SOPInstanceUID format.
1) readdicom(ss)
print(Data.Dump())
doesn´t work. I can´t put a file parameter to Dunp because I am doing a page web browse
2) b = newdicomobject()
readdicom(b,ss)
print(b:Dump())
doesn´t work
3) s = string.format("dump_header:%s", ss);
print(servercommand(s));
doesn´t work
Regards,
Luiz