Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2024
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.71 KB | None | 0 0
  1. /** @type {AppTypes.Config} */
  2.  
  3. window.config = {
  4. routerBasename: '/',
  5. // whiteLabeling: {},
  6. extensions: [],
  7. modes: [],
  8. customizationService: {},
  9. showStudyList: true,
  10. // some windows systems have issues with more than 3 web workers
  11. maxNumberOfWebWorkers: 3,
  12. // below flag is for performance reasons, but it might not work for all servers
  13. showWarningMessageForCrossOrigin: true,
  14. showCPUFallbackMessage: true,
  15. showLoadingIndicator: true,
  16. experimentalStudyBrowserSort: false,
  17. strictZSpacingForVolumeViewport: true,
  18. groupEnabledModesFirst: true,
  19. maxNumRequests: {
  20. interaction: 100,
  21. thumbnail: 75,
  22. // Prefetch number is dependent on the http protocol. For http 2 or
  23. // above, the number of requests can be go a lot higher.
  24. prefetch: 25,
  25. },
  26. // filterQueryParam: false,
  27. defaultDataSourceName: 'dcm4chee',
  28. /* Dynamic config allows user to pass "configUrl" query string this allows to load config without recompiling application. The regex will ensure valid configuration source */
  29. // dangerouslyUseDynamicConfig: {
  30. // enabled: true,
  31. // // regex will ensure valid configuration source and default is /.*/ which matches any character. To use this, setup your own regex to choose a specific source of configuration only.
  32. // // Example 1, to allow numbers and letters in an absolute or sub-path only.
  33. // // regex: /(0-9A-Za-z.]+)(\/[0-9A-Za-z.]+)*/
  34. // // Example 2, to restricts to either hosptial.com or othersite.com.
  35. // // regex: /(https:\/\/hospital.com(\/[0-9A-Za-z.]+)*)|(https:\/\/othersite.com(\/[0-9A-Za-z.]+)*)/
  36. // regex: /.*/,
  37. // },
  38. dataSources: [
  39. {
  40. namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
  41. sourceName: 'dicomweb',
  42. configuration: {
  43. friendlyName: 'AWS S3 Static wado server',
  44. name: 'aws',
  45. wadoUriRoot: 'https://d14fa38qiwhyfd.cloudfront.net/dicomweb',
  46. qidoRoot: 'https://d14fa38qiwhyfd.cloudfront.net/dicomweb',
  47. wadoRoot: 'https://d14fa38qiwhyfd.cloudfront.net/dicomweb',
  48. qidoSupportsIncludeField: false,
  49. imageRendering: 'wadors',
  50. thumbnailRendering: 'wadors',
  51. enableStudyLazyLoad: true,
  52. supportsFuzzyMatching: false,
  53. supportsWildcard: true,
  54. staticWado: true,
  55. singlepart: 'bulkdata,video',
  56. // whether the data source should use retrieveBulkData to grab metadata,
  57. // and in case of relative path, what would it be relative to, options
  58. // are in the series level or study level (some servers like series some study)
  59. bulkDataURI: {
  60. enabled: true,
  61. relativeResolution: 'studies',
  62. transform: url => url.replace('/pixeldata.mp4', '/rendered'),
  63. },
  64. omitQuotationForMultipartRequest: true,
  65. },
  66. },
  67.  
  68. {
  69. namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
  70. sourceName: 'ohif2',
  71. configuration: {
  72. friendlyName: 'AWS S3 Static wado secondary server',
  73. name: 'aws',
  74. wadoUriRoot: 'https://dd14fa38qiwhyfd.cloudfront.net/dicomweb',
  75. qidoRoot: 'https://dd14fa38qiwhyfd.cloudfront.net/dicomweb',
  76. wadoRoot: 'https://dd14fa38qiwhyfd.cloudfront.net/dicomweb',
  77. qidoSupportsIncludeField: false,
  78. supportsReject: false,
  79. imageRendering: 'wadors',
  80. thumbnailRendering: 'wadors',
  81. enableStudyLazyLoad: true,
  82. supportsFuzzyMatching: false,
  83. supportsWildcard: true,
  84. staticWado: true,
  85. singlepart: 'bulkdata,video',
  86. // whether the data source should use retrieveBulkData to grab metadata,
  87. // and in case of relative path, what would it be relative to, options
  88. // are in the series level or study level (some servers like series some study)
  89. bulkDataURI: {
  90. enabled: true,
  91. relativeResolution: 'studies',
  92. },
  93. omitQuotationForMultipartRequest: true,
  94. },
  95. },
  96. {
  97. namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
  98. sourceName: 'ohif3',
  99. configuration: {
  100. friendlyName: 'AWS S3 Static wado secondary server',
  101. name: 'aws',
  102. wadoUriRoot: 'https://d3t6nz73ql33tx.cloudfront.net/dicomweb',
  103. qidoRoot: 'https://d3t6nz73ql33tx.cloudfront.net/dicomweb',
  104. wadoRoot: 'https://d3t6nz73ql33tx.cloudfront.net/dicomweb',
  105. qidoSupportsIncludeField: false,
  106. supportsReject: false,
  107. imageRendering: 'wadors',
  108. thumbnailRendering: 'wadors',
  109. enableStudyLazyLoad: true,
  110. supportsFuzzyMatching: false,
  111. supportsWildcard: true,
  112. staticWado: true,
  113. singlepart: 'bulkdata,video',
  114. // whether the data source should use retrieveBulkData to grab metadata,
  115. // and in case of relative path, what would it be relative to, options
  116. // are in the series level or study level (some servers like series some study)
  117. bulkDataURI: {
  118. enabled: true,
  119. relativeResolution: 'studies',
  120. },
  121. omitQuotationForMultipartRequest: true,
  122. },
  123. },
  124.  
  125. {
  126. namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
  127. sourceName: 'dcm4chee',
  128. configuration: {
  129. friendlyName: 'Static WADO Local Data',
  130. name: 'DCM4CHEE',
  131. qidoRoot: 'http://radio-demo.galmi.org:8080/dcm4chee-arc/aets/DCM4CHEE/rs',
  132. wadoRoot: 'http://radio-demo.galmi.org:8080/dcm4chee-arc/aets/DCM4CHEE/rs',
  133. qidoSupportsIncludeField: false,
  134. supportsReject: true,
  135. supportsStow: true,
  136. imageRendering: 'wadors',
  137. thumbnailRendering: 'wadors',
  138. enableStudyLazyLoad: true,
  139. supportsFuzzyMatching: false,
  140. supportsWildcard: true,
  141. staticWado: true,
  142. singlepart: 'video',
  143. bulkDataURI: {
  144. enabled: true,
  145. relativeResolution: 'studies',
  146. },
  147. },
  148. },
  149.  
  150. {
  151. namespace: '@ohif/extension-default.dataSourcesModule.dicomwebproxy',
  152. sourceName: 'dicomwebproxy',
  153. configuration: {
  154. friendlyName: 'dicomweb delegating proxy',
  155. name: 'dicomwebproxy',
  156. },
  157. },
  158. {
  159. namespace: '@ohif/extension-default.dataSourcesModule.dicomjson',
  160. sourceName: 'dicomjson',
  161. configuration: {
  162. friendlyName: 'dicom json',
  163. name: 'json',
  164. },
  165. },
  166. {
  167. namespace: '@ohif/extension-default.dataSourcesModule.dicomlocal',
  168. sourceName: 'dicomlocal',
  169. configuration: {
  170. friendlyName: 'dicom local',
  171. },
  172. },
  173. ],
  174. httpErrorHandler: error => {
  175. // This is 429 when rejected from the public idc sandbox too often.
  176. console.warn(error.status);
  177.  
  178. // Could use services manager here to bring up a dialog/modal if needed.
  179. console.warn('test, navigate to https://ohif.org/');
  180. },
  181. // whiteLabeling: {
  182. // /* Optional: Should return a React component to be rendered in the "Logo" section of the application's Top Navigation bar */
  183. // createLogoComponentFn: function (React) {
  184. // return React.createElement(
  185. // 'a',
  186. // {
  187. // target: '_self',
  188. // rel: 'noopener noreferrer',
  189. // className: 'text-purple-600 line-through',
  190. // href: '/',
  191. // },
  192. // React.createElement('img',
  193. // {
  194. // src: './assets/customLogo.svg',
  195. // className: 'w-8 h-8',
  196. // }
  197. // ))
  198. // },
  199. // },
  200. hotkeys: [
  201. {
  202. commandName: 'incrementActiveViewport',
  203. label: 'Next Viewport',
  204. keys: ['right'],
  205. },
  206. {
  207. commandName: 'decrementActiveViewport',
  208. label: 'Previous Viewport',
  209. keys: ['left'],
  210. },
  211. { commandName: 'rotateViewportCW', label: 'Rotate Right', keys: ['r'] },
  212. { commandName: 'rotateViewportCCW', label: 'Rotate Left', keys: ['l'] },
  213. { commandName: 'invertViewport', label: 'Invert', keys: ['i'] },
  214. {
  215. commandName: 'flipViewportHorizontal',
  216. label: 'Flip Horizontally',
  217. keys: ['h'],
  218. },
  219. {
  220. commandName: 'flipViewportVertical',
  221. label: 'Flip Vertically',
  222. keys: ['v'],
  223. },
  224. { commandName: 'scaleUpViewport', label: 'Zoom In', keys: ['+'] },
  225. { commandName: 'scaleDownViewport', label: 'Zoom Out', keys: ['-'] },
  226. { commandName: 'fitViewportToWindow', label: 'Zoom to Fit', keys: ['='] },
  227. { commandName: 'resetViewport', label: 'Reset', keys: ['space'] },
  228. { commandName: 'nextImage', label: 'Next Image', keys: ['down'] },
  229. { commandName: 'previousImage', label: 'Previous Image', keys: ['up'] },
  230. // {
  231. // commandName: 'previousViewportDisplaySet',
  232. // label: 'Previous Series',
  233. // keys: ['pagedown'],
  234. // },
  235. // {
  236. // commandName: 'nextViewportDisplaySet',
  237. // label: 'Next Series',
  238. // keys: ['pageup'],
  239. // },
  240. {
  241. commandName: 'setToolActive',
  242. commandOptions: { toolName: 'Zoom' },
  243. label: 'Zoom',
  244. keys: ['z'],
  245. },
  246. // ~ Window level presets
  247. {
  248. commandName: 'windowLevelPreset1',
  249. label: 'W/L Preset 1',
  250. keys: ['1'],
  251. },
  252. {
  253. commandName: 'windowLevelPreset2',
  254. label: 'W/L Preset 2',
  255. keys: ['2'],
  256. },
  257. {
  258. commandName: 'windowLevelPreset3',
  259. label: 'W/L Preset 3',
  260. keys: ['3'],
  261. },
  262. {
  263. commandName: 'windowLevelPreset4',
  264. label: 'W/L Preset 4',
  265. keys: ['4'],
  266. },
  267. {
  268. commandName: 'windowLevelPreset5',
  269. label: 'W/L Preset 5',
  270. keys: ['5'],
  271. },
  272. {
  273. commandName: 'windowLevelPreset6',
  274. label: 'W/L Preset 6',
  275. keys: ['6'],
  276. },
  277. {
  278. commandName: 'windowLevelPreset7',
  279. label: 'W/L Preset 7',
  280. keys: ['7'],
  281. },
  282. {
  283. commandName: 'windowLevelPreset8',
  284. label: 'W/L Preset 8',
  285. keys: ['8'],
  286. },
  287. {
  288. commandName: 'windowLevelPreset9',
  289. label: 'W/L Preset 9',
  290. keys: ['9'],
  291. },
  292. ],
  293. tours: [
  294. {
  295. id: 'basicViewerTour',
  296. route: '/viewer',
  297. steps: [
  298. {
  299. id: 'scroll',
  300. title: 'Scrolling Through Images',
  301. text: 'You can scroll through the images using the mouse wheel or scrollbar.',
  302. attachTo: {
  303. element: '.viewport-element',
  304. on: 'top',
  305. },
  306. advanceOn: {
  307. selector: '.cornerstone-viewport-element',
  308. event: 'CORNERSTONE_TOOLS_MOUSE_WHEEL',
  309. },
  310. beforeShowPromise: () => waitForElement('.viewport-element'),
  311. },
  312. {
  313. id: 'zoom',
  314. title: 'Zooming In and Out',
  315. text: 'You can zoom the images using the right click.',
  316. attachTo: {
  317. element: '.viewport-element',
  318. on: 'left',
  319. },
  320. advanceOn: {
  321. selector: '.cornerstone-viewport-element',
  322. event: 'CORNERSTONE_TOOLS_MOUSE_UP',
  323. },
  324. beforeShowPromise: () => waitForElement('.viewport-element'),
  325. },
  326. {
  327. id: 'pan',
  328. title: 'Panning the Image',
  329. text: 'You can pan the images using the middle click.',
  330. attachTo: {
  331. element: '.viewport-element',
  332. on: 'top',
  333. },
  334. advanceOn: {
  335. selector: '.cornerstone-viewport-element',
  336. event: 'CORNERSTONE_TOOLS_MOUSE_UP',
  337. },
  338. beforeShowPromise: () => waitForElement('.viewport-element'),
  339. },
  340. {
  341. id: 'windowing',
  342. title: 'Adjusting Window Level',
  343. text: 'You can modify the window level using the left click.',
  344. attachTo: {
  345. element: '.viewport-element',
  346. on: 'left',
  347. },
  348. advanceOn: {
  349. selector: '.cornerstone-viewport-element',
  350. event: 'CORNERSTONE_TOOLS_MOUSE_UP',
  351. },
  352. beforeShowPromise: () => waitForElement('.viewport-element'),
  353. },
  354. {
  355. id: 'length',
  356. title: 'Using the Measurement Tools',
  357. text: 'You can measure the length of a region using the Length tool.',
  358. attachTo: {
  359. element: '[data-cy="MeasurementTools-split-button-primary"]',
  360. on: 'bottom',
  361. },
  362. advanceOn: {
  363. selector: '[data-cy="MeasurementTools-split-button-primary"]',
  364. event: 'click',
  365. },
  366. beforeShowPromise: () =>
  367. waitForElement('[data-cy="MeasurementTools-split-button-primary]'),
  368. },
  369. {
  370. id: 'drawAnnotation',
  371. title: 'Drawing Length Annotations',
  372. text: 'Use the length tool on the viewport to measure the length of a region.',
  373. attachTo: {
  374. element: '.viewport-element',
  375. on: 'right',
  376. },
  377. advanceOn: {
  378. selector: 'body',
  379. event: 'event::measurement_added',
  380. },
  381. beforeShowPromise: () => waitForElement('.viewport-element'),
  382. },
  383. {
  384. id: 'trackMeasurement',
  385. title: 'Tracking Measurements in the Panel',
  386. text: 'Click yes to track the measurements in the measurement panel.',
  387. attachTo: {
  388. element: '[data-cy="prompt-begin-tracking-yes-btn"]',
  389. on: 'bottom',
  390. },
  391. advanceOn: {
  392. selector: '[data-cy="prompt-begin-tracking-yes-btn"]',
  393. event: 'click',
  394. },
  395. beforeShowPromise: () => waitForElement('[data-cy="prompt-begin-tracking-yes-btn"]'),
  396. },
  397. {
  398. id: 'openMeasurementPanel',
  399. title: 'Opening the Measurements Panel',
  400. text: 'Click the measurements button to open the measurements panel.',
  401. attachTo: {
  402. element: '#trackedMeasurements-btn',
  403. on: 'left-start',
  404. },
  405. advanceOn: {
  406. selector: '#trackedMeasurements-btn',
  407. event: 'click',
  408. },
  409. beforeShowPromise: () => waitForElement('#trackedMeasurements-btn'),
  410. },
  411. {
  412. id: 'scrollAwayFromMeasurement',
  413. title: 'Scrolling Away from a Measurement',
  414. text: 'Scroll the images using the mouse wheel away from the measurement.',
  415. attachTo: {
  416. element: '.viewport-element',
  417. on: 'left',
  418. },
  419. advanceOn: {
  420. selector: '.cornerstone-viewport-element',
  421. event: 'CORNERSTONE_TOOLS_MOUSE_WHEEL',
  422. },
  423. beforeShowPromise: () => waitForElement('.viewport-element'),
  424. },
  425. {
  426. id: 'jumpToMeasurement',
  427. title: 'Jumping to Measurements in the Panel',
  428. text: 'Click the measurement in the measurement panel to jump to it.',
  429. attachTo: {
  430. element: '[data-cy="data-row"]',
  431. on: 'left-start',
  432. },
  433. advanceOn: {
  434. selector: '[data-cy="data-row"]',
  435. event: 'click',
  436. },
  437. beforeShowPromise: () => waitForElement('[data-cy="data-row"]'),
  438. },
  439. {
  440. id: 'changeLayout',
  441. title: 'Changing Layout',
  442. text: 'You can change the layout of the viewer using the layout button.',
  443. attachTo: {
  444. element: '[data-cy="Layout"]',
  445. on: 'bottom',
  446. },
  447. advanceOn: {
  448. selector: '[data-cy="Layout"]',
  449. event: 'click',
  450. },
  451. beforeShowPromise: () => waitForElement('[data-cy="Layout"]'),
  452. },
  453. {
  454. id: 'selectLayout',
  455. title: 'Selecting the MPR Layout',
  456. text: 'Select the MPR layout to view the images in MPR mode.',
  457. attachTo: {
  458. element: '[data-cy="MPR"]',
  459. on: 'left-start',
  460. },
  461. advanceOn: {
  462. selector: '[data-cy="MPR"]',
  463. event: 'click',
  464. },
  465. beforeShowPromise: () => waitForElement('[data-cy="MPR"]'),
  466. },
  467. ],
  468. tourOptions: {
  469. useModalOverlay: true,
  470. defaultStepOptions: {
  471. buttons: [
  472. {
  473. text: 'Skip all',
  474. action() {
  475. this.complete();
  476. },
  477. secondary: true,
  478. },
  479. ],
  480. },
  481. },
  482. },
  483. ],
  484. };
  485.  
  486. function waitForElement(selector, maxAttempts = 20, interval = 25) {
  487. return new Promise(resolve => {
  488. let attempts = 0;
  489.  
  490. const checkForElement = setInterval(() => {
  491. const element = document.querySelector(selector);
  492.  
  493. if (element || attempts >= maxAttempts) {
  494. clearInterval(checkForElement);
  495. resolve();
  496. }
  497.  
  498. attempts++;
  499. }, interval);
  500. });
  501. }
  502.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement