您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

index.php 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?php
  2. require_once '../../App/bootstrap.php';
  3. $attachId = isset($_GET['attach_id']) ? $_GET['attach_id'] : 0;
  4. if (!$user->isLogged()) {
  5. //exit(0);
  6. }
  7. ?>
  8. <!DOCTYPE html>
  9. <html lang="it">
  10. <head>
  11. <meta charset="UTF-8">
  12. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  13. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  14. <link rel="stylesheet" href="/css/font-awesome.min.css">
  15. <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
  16. <title>Dicom</title>
  17. <style>
  18. html, body {width: 100%; height:100%; background-color: black; display:flex; justify-content:center;}
  19. #dicomImage {
  20. width: 100%;
  21. height: 600px;
  22. position: relative;
  23. }
  24. #toolBar{
  25. position: fixed;
  26. background-color: white;
  27. color:black;
  28. width:100%;
  29. height: 50px;
  30. z-index:10000;
  31. padding:10px;
  32. }
  33. </style>
  34. </head>
  35. <body>
  36. <div id="toolBar">
  37. <button type="button" class="btn btn-outline-dark btn-sm" id="activateZoom"><i class="fa fa-search-plus" aria-hidden="true"></i></button>
  38. <button type="button" class="btn btn-outline-dark btn-sm" id="activatePan">Small button</button>
  39. <button type="button" class="btn btn-outline-dark btn-sm" id="activateWwwc"><i class="fa fa-adjust" aria-hidden="true"></i></button>
  40. <button type="button" class="btn btn-outline-dark btn-sm" id="activateLength"><i class="fa fa-arrows-h" aria-hidden="true"></i></button>
  41. </div>
  42. <main>
  43. <section>
  44. <div id="dicomImage">
  45. </div>
  46. </section>
  47. </main>
  48. <script src="https://unpkg.com/cornerstone-core@2.3.0/dist/cornerstone.js"></script>
  49. <script src="https://unpkg.com/dicom-parser@1.8.4/dist/dicomParser.js"></script>
  50. <script src="https://unpkg.com/cornerstone-wado-image-loader@3.1.0/dist/cornerstoneWADOImageLoader.js"></script>
  51. <script src="https://unpkg.com/cornerstone-tools@4.15.0/dist/cornerstoneTools.js"></script>
  52. <script>
  53. document.addEventListener('DOMContentLoaded', function () {
  54. // Abilita il caricamento delle immagini WADO-URI
  55. cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
  56. // Configura il caricatore WADO-URI
  57. cornerstoneWADOImageLoader.configure({
  58. beforeSend: function (xhr) {
  59. // Se necessarie, puoi aggiungere intestazioni personalizzate
  60. }
  61. });
  62. // Inizializza Cornerstone per l'elemento
  63. const element = document.getElementById('dicomImage');
  64. cornerstone.enable(element);
  65. // Carica l'immagine DICOM da un URL
  66. const dicomUrl = '/dicom/dicom.php?attach_id=<?php echo $attachId ?>'; // Aggiorna questo con il tuo percorso
  67. const imageId = 'wadouri:' + dicomUrl;
  68. // Carica e visualizza l'immagine
  69. cornerstone.loadImage(imageId).then(function(image) {
  70. cornerstone.displayImage(element, image);
  71. }).catch(function(err) {
  72. console.error('Errore durante il caricamento dell\'immagine DICOM:', err);
  73. });
  74. // Abilita strumenti di Cornerstone Tools
  75. cornerstoneTools.init();
  76. const ZoomTool = cornerstoneTools.ZoomMouseWheelTool;
  77. const PanTool = cornerstoneTools.PanTool;
  78. const WwwcTool = cornerstoneTools.WwwcTool; // Window/Level (Contrasto)
  79. const LengthTool = cornerstoneTools.LengthTool; // Misurazioni lunghezza
  80. // Aggiungi i tool all'elemento DOM
  81. cornerstoneTools.addTool(ZoomTool);
  82. cornerstoneTools.addTool(PanTool);
  83. cornerstoneTools.addTool(WwwcTool);
  84. cornerstoneTools.addTool(LengthTool);
  85. // Attiva i tool con pulsanti
  86. document.getElementById('activateZoom').addEventListener('click', function() {
  87. cornerstoneTools.setToolActive('ZoomMouseWheel', { mouseButtonMask: 1 });
  88. });
  89. document.getElementById('activatePan').addEventListener('click', function() {
  90. cornerstoneTools.setToolActive('Pan', { mouseButtonMask: 1 });
  91. });
  92. document.getElementById('activateWwwc').addEventListener('click', function() {
  93. cornerstoneTools.setToolActive('Wwwc', { mouseButtonMask: 1 });
  94. });
  95. document.getElementById('activateLength').addEventListener('click', function() {
  96. cornerstoneTools.setToolActive('Length', { mouseButtonMask: 1 });
  97. });
  98. });
  99. </script>
  100. </body>
  101. </html>