diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..33e1aae Binary files /dev/null and b/.DS_Store differ diff --git a/.env b/.env index 8bf8d2c..ab7ec1f 100644 --- a/.env +++ b/.env @@ -19,3 +19,4 @@ POSTGRES_DB=orthanc POSTGRES_PORT=5432 POSTGRES_USER=orthanc POSTGRES_PASSWORD=orthanc + diff --git a/config/orthanc.json b/config/orthanc.json index 973ced5..088e9ce 100644 --- a/config/orthanc.json +++ b/config/orthanc.json @@ -2,7 +2,7 @@ "Name": "DICOM PACS", "StorageDirectory": "/var/lib/orthanc/db", "IndexDirectory": "", - "StorageCompression": true, + "StorageCompression": false, "MaximumStorageSize": 0, "MaximumPatientCount": 0, "LuaScripts": [], diff --git a/docker-compose.yml b/docker-compose.yml index 9b5fd6f..135f8ab 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,15 +1,31 @@ -version: '3.6' +version: "3.6" services: - orthanc: + postgres: + image: postgres:13.1 + container_name: postgres + restart: always + ports: + - "5432:5432" + volumes: + # postgrel->data 挂载出来 + - ${POSTGRES_DATA_MNT}:${PGDATA} + environment: + - PGDATA=${PGDATA} + - POSTGRES_DB=${POSTGRES_DB} + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - TZ=Asia/Shanghai + + pacs: image: osimis/orthanc:20.11.2 container_name: orthanc depends_on: - postgres restart: always ports: - - '8042:8042' - - '4242:4242' + - "8042:8042" + - "4242:4242" volumes: # 挂载orthanc.json配置 - ${ORTHANC_CONFIG}:/etc/orthanc/orthanc.json:ro @@ -20,29 +36,18 @@ services: - POSTGRESQL_PLUGIN_ENABLED=true - TZ=Asia/Shanghai command: /etc/orthanc/orthanc.json - logging: - driver: "json-file" - options: - max-size: "800m" - postgres: - image: postgres:13.1 - container_name: postgres + ohifv3: + image: ohif/viewer + container_name: ohif restart: always ports: - - '5432:5432' - volumes: - # postgrel->data 挂载出来 - - ${POSTGRES_DATA_MNT}:${PGDATA} + - "3000:80" environment: - - PGDATA=${PGDATA} - - POSTGRES_DB=${POSTGRES_DB} - - POSTGRES_USER=${POSTGRES_USER} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - - TZ=Asia/Shanghai - logging: - driver: "json-file" - options: - max-size: "800m" - - \ No newline at end of file + - APP_CONFIG:/usr/share/nginx/html/app-config.js + volumes: + - ./ohifv3/ohif.conf:/etc/nginx/conf.d/default.conf:ro + - ./ohifv3/app-config.js:/usr/share/nginx/html/app-config.js:ro + - ./ohifv3/logo.png:/usr/share/nginx/html/logo.png:ro + depends_on: + - pacs diff --git a/ohifv3/app-config.js b/ohifv3/app-config.js new file mode 100644 index 0000000..28f2e59 --- /dev/null +++ b/ohifv3/app-config.js @@ -0,0 +1,141 @@ +window.config = { + routerBasename: '/', + extensions: [], + showStudyList: true, + filterQueryParam: false, + servers: { + dicomWeb: [ + { + name: 'Orthanc', + wadoUriRoot: '/orthanc/wado', + qidoRoot: '/orthanc/dicom-web', + wadoRoot: '/orthanc/dicom-web', + qidoSupportsIncludeField: true, + imageRendering: 'wadors', + thumbnailRendering: 'wadors', + enableStudyLazyLoad: true, + supportsFuzzyMatching: true, + }, + ], + }, + whiteLabeling: { + /* Used to replace the default Logo */ + createLogoComponentFn: function (React) { + return React.createElement('a', { + target: '_self', + rel: 'noopener noreferrer', + className: 'header-brand', + href: '/', + style: { + display: 'block', + background: 'url(/logo.png)', + backgroundSize: 'contain', + backgroundRepeat: 'no-repeat', + width: '200px', + }, + }); + }, + }, + // Extensions should be able to suggest default values for these? + // Or we can require that these be explicitly set + hotkeys: [ + // ~ Global + { + commandName: 'incrementActiveViewport', + label: 'Next Viewport', + keys: ['right'], + }, + { + commandName: 'decrementActiveViewport', + label: 'Previous Viewport', + keys: ['left'], + }, + // Supported Keys: https://craig.is/killing/mice + // ~ Cornerstone Extension + { commandName: 'rotateViewportCW', label: 'Rotate Right', keys: ['r'] }, + { commandName: 'rotateViewportCCW', label: 'Rotate Left', keys: ['l'] }, + { commandName: 'invertViewport', label: 'Invert', keys: ['i'] }, + { + commandName: 'flipViewportVertical', + label: 'Flip Horizontally', + keys: ['h'], + }, + { + commandName: 'flipViewportHorizontal', + label: 'Flip Vertically', + keys: ['v'], + }, + { commandName: 'scaleUpViewport', label: 'Zoom In', keys: ['+'] }, + { commandName: 'scaleDownViewport', label: 'Zoom Out', keys: ['-'] }, + { commandName: 'fitViewportToWindow', label: 'Zoom to Fit', keys: ['='] }, + { commandName: 'resetViewport', label: 'Reset', keys: ['space'] }, + // clearAnnotations + { commandName: 'nextImage', label: 'Next Image', keys: ['down'] }, + { commandName: 'previousImage', label: 'Previous Image', keys: ['up'] }, + // firstImage + // lastImage + { + commandName: 'previousViewportDisplaySet', + label: 'Previous Series', + keys: ['pagedown'], + }, + { + commandName: 'nextViewportDisplaySet', + label: 'Next Series', + keys: ['pageup'], + }, + // ~ Cornerstone Tools + { commandName: 'setZoomTool', label: 'Zoom', keys: ['z'] }, + // ~ Window level presets + { + commandName: 'windowLevelPreset1', + label: 'W/L Preset 1', + keys: ['1'], + }, + { + commandName: 'windowLevelPreset2', + label: 'W/L Preset 2', + keys: ['2'], + }, + { + commandName: 'windowLevelPreset3', + label: 'W/L Preset 3', + keys: ['3'], + }, + { + commandName: 'windowLevelPreset4', + label: 'W/L Preset 4', + keys: ['4'], + }, + { + commandName: 'windowLevelPreset5', + label: 'W/L Preset 5', + keys: ['5'], + }, + { + commandName: 'windowLevelPreset6', + label: 'W/L Preset 6', + keys: ['6'], + }, + { + commandName: 'windowLevelPreset7', + label: 'W/L Preset 7', + keys: ['7'], + }, + { + commandName: 'windowLevelPreset8', + label: 'W/L Preset 8', + keys: ['8'], + }, + { + commandName: 'windowLevelPreset9', + label: 'W/L Preset 9', + keys: ['9'], + }, + ], + cornerstoneExtensionConfig: {}, + + // studyListFunctionsEnabled is set to true to enable DICOM uploading + studyListFunctionsEnabled: true + +}; \ No newline at end of file diff --git a/ohifv3/logo.png b/ohifv3/logo.png new file mode 100644 index 0000000..1af344b Binary files /dev/null and b/ohifv3/logo.png differ diff --git a/ohifv3/ohif.conf b/ohifv3/ohif.conf new file mode 100644 index 0000000..d25248f --- /dev/null +++ b/ohifv3/ohif.conf @@ -0,0 +1,22 @@ +server { + listen 80; + # set client body size to 500M, this is to allow uploading of DICOMs, throws '413 request entity too large nginx' error otherwise # + client_max_body_size 500M; + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + # https://book.orthanc-server.com/faq/nginx.html#nginx + location /orthanc/ { + proxy_pass http://pacs:8042; + proxy_set_header HOST $host; + proxy_set_header X-Real-IP $remote_addr; + rewrite /orthanc(.*) $1 break; + } +} \ No newline at end of file