image_3D_segmentation.js 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. $(document).ready(function(){
  2. $("#loadingDiv").hide();
  3. var $j = jQuery.noConflict();//为了解决jquery1.11.0包和imgbox必须用的1.3包的冲突
  4. var pagenum=0;
  5. var nowpage=0;
  6. var datanum=0;
  7. var json;
  8. var urls;
  9. var searchname;
  10. var organ="";
  11. var html;
  12. if(window.speechSynthesis !=undefined)
  13. {
  14. window.speechSynthesis.pause();
  15. window.speechSynthesis.cancel();
  16. }
  17. if(sessionStorage!=undefined)
  18. {
  19. if(sessionStorage.getItem("username")!=null)
  20. {
  21. $("#needlogin").remove();
  22. var $span= $("<span>用户名:"+sessionStorage.getItem("username")+"</span>");
  23. $("#needloginparent").append($span);
  24. }
  25. else
  26. {
  27. $("#a_datamanage").attr('href','login.html'); //医学数据管理界面
  28. //$("#a_codemanage").attr('href','login.html');代码管理不需要
  29. $("#a_show").attr('href','login.html');//成果展示
  30. }
  31. }
  32. var recorder;
  33. var audio = document.querySelector('audio');
  34. $("#voice_interaction").click(
  35. function()
  36. {
  37. if(window.speechSynthesis !=undefined)
  38. {
  39. var msg = new SpeechSynthesisUtterance("点击确定后开始说话:");
  40. window.speechSynthesis.speak(msg);
  41. }
  42. alert("点击确定后开始说话");
  43. HZRecorder.get(function (rec) {
  44. recorder = rec;
  45. recorder.start();
  46. });
  47. }
  48. );
  49. $("#voice_recognition").click(
  50. function()
  51. {
  52. recorder.stop();
  53. recorder.upload("https://holer50861.restclient.cn/get_pcm/", function (my_message) {
  54. //alert(my_message);
  55. var my_message_test ="你说的是:"+my_message;
  56. if(window.speechSynthesis !=undefined)
  57. {
  58. var msg = new SpeechSynthesisUtterance(my_message_test);
  59. window.speechSynthesis.speak(msg);
  60. }
  61. var my_flag = confirm(my_message_test);
  62. if(my_message=="三维医学图像分割"&&my_flag)
  63. {
  64. window.location.replace('image_3D_segmentation.html');
  65. }
  66. if(my_message=="文字检索系统"&&my_flag)
  67. {
  68. window.location.replace('show_search_text.html');
  69. }
  70. if(my_message=="图像检索系统"&&my_flag)
  71. {
  72. window.location.replace('show_search_pic.html');
  73. }
  74. if(my_message=="图像切分"&&my_flag)
  75. {
  76. window.location.replace('image_crop.html');
  77. }
  78. if(my_message=="二维医学图像分割"&&my_flag)
  79. {
  80. window.location.replace('Image_binary_segmentation.html');
  81. }
  82. if((my_message=="肝脏"||my_message=="肺部"||my_message=="肿瘤"||my_message=="腹部器官"||my_message=="腹部多器官"||my_message=="头颈部多器官"||my_message=="头颈部器官")&&my_flag)
  83. {
  84. organ = my_message;
  85. if(organ=="肝脏")
  86. {
  87. organ="liver";
  88. }
  89. else if(organ=="肺部")
  90. {
  91. organ="lung";
  92. }
  93. else if(organ=="肿瘤")
  94. {
  95. organ="tumor";
  96. }
  97. else if(organ=="腹部器官")
  98. {
  99. organ="Abdominal_8_organs";
  100. }
  101. else if(organ=="腹部多器官")
  102. {
  103. organ="Abdominal_multiple_organs";
  104. }
  105. else if(organ=="头颈部多器官"||organ=="头颈部器官")
  106. {
  107. organ="Multiple_organs_of_head_and_neck";
  108. }
  109. if(organ=="liver")
  110. {
  111. window.open('ganzang.html');
  112. }
  113. else if(organ=="lung")
  114. {
  115. window.open('fei.html');
  116. }
  117. else if(organ=="tumor")
  118. {
  119. window.open('bingbian.html');
  120. }
  121. else if(organ=="Abdominal_8_organs")
  122. {
  123. //alert("lung ");
  124. window.open('\image_3D_segmentation\\examples\\Abdominal_8_organs.html');
  125. }
  126. else if(organ=="No_section_of_abdominal_8_organs")
  127. {
  128. //alert("tumor ");
  129. window.open('\image_3D_segmentation\\examples\\No_section_of_abdominal_8_organs.html');
  130. }
  131. else if(organ=="Abdominal_multiple_organs")
  132. {
  133. //alert("lung ");
  134. window.open('\image_3D_segmentation\\examples\\Abdominal_multiple_organs.html');
  135. }
  136. else if(organ=="Abdominal_multiple_organ_without_section")
  137. {
  138. //alert("tumor ");
  139. window.open('\image_3D_segmentation\\examples\\Abdominal_multiple_organ_without_section.html');
  140. }
  141. else if(organ=="Multiple_organs_of_head_and_neck")
  142. {
  143. //alert("lung ");
  144. window.open('\image_3D_segmentation\\examples\\Multiple_organs_of_head_and_neck.html');
  145. }
  146. else if(organ=="Multiple_organs_of_head_and_neck_without_section")
  147. {
  148. //alert("tumor ");
  149. window.open('\image_3D_segmentation\\examples\\Multiple_organs_of_head_and_neck_without_section.html');
  150. }
  151. }
  152. else if (my_flag)
  153. {
  154. if(window.speechSynthesis !=undefined)
  155. {
  156. var msg = new SpeechSynthesisUtterance("抱歉,目前影像库中没有该病变影像");
  157. window.speechSynthesis.speak(msg);
  158. }
  159. alert("抱歉,目前影像库中没有该病变影像");
  160. return;
  161. }
  162. });
  163. }
  164. );
  165. $("#findByOrgan").click(
  166. function()
  167. {
  168. organ=$("#select_organ").find("option:selected").text();
  169. //alert(organ);
  170. if(organ=="肝脏")
  171. {
  172. organ="liver";
  173. }
  174. else if(organ=="肺部")
  175. {
  176. organ="lung";
  177. }
  178. else if(organ=="肿瘤")
  179. {
  180. organ="tumor";
  181. }
  182. else if(organ=="腹部8器官")
  183. {
  184. organ="Abdominal_8_organs";
  185. }
  186. else if(organ=="腹部8器官无切片")
  187. {
  188. organ="No_section_of_abdominal_8_organs";
  189. }
  190. else if(organ=="腹部多器官")
  191. {
  192. organ="Abdominal_multiple_organs";
  193. }
  194. else if(organ=="腹部多器官无切片")
  195. {
  196. organ="Abdominal_multiple_organ_without_section";
  197. }
  198. else if(organ=="头颈部多器官")
  199. {
  200. organ="Multiple_organs_of_head_and_neck";
  201. }
  202. else if(organ=="头颈部多器官无切片")
  203. {
  204. organ="Multiple_organs_of_head_and_neck_without_section";
  205. }
  206. if(organ=="liver")
  207. {
  208. //alert("liver ");
  209. window.open('ganzang.html');
  210. }
  211. else if(organ=="lung")
  212. {
  213. //alert("lung ");
  214. window.open('fei.html');
  215. }
  216. else if(organ=="tumor")
  217. {
  218. //alert("tumor ");
  219. window.open('bingbian.html');
  220. }
  221. else if(organ=="Abdominal_8_organs")
  222. {
  223. //alert("lung ");
  224. window.open('\image_3D_segmentation\\examples\\Abdominal_8_organs.html');
  225. }
  226. else if(organ=="No_section_of_abdominal_8_organs")
  227. {
  228. //alert("tumor ");
  229. window.open('\image_3D_segmentation\\examples\\No_section_of_abdominal_8_organs.html');
  230. }
  231. else if(organ=="Abdominal_multiple_organs")
  232. {
  233. //alert("lung ");
  234. window.open('\image_3D_segmentation\\examples\\Abdominal_multiple_organs.html');
  235. }
  236. else if(organ=="Abdominal_multiple_organ_without_section")
  237. {
  238. //alert("tumor ");
  239. window.open('\image_3D_segmentation\\examples\\Abdominal_multiple_organ_without_section.html');
  240. }
  241. else if(organ=="Multiple_organs_of_head_and_neck")
  242. {
  243. //alert("lung ");
  244. window.open('\image_3D_segmentation\\examples\\Multiple_organs_of_head_and_neck.html');
  245. }
  246. else if(organ=="Multiple_organs_of_head_and_neck_without_section")
  247. {
  248. //alert("tumor ");
  249. window.open('\image_3D_segmentation\\examples\\Multiple_organs_of_head_and_neck_without_section.html');
  250. }
  251. }
  252. )
  253. })