{% load static %}
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite + React + TS</title>
  </head>
  <body>
{% with image_url_array_and_count=series.get_image_url_array_and_count %}
{% comment %}     <div id="single-dicom-viewer" class="dicom-viewer" data-images="{{ image_url_array_and_count.0 }}" data-annotations=''>
    </div> {% endcomment %}

    <div id="root" class="dicom-viewer-root" data-images="{{ image_url_array_and_count.0 }}"
      style="width: 1000px; height: 600px; box-sizing: border-box; background: #222;"
    ></div>

{% endwith %}
        <script type="module" src="{% static 'dv3d/index-DCNn6AQH.js' %}" defer="defer" type="module"></script>

<input type="file" id="dicomInput" multiple />
<button onclick="sendToViewer()">Send to Viewer</button>
<button onclick="testLoadWadouriStack()">Test Load wadouri Stack</button>
<script>
function sendToViewer() {
  const files = document.getElementById('dicomInput').files;
  if (window.loadDicomStackFromFiles) {
    window.loadDicomStackFromFiles(files);
  } else {
    alert("Viewer API not ready");
  }
}


function testLoadWadouriStack() {
  const urls = [
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_757_XQQyovo.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_766_8fWI0Qc.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_774_c8IpxUu.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_758_6WKI7ws.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_767_TduVOb8.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_775_7zWneQ0.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_759_BtKzgS5.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_768_RdvtM8K.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_776_LhVY3Ty.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_760_a8CiR4J.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_769_YHyJ1l6.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_777_8IFYJmL.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_761_vyvO1EN.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_770_vQwi4LW.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_778_BwGAMOR.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_762_DhSgQsm.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_771_xifitCl.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_779_LyA1zYn.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_763_aVjff3H.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_772_cDQZtxQ.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_780_qaZqsqg.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_764_dDoeldL.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_773_93Hvedg.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_781_bEx9Owg.dcm",
    "https://www.penracourses.org.uk/media/atlas/dicom/IMG_765_qmd5mYJ.dcm"
  ];
  const wadouriList = urls.map(url => "wadouri:" + url);
  if (window.loadDicomStackFromWadouriList) {
    window.loadDicomStackFromWadouriList(wadouriList);
  } else {
    alert("Viewer API not ready");
  }
}
</script>

  </body>
</html>
