Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration request with conquest web viewer #15

Closed
marcelvanherk opened this issue Dec 15, 2012 · 5 comments
Closed

Integration request with conquest web viewer #15

marcelvanherk opened this issue Dec 15, 2012 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@marcelvanherk
Copy link

Hi,

I write and maintain the conquest DICOM server. It should be trivial to create a Conquest web viewer based on your work. The link below shows how I load ImageJA as viewer as an example. Could we together have a try to integrate yours?

http://forum.image-systems.biz/viewtopic.php?f=33&t=1599#p10071

Marcel

@marcelvanherk
Copy link
Author

Here is the lua code for a barebones WADO viewer as it runs from the conquest web server environmentr. It may be very easy to adjust to dwv.

-- 20120302     mvh     Created

function getstudyuid()
  local a,b,s;
  if CGI('source')=='(local)' then
    s = servercommand('get_param:MyACRNema')
  else
    s = CGI('source')
  end
  b=newdicomobject();
  b.PatientID = CGI('patientidmatch');
  b.SeriesInstanceUID = CGI('seriesUID');
  b.StudyInstanceUID = '';
  b.Modality = '';
  a=dicomquery(s, 'SERIES', b);
  return a[0].StudyInstanceUID, a[0].Modality
end

function queryimages()
  local images,imaget,b,s;
  if CGI('source')=='(local)' then
    s = servercommand('get_param:MyACRNema')
  else
    s = CGI('source')
  end

  b=newdicomobject();
  b.PatientID        = CGI('patientidmatch')
  b.SeriesInstanceUID= CGI('seriesUID');
  b.SOPInstanceUID   = '';

  images=dicomquery(s, 'IMAGE', b);

  imaget={}
  for k=0,#images-1 do
    imaget[k+1]={}
    imaget[k+1].SOPInstanceUID=images[k].SOPInstanceUID
  end
  table.sort(imaget, function(a,b) return a.SOPInstanceUID<b.SOPInstanceUID end)

  return imaget
end

HTML('Content-type: text/html\n\n');

local studyuid, modality = getstudyuid()
local size = 256
if modality=='RTSTRUCT' or modality=='RTPLAN' then size = 0 end

print([[
<HEAD><TITLE>Version ]]..version..[[ WADO viewer</TITLE></HEAD>
<BODY BGCOLOR='CFDFCF'>
<H3>Conquest ]]..version..[[ WADO viewer</H3>

<SCRIPT language=JavaScript>
function load()
{
]])

if CGI('source')=='(local)' then
    bridge=[[]]
else
    bridge=[[&bridge=]]..CGI('source')
end

if string.sub(modality, 1, 2)~='RT' then
print([[
  document.images[0].src = ']]..script_name..[[?requestType=WADO&contentType=image/gif'+
                           ']]..bridge..[[' +
                           '&studyUID=]]..studyuid..[[' +
                           '&seriesUID=]]..CGI('seriesUID')..[[' +
                           '&objectUID=' + document.forms[0].slice.value;
]])
end

if string.sub(modality, 1, 2)=='RT' then
print([[
  document.getElementById("myframe").src   = ']]..script_name..[[?requestType=WADO&contentType=text/plain'+
                           ]]..bridge..[[ +
                           '&studyUID=]]..studyuid..[[' +
                           '&seriesUID=]]..CGI('seriesUID')..[[' +
                           '&objectUID=' + document.forms[0].slice.value;
]])
end

print([[
}

function PopupCenter(pageURL, title,w,h)
{ var left = (screen.width/2)-(w/2);
  var top = (screen.height/2)-(h/2);
  var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}

function nextslice()
{ if (document.forms[0].slice.selectedIndex == document.forms[0].slice.length-1) document.forms[0].slice.selectedIndex = 0; else document.forms[0].slice.selectedIndex = document.forms[0].slice.selectedIndex + 1; load()
}
</SCRIPT>
<IMG SRC=loading.jpg BORDER=0 HEIGHT=]].. size ..[[>
]])

if string.sub(modality, 1, 2)=='RT' then
print([[
<iframe id="myframe" BORDER=0 HEIGHT=256>
<p>Your browser does not support iframes.</p>
</iframe>
]])
end

print([[
<H3>]].. modality ..[[</H3>
<FORM>
Slice:
  <select name=slice onchange=load()>
]]
)

local i, images;
images = queryimages();
for i=1, #images do
  print('<option value='..images[i].SOPInstanceUID..'>'..i..'</option>')
end

print([[
  </select>
  <INPUT TYPE=BUTTON VALUE='>' onclick=nextslice() >
</FORM>
]])

print([[<a href=# onclick="javascript:PopupCenter(']]..script_name..[[?requestType=WADO]]..bridge..[[&contentType=text/plain&studyUID=]]..studyuid..[[&seriesUID=]]..CGI('seriesUID')..[[&objectUID=' + document.forms[0].slice.value + '&dum=.txt', 'hoi', 500, 500)">[original header]</a>

     ]])

print([[<a href=# onclick="javascript:PopupCenter(']]..script_name..[[?requestType=WADO]]..bridge..[[&contentType=text/plain&anonymize=yes&studyUID=]]..studyuid..[[&seriesUID=]]..CGI('seriesUID')..[[&objectUID=' + document.forms[0].slice.value + '&dum=.txt', 'hoi', 500, 500)">[anonymized header]</a>

     ]])

print([[
<SCRIPT language=JavaScript>
  document.onload=document.forms[0].slice.selectedIndex= document.forms[0].slice.length/2;load()
</SCRIPT>
</BODY>
]])

@ivmartel
Copy link
Owner

Thanks for your interest, I'll give it a try as soon as I can in this busy period!

@ivmartel
Copy link
Owner

I put the dwv.lua script in the resources folder. It contains explanations on how to use it. As does the wiki page Pacs support.

@marcelvanherk
Copy link
Author

Hi Yves,

I posted a small update on the conquest forum to allow browsing the slices.

Regards,

Marcel


Van: ivmartel [notifications@github.com]
Verzonden: dinsdag 12 maart 2013 23:32
Aan: ivmartel/dwv
CC: Marcel van Herk
Onderwerp: Re: [dwv] Integration request with conquest web viewer (#15)

I put the dwv.luahttps://github.com/ivmartel/dwv/blob/master/resources/dwv.lua script in the resources folder. It contains explanations on how to use it. As does the wiki page Pacs supporthttps://github.com/ivmartel/dwv/wiki/Pacs-support.


Reply to this email directly or view it on GitHubhttps://github.com//issues/15#issuecomment-14810389.

@ivmartel
Copy link
Owner

Here is a link to the conquest forum thread: http://forum.image-systems.biz/viewtopic.php?f=33&t=17196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants