From 1c3f3cfcf6be4449dacea77c92959a60eee1cf43 Mon Sep 17 00:00:00 2001 From: diego0020 Date: Wed, 5 Jun 2019 09:11:13 -0500 Subject: [PATCH 1/3] initial prototype --- docker/Nginx-Orthanc/docker-compose.yml | 17 +++-------------- docs/latest/essentials/data-source.md | 8 ++++++-- package.json | 1 + public/config/docker_nginx-orthanc.js | 8 ++++---- src/utils/initWebWorkers.js | 11 +++++++---- 5 files changed, 21 insertions(+), 24 deletions(-) diff --git a/docker/Nginx-Orthanc/docker-compose.yml b/docker/Nginx-Orthanc/docker-compose.yml index 26e797514..62cf8df25 100644 --- a/docker/Nginx-Orthanc/docker-compose.yml +++ b/docker/Nginx-Orthanc/docker-compose.yml @@ -1,17 +1,6 @@ version: '3.5' services: - proxy: - image: nginx:1.15-alpine - ports: - - 8899:80 - volumes: - - ./config/nginx.conf:/etc/nginx/nginx.conf:ro - restart: unless-stopped - - # LINK: https://hub.docker.com/r/jodogne/orthanc-plugins/ - # TODO: Update to use Postgres - # https://github.com/mrts/docker-postgresql-multiple-databases orthanc: image: jodogne/orthanc-plugins:1.5.6 hostname: orthanc @@ -20,7 +9,7 @@ services: - ./config/orthanc.json:/etc/orthanc/orthanc.json:ro # Persist data - ./volumes/orthanc-db/:/var/lib/orthanc/db/ - # ports: - # - '4242:4242' # DICOM - # - '8042:8042' # Web + ports: + - '4242:4242' # DICOM + - '8042:8042' # Web restart: unless-stopped diff --git a/docs/latest/essentials/data-source.md b/docs/latest/essentials/data-source.md index 7d828e8a0..5a6fdbc8f 100644 --- a/docs/latest/essentials/data-source.md +++ b/docs/latest/essentials/data-source.md @@ -29,11 +29,15 @@ For our purposes, we will be using `Orthanc`, but you can see a list of - Docker - [Docker for Mac](https://docs.docker.com/docker-for-mac/) - - [Docker for Windows](https://docs.docker.com/docker-for-windows/) + - [Docker for Windows (recommended)](https://docs.docker.com/docker-for-windows/) + - [Docker Toolbox for Windows](https://docs.docker.com/toolbox/toolbox_install_windows/) _Not sure if you have `docker` installed already? Try running `docker --version` in command prompt or terminal_ +If you are using Docker Toolbox you need to change the _proxy_ parameter in +_package.json_ to http://192.168.99.100:8042 or the ip docker-machine ip throws. + ### Running Orthanc _Start Orthanc:_ @@ -112,7 +116,7 @@ window.config = { }, ], }, -} +}; ``` To learn more about how you can configure the OHIF Viewer, check out our diff --git a/package.json b/package.json index 5fa923387..2cdf9ddb4 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "node": ">=8", "npm": ">=5" }, + "proxy": "http://localhost:8042", "scripts": { "cm": "npx git-cz", "dev": "yarn run preBuild && cross-env PORT=5000 react-scripts start", diff --git a/public/config/docker_nginx-orthanc.js b/public/config/docker_nginx-orthanc.js index b184c5a9d..b200b4b9f 100644 --- a/public/config/docker_nginx-orthanc.js +++ b/public/config/docker_nginx-orthanc.js @@ -5,9 +5,9 @@ window.config = { dicomWeb: [ { name: 'Orthanc', - wadoUriRoot: 'http://localhost:8899/wado', - qidoRoot: 'http://localhost:8899/dicom-web', - wadoRoot: 'http://localhost:8899/dicom-web', + wadoUriRoot: '/wado', + qidoRoot: '/dicom-web', + wadoRoot: '/dicom-web', qidoSupportsIncludeField: false, imageRendering: 'wadors', thumbnailRendering: 'wadors', @@ -17,4 +17,4 @@ window.config = { }, ], }, -} +}; diff --git a/src/utils/initWebWorkers.js b/src/utils/initWebWorkers.js index 462d065da..b7e04ad63 100644 --- a/src/utils/initWebWorkers.js +++ b/src/utils/initWebWorkers.js @@ -6,18 +6,21 @@ import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader'; * @param {String} webWorkScriptsPath */ export default function(baseDirectory, webWorkScriptsPath) { - const scriptsPath = `${window.location.protocol}//${ + let scriptsPath = `${window.location.protocol}//${ window.location.host - }${baseDirectory}/${webWorkScriptsPath}`; + }${baseDirectory}`; + if (webWorkScriptsPath) { + scriptsPath += `/${webWorkScriptsPath}/`; + } const config = { maxWebWorkers: Math.max(navigator.hardwareConcurrency - 1, 1), startWebWorkersOnDemand: true, - webWorkerPath: `${scriptsPath}/cornerstoneWADOImageLoaderWebWorker.min.js`, + webWorkerPath: `${scriptsPath}cornerstoneWADOImageLoaderWebWorker.min.js`, taskConfiguration: { decodeTask: { loadCodecsOnStartup: true, initializeCodecsOnStartup: false, - codecsPath: `${scriptsPath}/cornerstoneWADOImageLoaderCodecs.min.js`, + codecsPath: `${scriptsPath}cornerstoneWADOImageLoaderCodecs.min.js`, usePDFJS: false, strict: false, }, From 2f4961c0780ddc14f2a89718fe977948d615a5ac Mon Sep 17 00:00:00 2001 From: dannyrb Date: Tue, 18 Jun 2019 23:26:27 -0400 Subject: [PATCH 2/3] Note regarding docker toolbox and react-proxy --- docs/latest/essentials/data-source.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/latest/essentials/data-source.md b/docs/latest/essentials/data-source.md index 5a6fdbc8f..2ba6c1283 100644 --- a/docs/latest/essentials/data-source.md +++ b/docs/latest/essentials/data-source.md @@ -35,8 +35,10 @@ For our purposes, we will be using `Orthanc`, but you can see a list of _Not sure if you have `docker` installed already? Try running `docker --version` in command prompt or terminal_ -If you are using Docker Toolbox you need to change the _proxy_ parameter in -_package.json_ to http://192.168.99.100:8042 or the ip docker-machine ip throws. +> If you are using `Docker Toolbox` you need to change the _proxy_ parameter in +> _package.json_ to http://192.168.99.100:8042 or the ip docker-machine ip +> throws. This is the value [`react-scripts`][react-proxy]] uses to proxy +> requests ### Running Orthanc @@ -146,6 +148,7 @@ _Feel free to make a Pull Request if you want to add to this list._ [dicom-web]: https://en.wikipedia.org/wiki/DICOMweb [storescu]: http://support.dcmtk.org/docs/storescu.html [cra-start]: https://github.com/facebook/create-react-app#npm-start-or-yarn-start +[react-proxy]: https://facebook.github.io/create-react-app/docs/proxying-api-requests-in-development#configuring-the-proxy-manually [dcm4chee]: https://github.com/dcm4che/dcm4chee-arc-light [dcm4chee-docker]: https://github.com/dcm4che/dcm4chee-arc-light/wiki/Running-on-Docker From 03501eddb084d1ede53a1d4679d12f98aa423b6c Mon Sep 17 00:00:00 2001 From: dannyrb Date: Tue, 18 Jun 2019 23:33:02 -0400 Subject: [PATCH 3/3] fix typo --- docs/latest/essentials/data-source.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/latest/essentials/data-source.md b/docs/latest/essentials/data-source.md index 2ba6c1283..c47f794d5 100644 --- a/docs/latest/essentials/data-source.md +++ b/docs/latest/essentials/data-source.md @@ -37,7 +37,7 @@ in command prompt or terminal_ > If you are using `Docker Toolbox` you need to change the _proxy_ parameter in > _package.json_ to http://192.168.99.100:8042 or the ip docker-machine ip -> throws. This is the value [`react-scripts`][react-proxy]] uses to proxy +> throws. This is the value [`react-scripts`][react-proxy] uses to proxy > requests ### Running Orthanc