Compare commits
107
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16a87fa75f | ||
|
|
6fdac4d605 | ||
|
|
6192502fe0 | ||
|
|
2341b32638 | ||
|
|
45aeaec916 | ||
|
|
66b84ae9c2 | ||
|
|
bc28fe26ac | ||
|
|
7f642a05da | ||
|
|
66a0aadcce | ||
|
|
808af7ee96 | ||
|
|
10b5e071f4 | ||
|
|
fe1969b071 | ||
|
|
16b2a8295f | ||
|
|
d33bb4210d | ||
|
|
ab681b9929 | ||
|
|
f52daca5e5 | ||
|
|
4afc88c0e5 | ||
|
|
f519f8609c | ||
|
|
e27d5b58a4 | ||
|
|
a18b292a9d | ||
|
|
7bd1507a89 | ||
|
|
a634177578 | ||
|
|
fe4d71ad0b | ||
|
|
f723546e6b | ||
|
|
348b8949d4 | ||
|
|
26e037dee7 | ||
|
|
26be96783d | ||
|
|
029ba1fb4a | ||
|
|
56d658f02d | ||
|
|
64921b905f | ||
|
|
d00d7daf41 | ||
|
|
144a173306 | ||
|
|
e40cbae113 | ||
|
|
698d274c64 | ||
|
|
c221dd86d2 | ||
|
|
a8c3d1b9a2 | ||
|
|
6cce8e6720 | ||
|
|
e8dbe3e1b6 | ||
|
|
ac5dbda3b2 | ||
|
|
bf77b3959a | ||
|
|
c6a6bce0b8 | ||
|
|
3f9decc6d5 | ||
|
|
1b1ff8068d | ||
|
|
eb1a900b13 | ||
|
|
e8938111d5 | ||
|
|
73122e717c | ||
|
|
300fe06b60 | ||
|
|
37e5387cf0 | ||
|
|
7c2860789d | ||
|
|
df35b1bc06 | ||
|
|
0460a487ec | ||
|
|
0195a3d860 | ||
|
|
2740e34ad3 | ||
|
|
61d2caef96 | ||
|
|
a88f37595d | ||
|
|
42d80a3e60 | ||
|
|
51143ffe35 | ||
|
|
76f7b00b65 | ||
|
|
64ca61745b | ||
|
|
ababe63a55 | ||
|
|
6c2217f2e5 | ||
|
|
cf9bec3ffa | ||
|
|
32bc47d315 | ||
|
|
1fb98884d2 | ||
|
|
7f8f9dc073 | ||
|
|
c6f89495b2 | ||
|
|
bad987a06b | ||
|
|
c73abb518f | ||
|
|
d12d01215e | ||
|
|
86adb5113a | ||
|
|
5220cd371c | ||
|
|
16b063a504 | ||
|
|
d0d75987f7 | ||
|
|
7c4ee734fa | ||
|
|
a187783e0d | ||
|
|
ada05b01a7 | ||
|
|
1a44d78277 | ||
|
|
691a073b86 | ||
|
|
5a54564bff | ||
|
|
94b625d4e6 | ||
|
|
8f730a5124 | ||
|
|
0ff4d90878 | ||
|
|
c10342c05c | ||
|
|
a047994e3d | ||
|
|
672ad2d0e7 | ||
|
|
98bd960014 | ||
|
|
9cf30eacb2 | ||
|
|
373b01ac50 | ||
|
|
9120db49f1 | ||
|
|
f02e0339a8 | ||
|
|
20d6680e06 | ||
|
|
2735b0a6eb | ||
|
|
2b1f2104cd | ||
|
|
d03d9e9a09 | ||
|
|
f9eb2c0ae1 | ||
|
|
974367834a | ||
|
|
4aa7cbd641 | ||
|
|
ee88672d37 | ||
|
|
dffe1d51cf | ||
|
|
c5936d412e | ||
|
|
d588ddd830 | ||
|
|
81c2f60731 | ||
|
|
a715c4bd1b | ||
|
|
f3d0a4de3c | ||
|
|
5a74321952 | ||
|
|
27869a9cf6 | ||
|
|
8df6cc55cb |
No files matched your search
+102
-101
@@ -9,9 +9,11 @@ version: 2.1
|
|||||||
# create pull request previews and to update `https://docs.ohif.org`
|
# create pull request previews and to update `https://docs.ohif.org`
|
||||||
###
|
###
|
||||||
|
|
||||||
|
## https://github.com/cypress-io/circleci-orb
|
||||||
|
##
|
||||||
orbs:
|
orbs:
|
||||||
codecov: codecov/codecov@1.0.5
|
codecov: codecov/codecov@1.0.5
|
||||||
cypress: cypress-io/cypress@1.8.0
|
cypress: cypress-io/cypress@1.10.0
|
||||||
|
|
||||||
defaults: &defaults
|
defaults: &defaults
|
||||||
docker:
|
docker:
|
||||||
@@ -21,13 +23,11 @@ defaults: &defaults
|
|||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
PR_UNIT_TESTS:
|
CHECKOUT:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Enable yarn workspaces
|
# Enable yarn workspaces
|
||||||
- run: yarn config set workspaces-experimental true
|
- run: yarn config set workspaces-experimental true
|
||||||
|
|
||||||
# Checkout code and ALL Git Tags
|
# Checkout code and ALL Git Tags
|
||||||
- checkout:
|
- checkout:
|
||||||
post:
|
post:
|
||||||
@@ -47,6 +47,16 @@ jobs:
|
|||||||
paths:
|
paths:
|
||||||
- ~/.cache ## Cache yarn and Cypress
|
- ~/.cache ## Cache yarn and Cypress
|
||||||
key: yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
|
key: yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
|
||||||
|
# Persist :+1:
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: ~/repo
|
||||||
|
paths: .
|
||||||
|
|
||||||
|
UNIT_TESTS:
|
||||||
|
<<: *defaults
|
||||||
|
steps:
|
||||||
|
- attach_workspace:
|
||||||
|
at: ~/repo
|
||||||
|
|
||||||
# RUN TESTS
|
# RUN TESTS
|
||||||
- run:
|
- run:
|
||||||
@@ -86,72 +96,7 @@ jobs:
|
|||||||
root: ~/repo
|
root: ~/repo
|
||||||
paths: .
|
paths: .
|
||||||
|
|
||||||
MERGE_UNIT_TESTS:
|
NPM_PUBLISH:
|
||||||
<<: *defaults
|
|
||||||
|
|
||||||
steps:
|
|
||||||
# Enable yarn workspaces
|
|
||||||
- run: yarn config set workspaces-experimental true
|
|
||||||
|
|
||||||
# Checkout code and ALL Git Tags
|
|
||||||
- checkout:
|
|
||||||
post:
|
|
||||||
- git fetch --all
|
|
||||||
- restore_cache:
|
|
||||||
name: Restore Yarn and Cypress Package Cache
|
|
||||||
keys:
|
|
||||||
# when lock file changes, use increasingly general patterns to restore cache
|
|
||||||
- yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
|
|
||||||
- yarn-packages-v1-{{ .Branch }}-
|
|
||||||
- yarn-packages-v1-
|
|
||||||
- run:
|
|
||||||
name: Install Dependencies
|
|
||||||
command: yarn install --frozen-lockfile
|
|
||||||
- save_cache:
|
|
||||||
name: Save Yarn Package Cache
|
|
||||||
paths:
|
|
||||||
- ~/.cache ## Cache yarn and Cypress
|
|
||||||
key: yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
|
|
||||||
|
|
||||||
# RUN TESTS
|
|
||||||
- run:
|
|
||||||
name: 'JavaScript Test Suite'
|
|
||||||
command: yarn run test:unit:ci
|
|
||||||
|
|
||||||
# PLATFORM/VIEWER
|
|
||||||
- run:
|
|
||||||
name: 'VIEWER: Combine report output'
|
|
||||||
command: |
|
|
||||||
viewerCov="/home/circleci/repo/platform/viewer/coverage"
|
|
||||||
touch "${viewerCov}/reports"
|
|
||||||
cat "${viewerCov}/clover.xml" >> "${viewerCov}/reports"
|
|
||||||
echo "\<<\<<\<< EOF" >> "${viewerCov}/reports"
|
|
||||||
cat "${viewerCov}/lcov.info" >>"${viewerCov}/reports"
|
|
||||||
echo "\<<\<<\<< EOF" >> "${viewerCov}/reports"
|
|
||||||
- codecov/upload:
|
|
||||||
file: '/home/circleci/repo/platform/viewer/coverage/reports'
|
|
||||||
flags: 'viewer'
|
|
||||||
|
|
||||||
# PLATFORM/CORE
|
|
||||||
- run:
|
|
||||||
name: 'CORE: Combine report output'
|
|
||||||
command: |
|
|
||||||
coreCov="/home/circleci/repo/platform/core/coverage"
|
|
||||||
touch "${coreCov}/reports"
|
|
||||||
cat "${coreCov}/clover.xml" >> "${coreCov}/reports"
|
|
||||||
echo "\<<\<<\<< EOF" >> "${coreCov}/reports"
|
|
||||||
cat "${coreCov}/lcov.info" >> "${coreCov}/reports"
|
|
||||||
echo "\<<\<<\<< EOF" >> "${coreCov}/reports"
|
|
||||||
- codecov/upload:
|
|
||||||
file: '/home/circleci/repo/platform/core/coverage/reports'
|
|
||||||
flags: 'core'
|
|
||||||
|
|
||||||
# Persist :+1:
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: ~/repo
|
|
||||||
paths: .
|
|
||||||
|
|
||||||
npm_publish:
|
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@@ -175,7 +120,7 @@ jobs:
|
|||||||
root: ~/repo
|
root: ~/repo
|
||||||
paths: .
|
paths: .
|
||||||
|
|
||||||
docs_publish:
|
DOCS_PUBLISH:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@@ -192,7 +137,7 @@ jobs:
|
|||||||
- run: chmod +x ~/repo/.circleci/build-and-publish-docs.sh
|
- run: chmod +x ~/repo/.circleci/build-and-publish-docs.sh
|
||||||
- run: ~/repo/.circleci/build-and-publish-docs.sh
|
- run: ~/repo/.circleci/build-and-publish-docs.sh
|
||||||
|
|
||||||
docker_publish:
|
DOCKER_PUBLISH:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@@ -221,7 +166,7 @@ jobs:
|
|||||||
docker push ohif/$IMAGE_NAME:latest
|
docker push ohif/$IMAGE_NAME:latest
|
||||||
fi
|
fi
|
||||||
|
|
||||||
viewer_demo_build:
|
VIEWER_DEMO_BUILD:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@@ -246,7 +191,7 @@ jobs:
|
|||||||
root: ~/repo
|
root: ~/repo
|
||||||
paths: .
|
paths: .
|
||||||
|
|
||||||
viewer_demo_publish:
|
VIEWER_DEMO_PUBLISH:
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
docker:
|
docker:
|
||||||
- image: google/cloud-sdk
|
- image: google/cloud-sdk
|
||||||
@@ -272,71 +217,127 @@ workflows:
|
|||||||
# PULL REQUESTS
|
# PULL REQUESTS
|
||||||
PR_CHECKS:
|
PR_CHECKS:
|
||||||
jobs:
|
jobs:
|
||||||
- PR_UNIT_TESTS:
|
- CHECKOUT:
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
ignore:
|
ignore:
|
||||||
- master
|
- master
|
||||||
- feature/*
|
- feature/*
|
||||||
- hotfix/*
|
- hotfix/*
|
||||||
# Cypress job added by `cypress-io` orb
|
- UNIT_TESTS:
|
||||||
|
requires:
|
||||||
|
- CHECKOUT
|
||||||
|
# E2E: PWA
|
||||||
- cypress/run:
|
- cypress/run:
|
||||||
|
name: 'E2E: PWA'
|
||||||
pre-steps:
|
pre-steps:
|
||||||
- run: 'rm -rf ~/.yarn && npm i -g yarn && yarn -v && yarn global
|
- run: 'rm -rf ~/.yarn && npm i -g yarn && yarn -v && yarn global
|
||||||
add wait-on' # Use yarn latest
|
add wait-on' # Use yarn latest
|
||||||
yarn: true
|
yarn: true
|
||||||
store_artifacts: true
|
store_artifacts: false
|
||||||
start: yarn run dev
|
|
||||||
wait-on: 'http://localhost:3000'
|
|
||||||
no-workspace: true # Don't persist workspace
|
|
||||||
working_directory: platform/viewer
|
working_directory: platform/viewer
|
||||||
|
build: yarn run build:e2e
|
||||||
|
start: yarn run test:e2e:dist
|
||||||
|
wait-on: 'http://localhost:3000'
|
||||||
cache-key: 'yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}'
|
cache-key: 'yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}'
|
||||||
|
no-workspace: true # Don't persist workspace
|
||||||
post-steps:
|
post-steps:
|
||||||
- store_test_results:
|
- store_artifacts:
|
||||||
path: cypress/results
|
path: platform/viewer/cypress/screenshots
|
||||||
requires:
|
requires:
|
||||||
- PR_UNIT_TESTS
|
- UNIT_TESTS
|
||||||
|
# E2E: script-tag
|
||||||
|
- cypress/run:
|
||||||
|
name: 'E2E: Script Tag'
|
||||||
|
pre-steps:
|
||||||
|
- run: 'rm -rf ~/.yarn && npm i -g yarn && yarn -v && yarn global
|
||||||
|
add wait-on' # Use yarn latest
|
||||||
|
yarn: true
|
||||||
|
store_artifacts: false
|
||||||
|
working_directory: platform/viewer
|
||||||
|
build: yarn run build:package
|
||||||
|
start: yarn run test:e2e:dist
|
||||||
|
wait-on: 'http://localhost:3000'
|
||||||
|
cache-key: 'yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}'
|
||||||
|
no-workspace: true # Don't persist workspace
|
||||||
|
post-steps:
|
||||||
|
- store_artifacts:
|
||||||
|
path: platform/viewer/cypress/screenshots
|
||||||
|
requires:
|
||||||
|
- UNIT_TESTS
|
||||||
|
|
||||||
# MERGE TO MASTER
|
# MERGE TO MASTER
|
||||||
RELEASE:
|
RELEASE:
|
||||||
jobs:
|
jobs:
|
||||||
- MERGE_UNIT_TESTS:
|
- CHECKOUT:
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only: master
|
only: master
|
||||||
# Cypress job added by `cypress-io` orb
|
- UNIT_TESTS:
|
||||||
|
requires:
|
||||||
|
- CHECKOUT
|
||||||
|
# E2E: PWA + Persist
|
||||||
- cypress/run:
|
- cypress/run:
|
||||||
|
name: 'E2E: PWA'
|
||||||
pre-steps:
|
pre-steps:
|
||||||
- run: 'rm -rf ~/.yarn && npm i -g yarn && yarn -v && yarn global
|
- run: 'rm -rf ~/.yarn && npm i -g yarn && yarn -v && yarn global
|
||||||
add wait-on' # Use yarn latest
|
add wait-on' # Use yarn latest
|
||||||
yarn: true
|
yarn: true
|
||||||
record: true
|
record: true
|
||||||
store_artifacts: true
|
store_artifacts: true
|
||||||
start: yarn run dev
|
|
||||||
wait-on: 'http://localhost:3000'
|
|
||||||
working_directory: platform/viewer
|
working_directory: platform/viewer
|
||||||
|
build: yarn run build:e2e
|
||||||
|
start: yarn run test:e2e:dist
|
||||||
|
wait-on: 'http://localhost:3000'
|
||||||
cache-key: 'yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}'
|
cache-key: 'yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}'
|
||||||
|
no-workspace: true # Don't persist workspace
|
||||||
post-steps:
|
post-steps:
|
||||||
|
- store_artifacts:
|
||||||
|
path: platform/viewer/cypress/screenshots
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: cypress/results
|
path: cypress/results
|
||||||
requires:
|
requires:
|
||||||
- MERGE_UNIT_TESTS
|
- UNIT_TESTS
|
||||||
|
# E2E: script-tag
|
||||||
|
- cypress/run:
|
||||||
|
name: 'E2E: Script Tag'
|
||||||
|
pre-steps:
|
||||||
|
- run: 'rm -rf ~/.yarn && npm i -g yarn && yarn -v && yarn global
|
||||||
|
add wait-on' # Use yarn latest
|
||||||
|
yarn: true
|
||||||
|
store_artifacts: false
|
||||||
|
working_directory: platform/viewer
|
||||||
|
build: yarn run build:package
|
||||||
|
start: yarn run test:e2e:dist
|
||||||
|
wait-on: 'http://localhost:3000'
|
||||||
|
cache-key: 'yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}'
|
||||||
|
no-workspace: true # Don't persist workspace
|
||||||
|
post-steps:
|
||||||
|
- store_artifacts:
|
||||||
|
path: platform/viewer/cypress/screenshots
|
||||||
|
- store_test_results:
|
||||||
|
path: cypress/results
|
||||||
|
requires:
|
||||||
|
- UNIT_TESTS
|
||||||
# Update NPM
|
# Update NPM
|
||||||
- npm_publish:
|
- NPM_PUBLISH:
|
||||||
requires:
|
requires:
|
||||||
- cypress/run
|
- 'E2E: Script Tag'
|
||||||
# Update docs.ohif.org
|
- 'E2E: PWA'
|
||||||
- docs_publish:
|
- DOCS_PUBLISH:
|
||||||
requires:
|
requires:
|
||||||
- cypress/run
|
- 'E2E: Script Tag'
|
||||||
|
- 'E2E: PWA'
|
||||||
|
- VIEWER_DEMO_BUILD:
|
||||||
|
requires:
|
||||||
|
- 'E2E: Script Tag'
|
||||||
|
- 'E2E: PWA'
|
||||||
|
- VIEWER_DEMO_PUBLISH:
|
||||||
|
requires:
|
||||||
|
- VIEWER_DEMO_BUILD
|
||||||
# Update hub.docker.org
|
# Update hub.docker.org
|
||||||
# - docker_publish:
|
# - DOCKER_PUBLISH:
|
||||||
# requires:
|
# requires:
|
||||||
# - npm_publish
|
# - NPM_PUBLISH
|
||||||
# Update viewer.ohif.org
|
# Update viewer.ohif.org
|
||||||
- viewer_demo_build:
|
# Update docs.ohif.org
|
||||||
requires:
|
|
||||||
- cypress/run
|
|
||||||
- viewer_demo_publish:
|
|
||||||
requires:
|
|
||||||
- viewer_demo_build
|
|
||||||
+3
-3
@@ -7,13 +7,13 @@ daysUntilStale: 21
|
|||||||
daysUntilClose: 7
|
daysUntilClose: 7
|
||||||
# Issues with these labels will never be considered stale
|
# Issues with these labels will never be considered stale
|
||||||
exemptLabels:
|
exemptLabels:
|
||||||
- 'Story 🙌'
|
- 'Story :raised_hands:'
|
||||||
- 'Bug: Verified 🐛'
|
- 'Bug: Verified :bug:'
|
||||||
- 'Task: CI/Tooling 🤖'
|
- 'Task: CI/Tooling 🤖'
|
||||||
- 'Task: Docs 📖'
|
- 'Task: Docs 📖'
|
||||||
- 'Task: Docs :book:'
|
- 'Task: Docs :book:'
|
||||||
- 'Task: Refactor 🛠'
|
- 'Task: Refactor 🛠'
|
||||||
- 'Task: Tests 🔬'
|
- 'Task: Tests :microscope:'
|
||||||
- 'PR: Awaiting Review 👀'
|
- 'PR: Awaiting Review 👀'
|
||||||
- 'Triage 🏳️'
|
- 'Triage 🏳️'
|
||||||
- 'Announcement 🎉'
|
- 'Announcement 🎉'
|
||||||
|
|||||||
+2
-2
@@ -28,7 +28,7 @@ example/deps/
|
|||||||
docker/dcm4che/dcm4che-arc
|
docker/dcm4che/dcm4che-arc
|
||||||
|
|
||||||
# Cypress test results
|
# Cypress test results
|
||||||
cypress/videos/
|
videos/
|
||||||
|
|
||||||
# Locize settings
|
# Locize settings
|
||||||
.locize
|
.locize
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# Specific to our deploy-preview
|
||||||
|
# Our docs are published using CircleCI + GitBook
|
||||||
|
# Confgure redirects using netlify.toml
|
||||||
|
|
||||||
|
# PWA Demo
|
||||||
|
/pwa/* /pwa/index.html 200
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
const merge = require('webpack-merge');
|
||||||
const webpackBase = require('./webpack.base.js');
|
const webpackBase = require('./webpack.base.js');
|
||||||
const cssToJavaScriptRule = require('./rules/cssToJavaScript.js');
|
const cssToJavaScriptRule = require('./rules/cssToJavaScript.js');
|
||||||
const stylusToJavaScriptRule = require('./rules/stylusToJavaScript.js');
|
const stylusToJavaScriptRule = require('./rules/stylusToJavaScript.js');
|
||||||
|
|||||||
@@ -123,8 +123,7 @@ window.config = {
|
|||||||
`window.OHIFStandaloneViewer.installViewer(window.config);`
|
`window.OHIFStandaloneViewer.installViewer(window.config);`
|
||||||
|
|
||||||
This exact setup is demonstrated in this
|
This exact setup is demonstrated in this
|
||||||
[CodeSandbox](https://codesandbox.io/s/ohif-viewer-script-tag-usage-c4u4t) and
|
[CodeSandbox](https://codesandbox.io/s/viewer-script-tag-tprch) and in our
|
||||||
in our
|
|
||||||
[Embedding The Viewer](https://docs.ohif.org/deployment/recipes/embedded-viewer.html)
|
[Embedding The Viewer](https://docs.ohif.org/deployment/recipes/embedded-viewer.html)
|
||||||
deployment recipe.
|
deployment recipe.
|
||||||
|
|
||||||
@@ -273,7 +272,6 @@ MIT © [OHIF](https://github.com/OHIF)
|
|||||||
[netlify-image]: https://api.netlify.com/api/v1/badges/a5d369ab-18a6-41c3-bcde-83805205ac7f/deploy-status
|
[netlify-image]: https://api.netlify.com/api/v1/badges/a5d369ab-18a6-41c3-bcde-83805205ac7f/deploy-status
|
||||||
[netlify-url]: https://app.netlify.com/sites/ohif/deploys
|
[netlify-url]: https://app.netlify.com/sites/ohif/deploys
|
||||||
[all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square
|
[all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square
|
||||||
[contributing-url]: https://github.com/OHIF/Viewers/blob/master/CONTRIBUTING.md
|
|
||||||
[circleci-image]: https://circleci.com/gh/OHIF/Viewers.svg?style=svg
|
[circleci-image]: https://circleci.com/gh/OHIF/Viewers.svg?style=svg
|
||||||
[circleci-url]: https://circleci.com/gh/OHIF/Viewers
|
[circleci-url]: https://circleci.com/gh/OHIF/Viewers
|
||||||
[codecov-image]: https://codecov.io/gh/OHIF/Viewers/branch/master/graph/badge.svg
|
[codecov-image]: https://codecov.io/gh/OHIF/Viewers/branch/master/graph/badge.svg
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Netlify redirects
|
||||||
|
# SPA rules for our docs
|
||||||
|
/* /index.html 200
|
||||||
@@ -40,7 +40,7 @@ Check out these helpful links:
|
|||||||
- Ready to dive into some code? Check out our
|
- Ready to dive into some code? Check out our
|
||||||
[Getting Started Guide](./essentials/getting-started.md).
|
[Getting Started Guide](./essentials/getting-started.md).
|
||||||
- We're an active, vibrant community.
|
- We're an active, vibrant community.
|
||||||
[Learn how you can be more involved.](./contributing.md)
|
[Learn how you can be more involved.](./contributing/index.md)
|
||||||
- Feeling lost? Read our [help page](./help.md).
|
- Feeling lost? Read our [help page](./help.md).
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@@ -46,6 +46,6 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- [FAQ](frequently-asked-questions.md)
|
- [FAQ](frequently-asked-questions.md)
|
||||||
- [Contributing](contributing.md)
|
- [Contributing](contributing/index.md)
|
||||||
- [Browser Support](browser-support.md)
|
- [Browser Support](browser-support.md)
|
||||||
- [Help](help.md)
|
- [Help](help.md)
|
||||||
@@ -12,28 +12,48 @@ architected, and the role each of it's dependent libraries plays.
|
|||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
The [`OHIF/Viewers`][viewers-project] project contains the source code for the
|
The [OHIF Medical Image Viewing Platform][viewers-project] is maintained as a
|
||||||
OHIF Medical Imaging Viewer. It is effectively a React [progressive web
|
[`monorepo`][monorepo]. This means that this repository, instead of containing a
|
||||||
app][pwa] (PWA) that combines the business logic housed in
|
single project, contains many projects. If you explore our project structure,
|
||||||
[`OHIF/ohif-core`][core] and the components in our React Component library
|
you'll see the following:
|
||||||
[`OHIF/react-viewerbase`][component-library]. It provides customization for
|
|
||||||
common use cases through [configuration][configuration] and for adding
|
```bash
|
||||||
functionality via [extensions][extensions].
|
.
|
||||||
|
├── extensions
|
||||||
|
│ ├── _example # Skeleton of example extension
|
||||||
|
│ ├── cornerstone # 2D images w/ Cornerstone.js
|
||||||
|
│ ├── dicom-html # Structured Reports as HTML in viewport
|
||||||
|
│ ├── dicom-microscopy # Whole slide microscopy viewing
|
||||||
|
│ ├── dicom-pdf # View DICOM wrapped PDFs in viewport
|
||||||
|
│ └── vtk # MPR and Volume support w/ VTK.js
|
||||||
|
│
|
||||||
|
├── platform
|
||||||
|
│ ├── core # Business Logic
|
||||||
|
│ ├── i18n # Internationalization Support
|
||||||
|
│ ├── ui # React component library
|
||||||
|
│ └── viewer # Connects platform and extension projects
|
||||||
|
│
|
||||||
|
├── ... # misc. shared configuration
|
||||||
|
├── lerna.json # MonoRepo (Lerna) settings
|
||||||
|
├── package.json # Shared devDependencies and commands
|
||||||
|
└── README.md
|
||||||
|
```
|
||||||
|
|
||||||
|
Continue reading to see how these libraries work together to create the OHIF
|
||||||
|
Viewer.
|
||||||
|
|
||||||
### Business Logic
|
### Business Logic
|
||||||
|
|
||||||
Our goal is to maintain the majority of our business logic in
|
The [`@ohif/core`][core-github] project offers pre-packaged solutions for
|
||||||
[`OHIF/ohif-core`](https://github.com/OHIF/ohif-core). `ohif-core` offers
|
features common to Web-based medical imaging viewers. For example:
|
||||||
pre-packaged solutions for features common to Web-based medical imaging viewers.
|
|
||||||
For example:
|
|
||||||
|
|
||||||
- Hotkeys
|
- Hotkeys
|
||||||
- DICOM Web
|
- DICOM Web requests
|
||||||
- Hanging Protocols
|
- Hanging Protocols
|
||||||
- Managing a study's measurements
|
- Managing a study's measurements
|
||||||
- Managing a study's DICOM metadata
|
- Managing a study's DICOM metadata
|
||||||
- A flexible pattern for extensions
|
- A flexible pattern for extensions
|
||||||
- [And many others](https://github.com/OHIF/ohif-core/blob/master/src/index.js#L49-L69)
|
- And many others
|
||||||
|
|
||||||
It does this while remaining decoupled from any particular view library or
|
It does this while remaining decoupled from any particular view library or
|
||||||
rendering logic. While we use it to power our React Viewer, it can be used with
|
rendering logic. While we use it to power our React Viewer, it can be used with
|
||||||
@@ -41,20 +61,42 @@ Vue, React, Vanilla JS, or any number of other frameworks.
|
|||||||
|
|
||||||
### React Component Library
|
### React Component Library
|
||||||
|
|
||||||
[`OHIF/react-viewerbase`](https://github.com/OHIF/react-viewerbase) is a React
|
[`@ohif/ui`][ui-github] is a React Component library that contains the reusable
|
||||||
Component library that contains the reusable components that power the OHIF
|
components that power the OHIF Viewer. It allows us to build, compose, and test
|
||||||
Viewer. It allows us to build, compose, and test components in isolation; easing
|
components in isolation; easing the development process by reducing the need to
|
||||||
the development process by reducing the need to stand-up a local PACS with test
|
stand-up a local PACS with test case data.
|
||||||
case data.
|
|
||||||
|
Extension authors can also use these same components when building their
|
||||||
|
extension's UI; allowing for a consistent look and feel with the rest of the
|
||||||
|
application.
|
||||||
|
|
||||||
[Check out our component library!](https://react.ohif.org/)
|
[Check out our component library!](https://react.ohif.org/)
|
||||||
|
|
||||||
### Misc. Extensions
|
### Internationalization (i18n)
|
||||||
|
|
||||||
Want to add custom logic or UI Components to the OHIF Viewer, but don't want to
|
...
|
||||||
maintain a fork? We expose common integration points via
|
|
||||||
[extensions](./extensions.md) to make that possible. For a list of extensions
|
### The Viewer
|
||||||
maintained by OHIF,
|
|
||||||
|
...
|
||||||
|
|
||||||
|
### Extensions & Configuration
|
||||||
|
|
||||||
|
While OHIF maintains several high value and commonly requested features in its
|
||||||
|
own extensions, there are many instances where one may wish to further extend
|
||||||
|
the viewer. Some common use cases include:
|
||||||
|
|
||||||
|
- Adding AI/ML tools and insights
|
||||||
|
- Custom workflows for guided diagnosis
|
||||||
|
- Collecting specific annotations for training data or reports
|
||||||
|
- Authentication and granular permissions
|
||||||
|
- Teleconsultation workflow, image comments, and tracking
|
||||||
|
- Adding surgical templating tools and reports
|
||||||
|
- and many others
|
||||||
|
|
||||||
|
We expose common integration points via [extensions](./extensions.md) to make
|
||||||
|
this possible. The viewer and many of our own extensions also offer
|
||||||
|
[configuration][configuration]. For a list of extensions maintained by OHIF,
|
||||||
[check out this helpful table](./extensions.html#ohif-maintained-extensions).
|
[check out this helpful table](./extensions.html#ohif-maintained-extensions).
|
||||||
|
|
||||||
If you find yourself thinking "I wish the Viewer could do X", and you can't
|
If you find yourself thinking "I wish the Viewer could do X", and you can't
|
||||||
@@ -67,15 +109,14 @@ looking for ways to improve our extensibility ^\_^
|
|||||||
|
|
||||||
This diagram is a conceptual illustration of how the Viewer is architected.
|
This diagram is a conceptual illustration of how the Viewer is architected.
|
||||||
|
|
||||||
1. (optional) `extensions` can be registered with `ohif-core`'s extension
|
1. (optional) `extensions` can be registered with `@ohif/core`'s extension
|
||||||
manager
|
manager
|
||||||
2. `ohif-core` provides bussiness logic and a way for `viewer` to access
|
2. `@ohif/core` provides bussiness logic and a way for `@ohif/viewer` to access
|
||||||
registered extensions
|
registered extensions
|
||||||
3. The `viewer` composes and provides data to components from our component
|
3. The `@ohif/viewer` composes and provides data to components from our
|
||||||
library (`react-viewerbase`)
|
component library (`@ohif/ui`)
|
||||||
4. The `viewer` can be built and served as a stand-alone PWA, or as an
|
4. The `@ohif/viewer` can be built and served as a stand-alone PWA, or as an
|
||||||
embeddable package
|
embeddable package ([`@ohif/viewer`][viewer-npm])
|
||||||
([`ohif-viewer`](https://www.npmjs.com/package/ohif-viewer))
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -83,17 +124,17 @@ This diagram is a conceptual illustration of how the Viewer is architected.
|
|||||||
|
|
||||||
## Common Questions
|
## Common Questions
|
||||||
|
|
||||||
> When should I use the packaged source `ohif-viewer` versus building a PWA from
|
> When should I use the packaged source `@ohif/viewer` versus building a PWA
|
||||||
> the source?
|
> from the source?
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|
||||||
> Can I create my own Viewer using Vue.js or Angular.js?
|
> Can I create my own Viewer using Vue.js or Angular.js?
|
||||||
|
|
||||||
You can, but you will not be able to leverage as much of the existing code and
|
You can, but you will not be able to leverage as much of the existing code and
|
||||||
components. `ohif-core` could still be used for business logic, and to provide a
|
components. `@ohif/core` could still be used for business logic, and to provide
|
||||||
model for extensions. `react-viewerbase` would then become a guide for the
|
a model for extensions. `@ohif/ui` would then become a guide for the components
|
||||||
components you would need to recreate.
|
you would need to recreate.
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Links
|
Links
|
||||||
@@ -101,9 +142,10 @@ components you would need to recreate.
|
|||||||
|
|
||||||
<!-- prettier-ignore-start -->
|
<!-- prettier-ignore-start -->
|
||||||
[viewers-project]: https://github.com/OHIF/Viewers
|
[viewers-project]: https://github.com/OHIF/Viewers
|
||||||
|
[viewer-npm]: https://www.npmjs.com/package/@ohif/viewer
|
||||||
[pwa]: https://developers.google.com/web/progressive-web-apps/
|
[pwa]: https://developers.google.com/web/progressive-web-apps/
|
||||||
[core]: https://github.com/OHIF/ohif-core
|
|
||||||
[component-library]: https://github.com/OHIF/react-viewerbase
|
|
||||||
[configuration]: ../essentials/configuration.md
|
[configuration]: ../essentials/configuration.md
|
||||||
[extensions]: ./extensions.m
|
[extensions]: ./extensions.md
|
||||||
|
[core-github]: https://github.com/OHIF/viewers/platform/core
|
||||||
|
[ui-github]: https://github.com/OHIF/Viewers/platform/ui
|
||||||
<!-- prettier-ignore-end -->
|
<!-- prettier-ignore-end -->
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 422 KiB |
@@ -1,103 +0,0 @@
|
|||||||
# Contributing
|
|
||||||
|
|
||||||
## I would like to contribute code - how do I do this?
|
|
||||||
|
|
||||||
Fork the repository, make your change and submit a pull request.
|
|
||||||
|
|
||||||
- The OHIF Viewer consists of code from three different repositories. Make sure
|
|
||||||
your change is modifying the appropriate one:
|
|
||||||
- `ohif-core`: Business Logic
|
|
||||||
- `react-viewerbase`: Reusable React Component Library
|
|
||||||
- `Viewers`: The glue, PWA, and primary extension point
|
|
||||||
- At a minimum, you may want to read the following documentation:
|
|
||||||
- [Essentials: Getting Started](./essentials/getting-started.md)
|
|
||||||
- [Advanced: Architecture](./advanced/architecture.md)
|
|
||||||
|
|
||||||
### When changes impact multiple repositories
|
|
||||||
|
|
||||||
This is a particularly tricky scenario. We don't want to publish code in one
|
|
||||||
repository, just so we can test and complete the other half of its requirements
|
|
||||||
in another. Thankfully, there are a couple of ways you can test unpublished
|
|
||||||
dependent changes locally before publishing:
|
|
||||||
|
|
||||||
- [Use `yarn link`](https://yarnpkg.com/en/docs/cli/link)
|
|
||||||
|
|
||||||
For example if you are working on `ohif-core` and would like to use your local
|
|
||||||
version to debug a problem in `Viewers`, simply run yarn link inside of the
|
|
||||||
`ohif-core` project.
|
|
||||||
|
|
||||||
- If you're experiencing issues with `yarn link`,
|
|
||||||
[try `yalc`](https://github.com/whitecolor/yalc)
|
|
||||||
|
|
||||||
Yalc provides an improved workflow as we add more and more dependent packages
|
|
||||||
that are "in-progress". This comes into play as we begin working on extensions
|
|
||||||
and their dependencies.
|
|
||||||
|
|
||||||
```js
|
|
||||||
// Install yalc for the first time
|
|
||||||
yarn global add yalc
|
|
||||||
|
|
||||||
// EXAMPLE: using an in-development version of ohif-core w/ Viewers locally
|
|
||||||
// 1. Navigate to ohif-core's project root
|
|
||||||
yarn install
|
|
||||||
yalc publish
|
|
||||||
|
|
||||||
// 2. Run the following after each change to ohif-core
|
|
||||||
yarn build
|
|
||||||
yalc push .
|
|
||||||
|
|
||||||
// 3. Use the local package in our Viewers project. Navigate to the Viewers
|
|
||||||
// Project root.
|
|
||||||
yarn install
|
|
||||||
yalc add ohif-core
|
|
||||||
yarn run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
## Any guidance on submitting changes?
|
|
||||||
|
|
||||||
While we do appreciate code contributions, triaging and integrating contributed
|
|
||||||
code changes can be very time consuming. Please consider the following tips when
|
|
||||||
working on your pull requests:
|
|
||||||
|
|
||||||
- Functionality is appropriate for the repository. Consider creating a GitHub
|
|
||||||
issue to discuss your suggested changes.
|
|
||||||
- The scope of the pull request is not too large. Please consider separate pull
|
|
||||||
requests for each feature as big pull requests are very time consuming to
|
|
||||||
understand.
|
|
||||||
|
|
||||||
We will provide feedback on your pull requests as soon as possible. Following
|
|
||||||
the tips above will help ensure your changes are reviewed.
|
|
||||||
|
|
||||||
## Testing contribution pull requests
|
|
||||||
|
|
||||||
OHIF uses [netlify](netlify.com) so that pull requests are autogenerated and
|
|
||||||
available for testing.
|
|
||||||
|
|
||||||
For example, [this url][example-url] allows you to test [pull request 237, the
|
|
||||||
request that created this FAQ entry,][pr-237] using data pulled from Amazon S3.
|
|
||||||
|
|
||||||
Replacing the number 237 in the link below with your pull request number should
|
|
||||||
let you test it as well and you can use this link for discussions on github
|
|
||||||
without requiring reviewers to download and build your branch.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
https://deploy-preview-237--ohif.netlify.com/viewer/?url=https://s3.eu-central-1.amazonaws.com/ohif-viewer/sampleDICOM.json
|
|
||||||
```
|
|
||||||
|
|
||||||
If you have made a documentation change, a link like this will let you preview
|
|
||||||
the gitbook generated by the pull request:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
https://deploy-preview-237--ohif.netlify.com/contributing.html
|
|
||||||
```
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Links
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- prettier-ignore-start -->
|
|
||||||
|
|
||||||
[example-url]: https://deploy-preview-237--ohif.netlify.com/viewer/?url=https://s3.eu-central-1.amazonaws.com/ohif-viewer/sampleDICOM.json
|
|
||||||
[pr-237]: https://github.com/OHIF/Viewers/pull/237
|
|
||||||
|
|
||||||
<!-- prettier-ignore-end -->
|
|
||||||
@@ -0,0 +1,146 @@
|
|||||||
|
# Contributing
|
||||||
|
|
||||||
|
## How can I help?
|
||||||
|
|
||||||
|
Fork the repository, make your change and submit a pull request. If you would
|
||||||
|
like to discuss the changes you intend to make to clarify where or how they
|
||||||
|
should be implemented, please don't hesitate to create a new issue. At a
|
||||||
|
minimum, you may want to read the following documentation:
|
||||||
|
|
||||||
|
- [Essentials: Getting Started](./essentials/getting-started.md)
|
||||||
|
- [Advanced: Architecture](./advanced/architecture.md)
|
||||||
|
|
||||||
|
Pull requests that are:
|
||||||
|
|
||||||
|
- Small
|
||||||
|
- [Well tested](./testing.md)
|
||||||
|
- Decoupled
|
||||||
|
|
||||||
|
Are much more likely to get reviewed and merged in a timely manner.
|
||||||
|
|
||||||
|
## When changes impact multiple repositories
|
||||||
|
|
||||||
|
While this can be tricky, we've tried to reduce how often this situation crops
|
||||||
|
up this with our [recent switch to a monorepo][monorepo]. Our maintained
|
||||||
|
extensions, ui components, internationalization library, and business logic can
|
||||||
|
all be developed by simply running `yarn run dev` from the repository root.
|
||||||
|
|
||||||
|
Testing the viewer with locally developed, unpublished package changes from a
|
||||||
|
package outside of the monorepo is most common with extension development. Let's
|
||||||
|
demonstrate how to accomplish this with two commonly forked extension
|
||||||
|
dependencies:
|
||||||
|
|
||||||
|
### `cornerstone-tools`
|
||||||
|
|
||||||
|
On your local file system:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# code/my-projects/
|
||||||
|
.
|
||||||
|
├── cornerstonejs/cornerstone-tools
|
||||||
|
└── ohif/viewers
|
||||||
|
```
|
||||||
|
|
||||||
|
- Open a terminal/shell
|
||||||
|
- Navigate to `cornerstonejs/cornerstone-tools`
|
||||||
|
- `npm install`
|
||||||
|
- [`yarn link`](https://yarnpkg.com/en/docs/cli/link)
|
||||||
|
- `npm run dev`
|
||||||
|
- Open a new terminal/shell
|
||||||
|
- Navigate to `ohif/viewers`.
|
||||||
|
- `yarn install`
|
||||||
|
- [`yarn link cornerstone-tools`](https://yarnpkg.com/en/docs/cli/link)
|
||||||
|
- `yarn run dev`
|
||||||
|
|
||||||
|
As you make changed to `cornerstone-tools`, and it's output is rebuilt, you
|
||||||
|
should see the following behavior:
|
||||||
|
|
||||||
|
<div style="text-align: center;">
|
||||||
|
<a href="/assets/img/cornerstone-tools-link.gif">
|
||||||
|
<img src="/assets/img/cornerstone-tools-link.gif" alt="Example of linked cornerstone-tools package" style="margin: 0 auto; max-width: 500px;" />
|
||||||
|
</a>
|
||||||
|
<div><i>example of linked cornerstone-tools package</i></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
If you wish to stop using your local package, run the following commands in the
|
||||||
|
`ohif/viewers` repository root:
|
||||||
|
|
||||||
|
- `yarn unlink cornerstone-tools`
|
||||||
|
- `yarn install --force`
|
||||||
|
|
||||||
|
### `react-vtkjs-viewport`
|
||||||
|
|
||||||
|
On your local file system:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# code/my-projects/
|
||||||
|
.
|
||||||
|
├── ohif/react-vtkjs-viewport
|
||||||
|
└── ohif/viewers
|
||||||
|
```
|
||||||
|
|
||||||
|
- Open a terminal/shell
|
||||||
|
- Navigate to `ohif/react-vtkjs-viewport`
|
||||||
|
- `yarn install`
|
||||||
|
- [`yarn link`](https://yarnpkg.com/en/docs/cli/link)
|
||||||
|
- `yarn run start`
|
||||||
|
- Open a new terminal/shell
|
||||||
|
- Navigate to `ohif/viewers`.
|
||||||
|
- `yarn install`
|
||||||
|
- [`yarn link react-vtkjs-viewport`](https://yarnpkg.com/en/docs/cli/link)
|
||||||
|
- `yarn run dev`
|
||||||
|
|
||||||
|
#### Other linkage notes
|
||||||
|
|
||||||
|
We're still working out some of the kinks with local package development as
|
||||||
|
there are a lot of factors that can influence the behavior of our development
|
||||||
|
server and bundler. If you encounter issues not addressed here, please don't
|
||||||
|
hesitate to reach out on GitHub.
|
||||||
|
|
||||||
|
## Any guidance on submitting changes?
|
||||||
|
|
||||||
|
While we do appreciate code contributions, triaging and integrating contributed
|
||||||
|
code changes can be very time consuming. Please consider the following tips when
|
||||||
|
working on your pull requests:
|
||||||
|
|
||||||
|
- Functionality is appropriate for the repository. Consider creating a GitHub
|
||||||
|
issue to discuss your suggested changes.
|
||||||
|
- The scope of the pull request is not too large. Please consider separate pull
|
||||||
|
requests for each feature as big pull requests are very time consuming to
|
||||||
|
understand.
|
||||||
|
|
||||||
|
We will provide feedback on your pull requests as soon as possible. Following
|
||||||
|
the tips above will help ensure your changes are reviewed.
|
||||||
|
|
||||||
|
## Testing contribution pull requests
|
||||||
|
|
||||||
|
OHIF uses [netlify](netlify.com) so that pull requests are autogenerated and
|
||||||
|
available for testing.
|
||||||
|
|
||||||
|
For example, [this url][example-url] allows you to test [pull request 237, the
|
||||||
|
request that created this FAQ entry,][pr-237] using data pulled from Amazon S3.
|
||||||
|
|
||||||
|
Replacing the number 237 in the link below with your pull request number should
|
||||||
|
let you test it as well and you can use this link for discussions on github
|
||||||
|
without requiring reviewers to download and build your branch.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
https://deploy-preview-237--ohif.netlify.com/viewer/?url=https://s3.eu-central-1.amazonaws.com/ohif-viewer/sampleDICOM.json
|
||||||
|
```
|
||||||
|
|
||||||
|
If you have made a documentation change, a link like this will let you preview
|
||||||
|
the gitbook generated by the pull request:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
https://deploy-preview-237--ohif.netlify.com/contributing.html
|
||||||
|
```
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Links
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
[example-url]: https://deploy-preview-237--ohif.netlify.com/viewer/?url=https://s3.eu-central-1.amazonaws.com/ohif-viewer/sampleDICOM.json
|
||||||
|
[pr-237]: https://github.com/OHIF/Viewers/pull/237
|
||||||
|
[monorepo]: https://github.com/OHIF/Viewers/issues/768
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
# Deployment
|
# Deployment
|
||||||
|
|
||||||
The OHIF Viewer can be embedded in other web applications via it's [packaged
|
The OHIF Viewer can be embedded in other web applications via it's [packaged
|
||||||
script source][ohif-viewer-npm], or served up as a stand-alone PWA ([progressive
|
script source][viewer-npm], or served up as a stand-alone PWA ([progressive web
|
||||||
web application][pwa-url]) by building and hosting a collection of static
|
application][pwa-url]) by building and hosting a collection of static assets. In
|
||||||
assets. In either case, you will need to configure your instance of the Viewer
|
either case, you will need to configure your instance of the Viewer so that it
|
||||||
so that it can connect to your data source (the database or PACS that provides
|
can connect to your data source (the database or PACS that provides the data
|
||||||
the data your Viewer will display).
|
your Viewer will display).
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -196,8 +196,7 @@ Please feel free to suggest or contribute your own recipes.
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- prettier-ignore-start -->
|
<!-- prettier-ignore-start -->
|
||||||
|
[viewer-npm]: https://www.npmjs.com/package/@ohif/viewer
|
||||||
[ohif-viewer-npm]: https://www.npmjs.com/package/ohif-viewer
|
|
||||||
[pwa-url]: https://developers.google.com/web/progressive-web-apps/
|
[pwa-url]: https://developers.google.com/web/progressive-web-apps/
|
||||||
[static-assets-url]: https://www.maxcdn.com/one/visual-glossary/static-content/
|
[static-assets-url]: https://www.maxcdn.com/one/visual-glossary/static-content/
|
||||||
[app-store]: https://medium.freecodecamp.org/i-built-a-pwa-and-published-it-in-3-app-stores-heres-what-i-learned-7cb3f56daf9b
|
[app-store]: https://medium.freecodecamp.org/i-built-a-pwa-and-published-it-in-3-app-stores-heres-what-i-learned-7cb3f56daf9b
|
||||||
@@ -206,5 +205,5 @@ Please feel free to suggest or contribute your own recipes.
|
|||||||
[host-static-assets]: https://www.netlify.com/blog/2016/05/18/9-reasons-your-site-should-be-static/
|
[host-static-assets]: https://www.netlify.com/blog/2016/05/18/9-reasons-your-site-should-be-static/
|
||||||
[cors]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
[cors]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
||||||
[code-flows]: https://medium.com/@darutk/diagrams-of-all-the-openid-connect-flows-6968e3990660
|
[code-flows]: https://medium.com/@darutk/diagrams-of-all-the-openid-connect-flows-6968e3990660
|
||||||
[code-sandbox]: https://codesandbox.io/s/ohif-viewer-script-tag-usage-b3st9
|
[code-sandbox]: https://codesandbox.io/s/viewer-script-tag-tprch
|
||||||
<!-- prettier-ignore-end -->
|
<!-- prettier-ignore-end -->
|
||||||
@@ -19,9 +19,6 @@ _With Git:_
|
|||||||
```bash
|
```bash
|
||||||
# Clone the remote repository to your local machine
|
# Clone the remote repository to your local machine
|
||||||
git clone https://github.com/OHIF/Viewers.git
|
git clone https://github.com/OHIF/Viewers.git
|
||||||
|
|
||||||
# Make sure the local code reflects the `react` version of the OHIF Viewer
|
|
||||||
git checkout react
|
|
||||||
```
|
```
|
||||||
|
|
||||||
More on: _[`git clone`](https://git-scm.com/docs/git-clone),
|
More on: _[`git clone`](https://git-scm.com/docs/git-clone),
|
||||||
@@ -29,7 +26,7 @@ More on: _[`git clone`](https://git-scm.com/docs/git-clone),
|
|||||||
|
|
||||||
_From .zip:_
|
_From .zip:_
|
||||||
|
|
||||||
[OHIF/Viewers: react.zip](https://github.com/OHIF/Viewers/archive/react.zip)
|
[OHIF/Viewers: react.zip](https://github.com/OHIF/Viewers/archive/master.zip)
|
||||||
|
|
||||||
### Restore Dependencies & Build
|
### Restore Dependencies & Build
|
||||||
|
|
||||||
@@ -37,20 +34,24 @@ Open your terminal, and navigate to the directory containing the source files.
|
|||||||
Next run these commands:
|
Next run these commands:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
// If you haven't already, enable yarn workspaces
|
||||||
|
yarn config set workspaces-experimental true
|
||||||
|
|
||||||
// Restore dependencies
|
// Restore dependencies
|
||||||
yarn install
|
yarn install
|
||||||
|
|
||||||
// Build source code for production
|
// Build source code for production
|
||||||
yarn run build:web
|
yarn run build
|
||||||
```
|
```
|
||||||
|
|
||||||
If everything worked as expected, you should have a new `build/` directory in
|
If everything worked as expected, you should have a new `dist/` directory in the
|
||||||
the project's folder. It should roughly resemble the following:
|
project's folder. It should roughly resemble the following:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
build
|
dist/
|
||||||
├── config/
|
├── app-config.js
|
||||||
├── static/
|
├── app.bundle.js
|
||||||
|
├── app.css
|
||||||
├── index.html
|
├── index.html
|
||||||
├── manifest.json
|
├── manifest.json
|
||||||
├── service-worker.js
|
├── service-worker.js
|
||||||
@@ -64,60 +65,15 @@ how to configure the project for your own imaging archive below.
|
|||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
> This step assumes you have an imaging archive. If you need assistance setting
|
The configuration for our viewer is in the `<root>platform/viewer/public/config`
|
||||||
> one up, check out the [`Data Source` Guide](./../../essentials/data-source.md)
|
directory. Our build process knows which configuration file to use based on the
|
||||||
> or a deployment recipe that contains an open source Image Archive
|
`APP_CONFIG` environment variable. By default, its value is
|
||||||
|
[`config/default.js`][default-config]. The majority of the viewer's features,
|
||||||
|
and registered extension's features, are configured using this file.
|
||||||
|
|
||||||
#### How it Works
|
The easiest way to apply your own configuration is to modify the `default.js`
|
||||||
|
file. For more advanced cofiguration options, check out our
|
||||||
The configuration for our project is in the `/public/config` directory. Our
|
[configuration essentials guide](/essentials/configuration.md).
|
||||||
build process knows which configuration file to use based on the `APP_CONFIG`
|
|
||||||
environment variable. By default, its value is
|
|
||||||
[`default.js`](https://github.com/OHIF/Viewers/blob/master/platform/viewer/public/config/default.js).
|
|
||||||
When we build, the `%APP_CONFIG%` value in
|
|
||||||
our[`/public/index.html`](https://github.com/OHIF/Viewers/blob/master/platform/viewer/public/index.html)
|
|
||||||
file is substituted for the correct configuration file's name. This sets
|
|
||||||
the`window.config` equal to our configuration file's value.
|
|
||||||
|
|
||||||
#### How do I configure my project?
|
|
||||||
|
|
||||||
The simplest way is to update the existing default config:
|
|
||||||
|
|
||||||
_/public/config/default.js_
|
|
||||||
|
|
||||||
```js
|
|
||||||
window.config = {
|
|
||||||
routerBasename: '/',
|
|
||||||
servers: {
|
|
||||||
dicomWeb: [
|
|
||||||
{
|
|
||||||
name: 'DCM4CHEE',
|
|
||||||
wadoUriRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/wado',
|
|
||||||
qidoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
|
|
||||||
wadoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
|
|
||||||
qidoSupportsIncludeField: true,
|
|
||||||
imageRendering: 'wadors',
|
|
||||||
thumbnailRendering: 'wadors',
|
|
||||||
requestOptions: {
|
|
||||||
requestFromBrowser: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also create a new config file and specify its path relative to the build
|
|
||||||
output's root by setting the `APP_CONFIG` environment variable. You can set the
|
|
||||||
value of this environment variable a few different ways:
|
|
||||||
|
|
||||||
- [Add a temporary environment variable in your shell](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables#adding-temporary-environment-variables-in-your-shell)
|
|
||||||
- [Add environment specific variables in `.env` file(s)](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables#adding-development-environment-variables-in-env)
|
|
||||||
- Using the `cross-env` package in an npm script:
|
|
||||||
- `"build": "cross-env APP_CONFIG=config/my-config.js react-scripts build"`
|
|
||||||
|
|
||||||
After updating the configuration, `yarn run build:web` to generate updated build
|
|
||||||
output.
|
|
||||||
|
|
||||||
## Next Steps
|
## Next Steps
|
||||||
|
|
||||||
@@ -141,7 +97,7 @@ _Advanced_
|
|||||||
### Testing Build Output Locally
|
### Testing Build Output Locally
|
||||||
|
|
||||||
A quick way to test your build output locally is to spin up a small webserver.
|
A quick way to test your build output locally is to spin up a small webserver.
|
||||||
You can do this by running the following commands in the `build/` output
|
You can do this by running the following commands in the `dist/` output
|
||||||
directory:
|
directory:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
@@ -162,8 +118,7 @@ web application. For a starting point, check out this repository's own use of:
|
|||||||
|
|
||||||
- [CircleCI][circleci]: [config.yaml][circleci-config]
|
- [CircleCI][circleci]: [config.yaml][circleci-config]
|
||||||
- [Netlify][netlify]: [netlify.toml][netlify.toml] |
|
- [Netlify][netlify]: [netlify.toml][netlify.toml] |
|
||||||
[generateStaticSite.sh][generatestaticsite.sh]
|
[build-deploy-preview.sh][build-deploy-preview.sh]
|
||||||
- [Semantic-Release][semantic-release]: [.releaserc][releaserc]
|
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
@@ -173,10 +128,8 @@ web application. For a starting point, check out this repository's own use of:
|
|||||||
|
|
||||||
<!-- prettier-ignore-start -->
|
<!-- prettier-ignore-start -->
|
||||||
[circleci]: https://circleci.com/gh/OHIF/Viewers
|
[circleci]: https://circleci.com/gh/OHIF/Viewers
|
||||||
[circleci-config]: https://github.com/OHIF/Viewers/blob/react/.circleci/config.yml
|
[circleci-config]: https://github.com/OHIF/Viewers/blob/master/.circleci/config.yml
|
||||||
[netlify]: https://app.netlify.com/sites/ohif/deploys
|
[netlify]: https://app.netlify.com/sites/ohif/deploys
|
||||||
[netlify.toml]: https://github.com/OHIF/Viewers/blob/react/netlify.toml
|
[netlify.toml]: https://github.com/OHIF/Viewers/blob/master/netlify.toml
|
||||||
[generateStaticSite.sh]: https://github.com/OHIF/Viewers/blob/react/generateStaticSite.sh
|
[build-deploy-preview.sh]: https://github.com/OHIF/Viewers/blob/master/.netlify/build-deploy-preview.sh
|
||||||
[semantic-release]: https://semantic-release.gitbook.io/semantic-release/
|
|
||||||
[releaserc]: https://github.com/OHIF/Viewers/blob/react/.releaserc
|
|
||||||
<!-- prettier-ignore-end -->
|
<!-- prettier-ignore-end -->
|
||||||
@@ -12,35 +12,18 @@ include tags. Here's how it works:
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
<a href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700&display=swap">
|
||||||
<code>bootstrap@3.3.7</code>
|
<code>Google Font: Roboto</code>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700|Sanchez&display=swap">
|
<a href="https://unpkg.com/@ohif/viewer">
|
||||||
<code>Google Fonts, Sanchez & Roboto</code>
|
<code>@ohif/viewer@latest</code>
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="https://unpkg.com/react@16/umd/react.production.min.js">
|
|
||||||
<code>react@16.8.6</code>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js">
|
|
||||||
<code>react-dom@16.8.6</code>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="https://unpkg.com/ohif-viewer/dist/index.umd.js">
|
|
||||||
<code>ohif-viewer@latest</code>
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ol start="2">
|
<ol start="2">
|
||||||
<li>The <a href="">WADO Image Loader Codecs and Web Worker source code</a>
|
|
||||||
should be accessible from your server's root</li>
|
|
||||||
<li>Create a JS Object to hold the OHIF Viewer's configuration. Here are some
|
<li>Create a JS Object to hold the OHIF Viewer's configuration. Here are some
|
||||||
example values that would allow the viewer to hit our public PACS:</li>
|
example values that would allow the viewer to hit our public PACS:</li>
|
||||||
</ol>
|
</ol>
|
||||||
@@ -60,28 +43,64 @@ window.config = {
|
|||||||
qidoSupportsIncludeField: true,
|
qidoSupportsIncludeField: true,
|
||||||
imageRendering: 'wadors',
|
imageRendering: 'wadors',
|
||||||
thumbnailRendering: 'wadors',
|
thumbnailRendering: 'wadors',
|
||||||
requestOptions: {
|
|
||||||
requestFromBrowser: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
<ol start="5"><li>
|
<ol start="3"><li>
|
||||||
Render the viewer in the web page's target <code>div</code>
|
Render the viewer in the web page's target <code>div</code>
|
||||||
</li></ol>
|
</li></ol>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// Made available by the `ohif-viewer` script included in step 1
|
// Made available by the `@ohif/viewer` script included in step 1
|
||||||
var Viewer = window.OHIFStandaloneViewer.App;
|
var containerId = 'id-of-div-to-render-component-to';
|
||||||
var app = React.createElement(Viewer, window.config, null);
|
var componentRenderedOrUpdatedCallback = function() {
|
||||||
|
console.log('OHIF Viewer rendered/updated');
|
||||||
ReactDOM.render(app, document.getElementById('ohif-viewer-target'));
|
};
|
||||||
|
window.OHIFViewer.installViewer(
|
||||||
|
window.config,
|
||||||
|
containerId,
|
||||||
|
componentRenderedOrUpdatedCallback
|
||||||
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Tips & Tricks
|
You can see a live example of this recipe in [this CodeSandbox][code-sandbox].
|
||||||
|
|
||||||
|
## Add Extensions
|
||||||
|
|
||||||
|
The UMD build of the OHIF Viewer is a "light weight" build that only contains
|
||||||
|
the core extensions required for basic 2D image viewing. It's possible to add
|
||||||
|
other extensions at runtime.
|
||||||
|
|
||||||
|
This only requires us to include a single script tag, and add it using the
|
||||||
|
`extensions` key to our config. In this practical example, we register our
|
||||||
|
popular whole slide microscopy extension:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script
|
||||||
|
src="https://unpkg.com/@ohif/extension-dicom-microscopy@0.50.5/dist/index.umd.js"
|
||||||
|
crossorigin
|
||||||
|
></script>
|
||||||
|
|
||||||
|
<!-- --->
|
||||||
|
<script>
|
||||||
|
window.config = {
|
||||||
|
// ...
|
||||||
|
extensions: [OHIFExtDicomMicroscopy],
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
You can see an example of a slide microscopy study in the viewer [with the
|
||||||
|
extension enabled here][whole-slide-ext-demo] ([source code][ext-code-sandbox])
|
||||||
|
and [without it here][whole-slide-base-demo] ([source code][code-sandbox]).
|
||||||
|
|
||||||
|
You can read more about extensions and how to create your own in our
|
||||||
|
[extensions guide](/advanced/extensions.md).
|
||||||
|
|
||||||
|
#### FAQ
|
||||||
|
|
||||||
> I'm having trouble getting this to work. Where can I go for help?
|
> I'm having trouble getting this to work. Where can I go for help?
|
||||||
|
|
||||||
@@ -89,16 +108,34 @@ First, check out this fully functional [CodeSandbox][code-sandbox] example. If
|
|||||||
you're still having trouble, feel free to search or GitHub issues. Can't find
|
you're still having trouble, feel free to search or GitHub issues. Can't find
|
||||||
anything related your problem? Create a new one.
|
anything related your problem? Create a new one.
|
||||||
|
|
||||||
> When I include bootstrap, other styles on my page no longer work correctly.
|
> My application's styles are impacting the OHIF Viewer's look and feel. What
|
||||||
> What can I do?
|
> can I do?
|
||||||
|
|
||||||
When we include `bootsrap` (and the other dependencies), they are added
|
When you include stylesheets and scripts, they are added globally. This has the
|
||||||
globally. This has the potential of causing conflicts with other scripts and
|
potential of causing conflicts with other scripts and styles on the page. To
|
||||||
styles on the page. To prevent this, `embed` the viewer in a new/empty web page.
|
prevent this, `embed` the viewer in a new/empty web page. Have that working?
|
||||||
Have that working? Good. Now `embed` that new page using an
|
Good. Now `embed` that new page using an
|
||||||
[`<iframe>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe).
|
[`<iframe>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe).
|
||||||
|
|
||||||
This should produce the expected result while also protecting your page from any
|
This should produce the expected result while also protecting your page from any
|
||||||
globally defined styles/scripts.
|
globally defined styles/scripts.
|
||||||
|
|
||||||
[code-sandbox]: https://codesandbox.io/s/ohif-viewer-script-tag-usage-b3st9
|
> We're trying to embed the OHIF Viewer into an existing React App, but seeing
|
||||||
|
> react-dom and react conflicts. What can we do?
|
||||||
|
|
||||||
|
`installViewer` is a convenience method that pulls in some dependencies that may
|
||||||
|
not be compatible with existing `react` apps. `@ohif/viewer` also exports `App`
|
||||||
|
which is a react component that takes the `configuration` outlined above as
|
||||||
|
props. You can use it as a reusable component, and to avoid `react` version
|
||||||
|
conflict issues.
|
||||||
|
|
||||||
|
<!--
|
||||||
|
LINKS
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
[code-sandbox]: https://codesandbox.io/s/viewer-script-tag-tprch
|
||||||
|
[whole-slide-base-demo]: https://tprch.csb.app/viewer/1.2.392.200140.2.1.1.1.2.799008771.2020.1519719354.757
|
||||||
|
[ext-code-sandbox]: https://codesandbox.io/s/viewer-script-tag-microscopy-extension-44unk
|
||||||
|
[whole-slide-ext-demo]: https://44unk.csb.app/viewer/1.2.392.200140.2.1.1.1.2.799008771.2448.1519719572.518
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
@@ -121,11 +121,7 @@ likely want to update:
|
|||||||
|
|
||||||
#### OHIF Viewer
|
#### OHIF Viewer
|
||||||
|
|
||||||
The OHIF Viewer's configuration is imported from a static `.js` file and made
|
The OHIF Viewer's configuration is imported from a static `.js` file. The configuration we use is set to a specific file when we build the viewer, and determined by the env variable: `APP_CONFIG`. You can see where we set its value in the `dockerfile` for this solution:
|
||||||
available globally at `window.config`. The configuration we use is set to a
|
|
||||||
specific file when we build the viewer, and determined by the env variable:
|
|
||||||
`APP_CONFIG`. You can see where we set its value in the `dockerfile` for this
|
|
||||||
solution:
|
|
||||||
|
|
||||||
`ENV APP_CONFIG=config/docker_openresty-orthanc.js`
|
`ENV APP_CONFIG=config/docker_openresty-orthanc.js`
|
||||||
|
|
||||||
|
|||||||
@@ -122,11 +122,7 @@ likely want to update:
|
|||||||
|
|
||||||
#### OHIF Viewer
|
#### OHIF Viewer
|
||||||
|
|
||||||
The OHIF Viewer's configuration is imported from a static `.js` file and made
|
The OHIF Viewer's configuration is imported from a static `.js` file. The configuration we use is set to a specific file when we build the viewer, and determined by the env variable: `APP_CONFIG`. You can see where we set its value in the `dockerfile` for this solution:
|
||||||
available globally at `window.config`. The configuration we use is set to a
|
|
||||||
specific file when we build the viewer, and determined by the env variable:
|
|
||||||
`APP_CONFIG`. You can see where we set its value in the `dockerfile` for this
|
|
||||||
solution:
|
|
||||||
|
|
||||||
`ENV APP_CONFIG=config/docker_openresty-orthanc-keycloak.js`
|
`ENV APP_CONFIG=config/docker_openresty-orthanc-keycloak.js`
|
||||||
|
|
||||||
|
|||||||
@@ -4,22 +4,47 @@
|
|||||||
> one up, check out the [`Data Source` Guide](./data-source.md) or a deployment
|
> one up, check out the [`Data Source` Guide](./data-source.md) or a deployment
|
||||||
> recipe that contains an open source Image Archive
|
> recipe that contains an open source Image Archive
|
||||||
|
|
||||||
## How it Works
|
## Overview
|
||||||
|
|
||||||
The configuration for our project is in the `/public/config` directory. Our
|
### Configuration Files
|
||||||
build process knows which configuration file to use based on the `APP_CONFIG`
|
|
||||||
environment variable. By default, its value is
|
The configuration for our viewer is in the `<root>platform/viewer/public/config`
|
||||||
[`default.js`](https://github.com/OHIF/Viewers/blob/master/platform/viewer/public/config/default.js).
|
directory. Our build process knows which configuration file to use based on the
|
||||||
When we build, the `%APP_CONFIG%` value in
|
`APP_CONFIG` environment variable. By default, its value is
|
||||||
our[`/public/index.html`](https://github.com/OHIF/Viewers/blob/master/platform/viewer/public/index.html)
|
[`config/default.js`][default-config]. The majority of the viewer's features,
|
||||||
file is substituted for the correct configuration file's name. This sets the
|
and registered extension's features, are configured using this file.
|
||||||
`window.config` equal to our configuration file's value.
|
|
||||||
|
**Embedded Use Note:**
|
||||||
|
|
||||||
|
Alternatively, when using the `commonjs` bundle for embedded use cases, these
|
||||||
|
same values are what you'll pass to `installViewer` method:
|
||||||
|
|
||||||
|
`OHIFStandaloneViewer.installViewer(window.config)`
|
||||||
|
|
||||||
|
### Environment Variables
|
||||||
|
|
||||||
|
We use environment variables at build and dev time to change the Viewer's
|
||||||
|
behavior. We can update the `HTML_TEMPLATE` to easily change which extensions
|
||||||
|
are registered, and specify a different `APP_CONFIG` to connect to an
|
||||||
|
alternative data source (or even specify different default hotkeys).
|
||||||
|
|
||||||
|
| Environment Variable | Description | Default |
|
||||||
|
| -------------------- | -------------------------------------------------------------------------------------------------- | ------------------- |
|
||||||
|
| `HTML_TEMPLATE` | Which [HTML template][html-templates] to use as our web app's entry point. Specific to PWA builds. | `index.html` |
|
||||||
|
| `PUBLIC_URL` | The route relative to the host that the app will be served from. Specific to PWA builds. | `/` |
|
||||||
|
| `APP_CONFIG` | Which [configuration file][config-file] to copy to output as `app-config.js` | `config/default.js` |
|
||||||
|
| `PROXY_TARGET` | When developing, proxy requests that match this pattern to `PROXY_DOMAIN` | `undefined` |
|
||||||
|
| `PROXY_DOMAIN` | When developing, proxy requests from `PROXY_TARGET` to `PROXY_DOMAIN` | `undefined` |
|
||||||
|
|
||||||
|
### Registering Extensions
|
||||||
|
|
||||||
|
> :warn: Instructions coming soon
|
||||||
|
|
||||||
## How do I configure my project?
|
## How do I configure my project?
|
||||||
|
|
||||||
The simplest way is to update the existing default config:
|
The simplest way is to update the existing default config:
|
||||||
|
|
||||||
_/public/config/default.js_
|
_/platform/viewer/public/config/default.js_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
window.config = {
|
window.config = {
|
||||||
@@ -34,9 +59,6 @@ window.config = {
|
|||||||
qidoSupportsIncludeField: true,
|
qidoSupportsIncludeField: true,
|
||||||
imageRendering: 'wadors',
|
imageRendering: 'wadors',
|
||||||
thumbnailRendering: 'wadors',
|
thumbnailRendering: 'wadors',
|
||||||
requestOptions: {
|
|
||||||
requestFromBrowser: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -47,10 +69,24 @@ You can also create a new config file and specify its path relative to the build
|
|||||||
output's root by setting the `APP_CONFIG` environment variable. You can set the
|
output's root by setting the `APP_CONFIG` environment variable. You can set the
|
||||||
value of this environment variable a few different ways:
|
value of this environment variable a few different ways:
|
||||||
|
|
||||||
- [Add a temporary environment variable in your shell](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables#adding-temporary-environment-variables-in-your-shell)
|
- ~[Add a temporary environment variable in your shell](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables#adding-temporary-environment-variables-in-your-shell)~
|
||||||
- [Add environment specific variables in `.env` file(s)](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables#adding-development-environment-variables-in-env)
|
- Previous `react-scripts` functionality that we need to duplicate with
|
||||||
|
`dotenv-webpack`
|
||||||
|
- ~[Add environment specific variables in `.env` file(s)](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables#adding-development-environment-variables-in-env)~
|
||||||
|
- Previous `react-scripts` functionality that we need to duplicate with
|
||||||
|
`dotenv-webpack`
|
||||||
- Using the `cross-env` package in an npm script:
|
- Using the `cross-env` package in an npm script:
|
||||||
- `"build": "cross-env APP_CONFIG=config/my-config.js react-scripts build"`
|
- `"build": "cross-env APP_CONFIG=config/my-config.js react-scripts build"`
|
||||||
|
|
||||||
After updating the configuration, `yarn run build:web` to generate updated build
|
After updating the configuration, `yarn run build` to generate updated build
|
||||||
output.
|
output.
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Links
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
[default-config]: https://github.com/OHIF/Viewers/blob/master/platform/viewer/public/config/default.js
|
||||||
|
[html-templates]: https://github.com/OHIF/Viewers/tree/master/platform/viewer/public/html-templates
|
||||||
|
[config-files]: https://github.com/OHIF/Viewers/tree/master/platform/viewer/public/config
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
@@ -4,7 +4,7 @@ Themeing is currently accomplished with color variables that are defined within
|
|||||||
the [`:root`](https://css-tricks.com/almanac/selectors/r/root/) selector
|
the [`:root`](https://css-tricks.com/almanac/selectors/r/root/) selector
|
||||||
(allowing them to cascade across all elements). This repository's components,
|
(allowing them to cascade across all elements). This repository's components,
|
||||||
and the ones we consume from our
|
and the ones we consume from our
|
||||||
[React Viewerbase component library](https://react.ohif.org/styling-and-theming)
|
[`@ohif/ui` component library](https://react.ohif.org/styling-and-theming)
|
||||||
utilize them. We are interested in pursuing more robust themeing options, and
|
utilize them. We are interested in pursuing more robust themeing options, and
|
||||||
open to pull requests and discussion issues.
|
open to pull requests and discussion issues.
|
||||||
|
|
||||||
@@ -80,12 +80,12 @@ function RadicalImagingLogo() {
|
|||||||
href: 'http://radicalimaging.com',
|
href: 'http://radicalimaging.com',
|
||||||
},
|
},
|
||||||
React.createElement('h5', {}, 'RADICAL IMAGING')
|
React.createElement('h5', {}, 'RADICAL IMAGING')
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
props.whiteLabelling = {
|
props.whiteLabelling = {
|
||||||
logoComponent: RadicalImagingLogo(),
|
logoComponent: RadicalImagingLogo(),
|
||||||
}
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@@ -145,8 +145,8 @@ becomes a new namespace automatically.
|
|||||||
- CineDialog: Translations for the toll tips inside the Cine Player Dialog
|
- CineDialog: Translations for the toll tips inside the Cine Player Dialog
|
||||||
- Common: all common jargons that can be reused like `t('$t(common:image)')`
|
- Common: all common jargons that can be reused like `t('$t(common:image)')`
|
||||||
- Header: translations related to OHIF's Header Top Bar
|
- Header: translations related to OHIF's Header Top Bar
|
||||||
- MeasurementTable - Translations for the react-viewerbase Measurement Table
|
- MeasurementTable - Translations for the `@ohif/ui` Measurement Table
|
||||||
- UserPreferencesModal - Translations for the react-viewerbase Preferences Modal
|
- UserPreferencesModal - Translations for the `@ohif/ui` Preferences Modal
|
||||||
|
|
||||||
### How to use another NameSpace inside the current NameSpace?
|
### How to use another NameSpace inside the current NameSpace?
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ Follow the steps outlined in the [Bug Report Template][bug-report-template].
|
|||||||
At the moment we are in the process of defining our roadmap and will do our best
|
At the moment we are in the process of defining our roadmap and will do our best
|
||||||
to communicate this to the community. If your requested feature is on the
|
to communicate this to the community. If your requested feature is on the
|
||||||
roadmap, then it will most likely be built at some point. If it is not, you are
|
roadmap, then it will most likely be built at some point. If it is not, you are
|
||||||
welcome to build it yourself and [contribute it](contributing.md). If you have
|
welcome to build it yourself and [contribute it](contributing/index.md). If you
|
||||||
resources and would like to fund the development of a feature, please
|
have resources and would like to fund the development of a feature, please
|
||||||
[contact us](http://www.ohif.org) or work with community members that offer
|
[contact us](http://www.ohif.org) or work with community members that offer
|
||||||
[consulting services][commercial-support].
|
[consulting services][commercial-support].
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ for a product built using the platform.
|
|||||||
If you have gone this route (or are going there), please let us know because we
|
If you have gone this route (or are going there), please let us know because we
|
||||||
would be interested to hear about your experience.
|
would be interested to hear about your experience.
|
||||||
|
|
||||||
### Is The OHIF Viewer [HIPAA][hipaa] Compliant?
|
### Is The OHIF Viewer [HIPAA][hipaa-def] Compliant?
|
||||||
|
|
||||||
**NO.** The OHIF Viewer **DOES NOT** fulfill all of the criteria to become HIPAA
|
**NO.** The OHIF Viewer **DOES NOT** fulfill all of the criteria to become HIPAA
|
||||||
Compliant. It is the users responsibility to ensure compliance with applicable
|
Compliant. It is the users responsibility to ensure compliance with applicable
|
||||||
@@ -75,7 +75,7 @@ rules and regulations.
|
|||||||
<!-- OTHER -->
|
<!-- OTHER -->
|
||||||
[501k-clearance]: https://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/HowtoMarketYourDevice/PremarketSubmissions/PremarketNotification510k/
|
[501k-clearance]: https://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/HowtoMarketYourDevice/PremarketSubmissions/PremarketNotification510k/
|
||||||
[ce-marking]: https://ec.europa.eu/growth/single-market/ce-marking_en
|
[ce-marking]: https://ec.europa.eu/growth/single-market/ce-marking_en
|
||||||
[hipaa]: https://en.wikipedia.org/wiki/Health_Insurance_Portability_and_Accountability_Act
|
[hipaa-def]: https://en.wikipedia.org/wiki/Health_Insurance_Portability_and_Accountability_Act
|
||||||
[new-issue]: https://github.com/OHIF/Viewers/issues/new/choose
|
[new-issue]: https://github.com/OHIF/Viewers/issues/new/choose
|
||||||
[bug-report-template]: https://github.com/OHIF/Viewers/issues/new?assignees=&labels=Bug+Report+%3Abug%3A&template=---bug-report.md&title=
|
[bug-report-template]: https://github.com/OHIF/Viewers/issues/new?assignees=&labels=Bug+Report+%3Abug%3A&template=---bug-report.md&title=
|
||||||
<!-- prettier-ignore-end -->
|
<!-- prettier-ignore-end -->
|
||||||
+2
-2
@@ -3,7 +3,7 @@
|
|||||||
We all need a little help sometimes. Don't let a few roadblocks stand in the way
|
We all need a little help sometimes. Don't let a few roadblocks stand in the way
|
||||||
of you building something awesome.
|
of you building something awesome.
|
||||||
|
|
||||||
## Free
|
## Community Support
|
||||||
|
|
||||||
If you're a developer looking to contribute code, documentation, or discussion;
|
If you're a developer looking to contribute code, documentation, or discussion;
|
||||||
we are more than happy to help provide clarification and answer questions via
|
we are more than happy to help provide clarification and answer questions via
|
||||||
@@ -21,7 +21,7 @@ resources and must be judicious with how we allocate them. If you find yourself
|
|||||||
in this situation and in need of assistance, it may be in your best interest to
|
in this situation and in need of assistance, it may be in your best interest to
|
||||||
persue paid support.
|
persue paid support.
|
||||||
|
|
||||||
## Paid / Commercial
|
## Commercial Support
|
||||||
|
|
||||||
The Open Health Imaging Foundation does not offer commercial support, however,
|
The Open Health Imaging Foundation does not offer commercial support, however,
|
||||||
some community members do offer consulting services:
|
some community members do offer consulting services:
|
||||||
|
|||||||
@@ -29,8 +29,9 @@ module.exports = (env, argv) => {
|
|||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: ROOT_DIR,
|
path: ROOT_DIR,
|
||||||
library: 'ohifExtensionCornerstone',
|
library: 'OHIFExtCornerstone',
|
||||||
libraryTarget: 'umd',
|
libraryTarget: 'umd',
|
||||||
|
libraryExport: 'default',
|
||||||
filename: pkg.main,
|
filename: pkg.main,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,6 +3,83 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.2.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@1.2.0...@ohif/extension-cornerstone@1.2.1) (2019-09-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* bump cornerstone-tools version in peerDeps ([4afc88c](https://github.com/OHIF/Viewers/commit/4afc88c))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [1.2.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@1.1.1...@ohif/extension-cornerstone@1.2.0) (2019-09-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **Annotate:** Add annotate tool back to toolbar ([26be967](https://github.com/OHIF/Viewers/commit/26be967))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [1.1.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@1.1.0...@ohif/extension-cornerstone@1.1.1) (2019-09-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-cornerstone
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [1.1.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@1.0.1...@ohif/extension-cornerstone@1.1.0) (2019-09-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **BidirectionalTool:** Add BidrectionalTool to "more" menu ([#911](https://github.com/OHIF/Viewers/issues/911)) ([e40cbae](https://github.com/OHIF/Viewers/commit/e40cbae))
|
||||||
|
* **EraserTool:** add eraserTool to @ohif/extension-cornerstone ([#912](https://github.com/OHIF/Viewers/issues/912)) ([698d274](https://github.com/OHIF/Viewers/commit/698d274))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [1.0.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@1.0.0...@ohif/extension-cornerstone@1.0.1) (2019-09-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* simplify runtime-extension usage ([ac5dbda](https://github.com/OHIF/Viewers/commit/ac5dbda))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [1.0.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@0.50.5...@ohif/extension-cornerstone@1.0.0) (2019-09-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* 🎸 Upgraded to cornerstoneTools 4.0 ([86adb51](https://github.com/OHIF/Viewers/commit/86adb51))
|
||||||
|
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
* n
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.5](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@0.50.4...@ohif/extension-cornerstone@0.50.5) (2019-09-06)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-cornerstone
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.50.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@0.50.3...@ohif/extension-cornerstone@0.50.4) (2019-09-04)
|
## [0.50.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@0.50.3...@ohif/extension-cornerstone@0.50.4) (2019-09-04)
|
||||||
|
|
||||||
**Note:** Version bump only for package @ohif/extension-cornerstone
|
**Note:** Version bump only for package @ohif/extension-cornerstone
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/extension-cornerstone",
|
"name": "@ohif/extension-cornerstone",
|
||||||
"version": "0.50.4",
|
"version": "1.2.1",
|
||||||
"description": "OHIF extension for Cornerstone",
|
"description": "OHIF extension for Cornerstone",
|
||||||
"author": "OHIF",
|
"author": "OHIF",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -32,14 +32,14 @@
|
|||||||
"@ohif/ui": "^0.50.0",
|
"@ohif/ui": "^0.50.0",
|
||||||
"cornerstone-core": "^2.2.8",
|
"cornerstone-core": "^2.2.8",
|
||||||
"cornerstone-math": "^0.1.8",
|
"cornerstone-math": "^0.1.8",
|
||||||
"cornerstone-tools": "^3.1.0",
|
"cornerstone-tools": "^4.0.9",
|
||||||
"cornerstone-wado-image-loader": "^3.0.0",
|
"cornerstone-wado-image-loader": "^3.0.0",
|
||||||
"dcmjs": "^0.3.8",
|
"dcmjs": "^0.6.1",
|
||||||
"dicom-parser": "^1.8.3",
|
"dicom-parser": "^1.8.3",
|
||||||
"hammerjs": "^2.0.8",
|
"hammerjs": "^2.0.8",
|
||||||
"prop-types": "^15.6.2",
|
"prop-types": "^15.6.2",
|
||||||
"react": "^15.0.0 || ^16.0.0",
|
"react": "^16.8.6",
|
||||||
"react-dom": "^15.0.0 || ^16.0.0",
|
"react-dom": "^16.8.6",
|
||||||
"react-redux": "^6.0.0",
|
"react-redux": "^6.0.0",
|
||||||
"react-resize-detector": "^3.4.0",
|
"react-resize-detector": "^3.4.0",
|
||||||
"redux": "^4.0.1"
|
"redux": "^4.0.1"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import * as dcmjs from "dcmjs";
|
import * as dcmjs from 'dcmjs';
|
||||||
|
|
||||||
import OHIF from "@ohif/core";
|
import OHIF from '@ohif/core';
|
||||||
import cornerstone from "cornerstone-core";
|
import cornerstone from 'cornerstone-core';
|
||||||
import cornerstoneTools from "cornerstone-tools";
|
import cornerstoneTools from 'cornerstone-tools';
|
||||||
|
|
||||||
const { StackManager } = OHIF.utils;
|
const { StackManager } = OHIF.utils;
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ function retrieveDicomData(wadoUri) {
|
|||||||
// TODO: Authorization header depends on the server. If we ever have multiple servers
|
// TODO: Authorization header depends on the server. If we ever have multiple servers
|
||||||
// we will need to figure out how / when to pass this information in.
|
// we will need to figure out how / when to pass this information in.
|
||||||
return fetch(wadoUri, {
|
return fetch(wadoUri, {
|
||||||
headers: OHIF.DICOMWeb.getAuthorizationHeader()
|
headers: OHIF.DICOMWeb.getAuthorizationHeader(),
|
||||||
}).then(response => response.arrayBuffer());
|
}).then(response => response.arrayBuffer());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ async function handleSegmentationStorage(
|
|||||||
|
|
||||||
if (displaySets.length > 1) {
|
if (displaySets.length > 1) {
|
||||||
console.warn(
|
console.warn(
|
||||||
"More than one display set with the same seriesInstanceUid. This is not supported yet..."
|
'More than one display set with the same seriesInstanceUid. This is not supported yet...'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,17 +100,19 @@ async function handleSegmentationStorage(
|
|||||||
const results = parseSeg(arrayBuffer, imageIds);
|
const results = parseSeg(arrayBuffer, imageIds);
|
||||||
|
|
||||||
if (!results) {
|
if (!results) {
|
||||||
throw new Error("Fractional segmentations are not supported");
|
throw new Error('Fractional segmentations are not supported');
|
||||||
}
|
}
|
||||||
|
|
||||||
const { segMetadata, toolState } = results;
|
const { labelmapBuffer, segMetadata, segmentsOnFrame } = results;
|
||||||
|
const { setters } = cornerstoneTools.getModule('segmentation');
|
||||||
|
|
||||||
segMetadata.seriesInstanceUid = seriesInstanceUid;
|
setters.labelmap3DByFirstImageId(
|
||||||
|
imageIds[0],
|
||||||
addSegMetadataToCornerstoneToolState(
|
labelmapBuffer,
|
||||||
|
0, // TODO -> Can define a color LUT based on colors in the SEG later.
|
||||||
segMetadata,
|
segMetadata,
|
||||||
toolState,
|
imageIds.length,
|
||||||
displaySetInstanceUid
|
segmentsOnFrame
|
||||||
);
|
);
|
||||||
|
|
||||||
const cachedStack = StackManager.findOrCreateStack(
|
const cachedStack = StackManager.findOrCreateStack(
|
||||||
@@ -118,12 +120,13 @@ async function handleSegmentationStorage(
|
|||||||
referenceDisplaySet
|
referenceDisplaySet
|
||||||
);
|
);
|
||||||
const stack = Object.assign({}, cachedStack);
|
const stack = Object.assign({}, cachedStack);
|
||||||
|
|
||||||
stack.currentImageIdIndex = 0;
|
stack.currentImageIdIndex = 0;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
studyInstanceUid,
|
studyInstanceUid,
|
||||||
displaySetInstanceUid,
|
displaySetInstanceUid,
|
||||||
stack
|
stack,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
// - Include SVG Source/Inline?
|
// - Include SVG Source/Inline?
|
||||||
// - By URL, or own component?
|
// - By URL, or own component?
|
||||||
|
|
||||||
// TODO: `ohif-core` toolbar builder?
|
|
||||||
|
|
||||||
// What KINDS of toolbar buttons do we have...
|
// What KINDS of toolbar buttons do we have...
|
||||||
// - One's that dispatch commands
|
// - One's that dispatch commands
|
||||||
// - One's that set tool's active
|
// - One's that set tool's active
|
||||||
@@ -71,6 +69,15 @@ const definitions = [
|
|||||||
commandName: 'setToolActive',
|
commandName: 'setToolActive',
|
||||||
commandOptions: { toolName: 'Length' },
|
commandOptions: { toolName: 'Length' },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'ArrowAnnotate',
|
||||||
|
label: 'Annotate',
|
||||||
|
icon: 'measure-non-target',
|
||||||
|
//
|
||||||
|
type: TOOLBAR_BUTTON_TYPES.COMMAND,
|
||||||
|
commandName: 'setToolActive',
|
||||||
|
commandOptions: { toolName: 'ArrowAnnotate' },
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'Angle',
|
id: 'Angle',
|
||||||
label: 'Angle',
|
label: 'Angle',
|
||||||
@@ -188,6 +195,24 @@ const definitions = [
|
|||||||
type: TOOLBAR_BUTTON_TYPES.COMMAND,
|
type: TOOLBAR_BUTTON_TYPES.COMMAND,
|
||||||
commandName: 'clearAnnotations',
|
commandName: 'clearAnnotations',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'Bidirectional',
|
||||||
|
label: 'Bidirectional',
|
||||||
|
icon: 'measure-target',
|
||||||
|
//
|
||||||
|
type: TOOLBAR_BUTTON_TYPES.COMMAND,
|
||||||
|
commandName: 'setToolActive',
|
||||||
|
commandOptions: { toolName: 'Bidirectional' },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'Eraser',
|
||||||
|
label: 'Eraser',
|
||||||
|
icon: 'eraser',
|
||||||
|
//
|
||||||
|
type: TOOLBAR_BUTTON_TYPES.COMMAND,
|
||||||
|
commandName: 'setToolActive',
|
||||||
|
commandOptions: { toolName: 'Eraser' },
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -29,8 +29,9 @@ module.exports = (env, argv) => {
|
|||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: ROOT_DIR,
|
path: ROOT_DIR,
|
||||||
library: 'ohifExtensionDicomHtml',
|
library: 'OHIFExtDicomHtml',
|
||||||
libraryTarget: 'umd',
|
libraryTarget: 'umd',
|
||||||
|
libraryExport: 'default',
|
||||||
filename: pkg.main,
|
filename: pkg.main,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,6 +3,44 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [0.50.7](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.50.6...@ohif/extension-dicom-html@0.50.7) (2019-09-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-dicom-html
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.6](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.50.5...@ohif/extension-dicom-html@0.50.6) (2019-09-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* simplify runtime-extension usage ([ac5dbda](https://github.com/OHIF/Viewers/commit/ac5dbda))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.5](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.50.4...@ohif/extension-dicom-html@0.50.5) (2019-09-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-dicom-html
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.50.3...@ohif/extension-dicom-html@0.50.4) (2019-09-06)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* set NODE_ENV for production build ([9120db4](https://github.com/OHIF/Viewers/commit/9120db4))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.50.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.50.2...@ohif/extension-dicom-html@0.50.3) (2019-09-04)
|
## [0.50.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.50.2...@ohif/extension-dicom-html@0.50.3) (2019-09-04)
|
||||||
|
|
||||||
**Note:** Version bump only for package @ohif/extension-dicom-html
|
**Note:** Version bump only for package @ohif/extension-dicom-html
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/extension-dicom-html",
|
"name": "@ohif/extension-dicom-html",
|
||||||
"version": "0.50.3",
|
"version": "0.50.7",
|
||||||
"description": "OHIF extension for rendering structured reports to HTML",
|
"description": "OHIF extension for rendering structured reports to HTML",
|
||||||
"author": "OHIF",
|
"author": "OHIF",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -20,19 +20,19 @@
|
|||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "cross-env NODE_ENV=production webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo",
|
"dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo",
|
||||||
"dev:dicom-html": "yarn run dev",
|
"dev:dicom-html": "yarn run dev",
|
||||||
"build": "webpack --config .webpack/webpack.prod.js",
|
"build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js",
|
||||||
"build:package": "yarn run build",
|
"build:package": "yarn run build",
|
||||||
"prepublishOnly": "yarn run build",
|
"prepublishOnly": "yarn run build",
|
||||||
"start": "yarn run dev"
|
"start": "yarn run dev"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@ohif/core": "^0.50.0",
|
"@ohif/core": "^0.50.0",
|
||||||
"dcmjs": "^0.3.3",
|
"dcmjs": "^0.6.1",
|
||||||
"prop-types": "^15.6.2",
|
"prop-types": "^15.6.2",
|
||||||
"react": "^15.0.0 || ^16.0.0",
|
"react": "^16.8.6",
|
||||||
"react-dom": "^15.0.0 || ^16.0.0"
|
"react-dom": "^16.8.6"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.5.5"
|
"@babel/runtime": "^7.5.5"
|
||||||
|
|||||||
@@ -29,8 +29,9 @@ module.exports = (env, argv) => {
|
|||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: ROOT_DIR,
|
path: ROOT_DIR,
|
||||||
library: 'ohifExtensionDicomMicroscopy',
|
library: 'OHIFExtDicomMicroscopy',
|
||||||
libraryTarget: 'umd',
|
libraryTarget: 'umd',
|
||||||
|
libraryExport: 'default',
|
||||||
filename: pkg.main,
|
filename: pkg.main,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,6 +3,17 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [0.50.5](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-microscopy@0.50.4...@ohif/extension-dicom-microscopy@0.50.5) (2019-09-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* simplify runtime-extension usage ([ac5dbda](https://github.com/OHIF/Viewers/commit/ac5dbda))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.50.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-microscopy@0.50.3...@ohif/extension-dicom-microscopy@0.50.4) (2019-09-04)
|
## [0.50.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-microscopy@0.50.3...@ohif/extension-dicom-microscopy@0.50.4) (2019-09-04)
|
||||||
|
|
||||||
**Note:** Version bump only for package @ohif/extension-dicom-microscopy
|
**Note:** Version bump only for package @ohif/extension-dicom-microscopy
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/extension-dicom-microscopy",
|
"name": "@ohif/extension-dicom-microscopy",
|
||||||
"version": "0.50.4",
|
"version": "0.50.5",
|
||||||
"description": "OHIF extension for Dicom Microscopy",
|
"description": "OHIF extension for Dicom Microscopy",
|
||||||
"author": "OHIF",
|
"author": "OHIF",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -29,8 +29,8 @@
|
|||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@ohif/core": "^0.50.0",
|
"@ohif/core": "^0.50.0",
|
||||||
"react": "^15.0.0 || ^16.0.0",
|
"react": "^16.8.6",
|
||||||
"react-dom": "^15.0.0 || ^16.0.0"
|
"react-dom": "^16.8.6"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.5.5",
|
"@babel/runtime": "^7.5.5",
|
||||||
|
|||||||
@@ -29,8 +29,9 @@ module.exports = (env, argv) => {
|
|||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: ROOT_DIR,
|
path: ROOT_DIR,
|
||||||
library: 'ohifExtensionDicomPdf',
|
library: 'OHIFExtDicomPdf',
|
||||||
libraryTarget: 'umd',
|
libraryTarget: 'umd',
|
||||||
|
libraryExport: 'default',
|
||||||
filename: pkg.main,
|
filename: pkg.main,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,6 +3,17 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [0.50.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-pdf@0.50.3...@ohif/extension-dicom-pdf@0.50.4) (2019-09-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* simplify runtime-extension usage ([ac5dbda](https://github.com/OHIF/Viewers/commit/ac5dbda))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.50.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-pdf@0.50.2...@ohif/extension-dicom-pdf@0.50.3) (2019-09-04)
|
## [0.50.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-pdf@0.50.2...@ohif/extension-dicom-pdf@0.50.3) (2019-09-04)
|
||||||
|
|
||||||
**Note:** Version bump only for package @ohif/extension-dicom-pdf
|
**Note:** Version bump only for package @ohif/extension-dicom-pdf
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/extension-dicom-pdf",
|
"name": "@ohif/extension-dicom-pdf",
|
||||||
"version": "0.50.3",
|
"version": "0.50.4",
|
||||||
"description": "OHIF extension for Dicom PDF",
|
"description": "OHIF extension for Dicom PDF",
|
||||||
"author": "OHIF",
|
"author": "OHIF",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -31,8 +31,8 @@
|
|||||||
"@ohif/core": "^0.50.0",
|
"@ohif/core": "^0.50.0",
|
||||||
"dicom-parser": "^1.8.3",
|
"dicom-parser": "^1.8.3",
|
||||||
"prop-types": "^15.6.2",
|
"prop-types": "^15.6.2",
|
||||||
"react": "^15.0.0 || ^16.0.0",
|
"react": "^16.8.6",
|
||||||
"react-dom": "^15.0.0 || ^16.0.0"
|
"react-dom": "^16.8.6"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.5.5",
|
"@babel/runtime": "^7.5.5",
|
||||||
|
|||||||
@@ -29,8 +29,9 @@ module.exports = (env, argv) => {
|
|||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: ROOT_DIR,
|
path: ROOT_DIR,
|
||||||
library: 'ohifExtensionVtk',
|
library: 'OHIFExtVtk',
|
||||||
libraryTarget: 'umd',
|
libraryTarget: 'umd',
|
||||||
|
libraryExport: 'default',
|
||||||
filename: pkg.main,
|
filename: pkg.main,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,6 +3,107 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [0.50.17](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.50.16...@ohif/extension-vtk@0.50.17) (2019-09-19)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.16](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.50.15...@ohif/extension-vtk@0.50.16) (2019-09-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Set transfer function range to data range when loading volumes in VTK ([#930](https://github.com/OHIF/Viewers/issues/930)) ([2341b32](https://github.com/OHIF/Viewers/commit/2341b32))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.15](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.50.14...@ohif/extension-vtk@0.50.15) (2019-09-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Bump VTK viewport dependency ([#929](https://github.com/OHIF/Viewers/issues/929)) ([66a0aad](https://github.com/OHIF/Viewers/commit/66a0aad))
|
||||||
|
* Stop adding empty labelmap to VTK Viewports for now. Wait until paint tools are implemented ([#926](https://github.com/OHIF/Viewers/issues/926)) ([7f642a0](https://github.com/OHIF/Viewers/commit/7f642a0))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.14](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.50.13...@ohif/extension-vtk@0.50.14) (2019-09-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* bump cornerstone-tools version in peerDeps ([4afc88c](https://github.com/OHIF/Viewers/commit/4afc88c))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.13](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.50.12...@ohif/extension-vtk@0.50.13) (2019-09-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.12](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.50.11...@ohif/extension-vtk@0.50.12) (2019-09-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.11](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.50.10...@ohif/extension-vtk@0.50.11) (2019-09-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* simplify runtime-extension usage ([ac5dbda](https://github.com/OHIF/Viewers/commit/ac5dbda))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.10](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.50.9...@ohif/extension-vtk@0.50.10) (2019-09-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.9](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.50.8...@ohif/extension-vtk@0.50.9) (2019-09-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.8](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.50.7...@ohif/extension-vtk@0.50.8) (2019-09-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.7](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.50.6...@ohif/extension-vtk@0.50.7) (2019-09-06)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.50.6](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.50.5...@ohif/extension-vtk@0.50.6) (2019-09-04)
|
## [0.50.6](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.50.5...@ohif/extension-vtk@0.50.6) (2019-09-04)
|
||||||
|
|
||||||
**Note:** Version bump only for package @ohif/extension-vtk
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/extension-vtk",
|
"name": "@ohif/extension-vtk",
|
||||||
"version": "0.50.6",
|
"version": "0.50.17",
|
||||||
"description": "OHIF extension for VTK.js",
|
"description": "OHIF extension for VTK.js",
|
||||||
"author": "OHIF",
|
"author": "OHIF",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
"@ohif/ui": "^0.50.0",
|
"@ohif/ui": "^0.50.0",
|
||||||
"cornerstone-core": "^2.2.8",
|
"cornerstone-core": "^2.2.8",
|
||||||
"cornerstone-wado-image-loader": "^3.0.0",
|
"cornerstone-wado-image-loader": "^3.0.0",
|
||||||
"dcmjs": "^0.4.7",
|
"dcmjs": "^0.6.1",
|
||||||
"dicom-parser": "^1.8.3",
|
"dicom-parser": "^1.8.3",
|
||||||
"i18next": "^17.0.3",
|
"i18next": "^17.0.3",
|
||||||
"i18next-browser-languagedetector": "^3.0.1",
|
"i18next-browser-languagedetector": "^3.0.1",
|
||||||
@@ -48,14 +48,14 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.5.5",
|
"@babel/runtime": "^7.5.5",
|
||||||
"react-vtkjs-viewport": "0.0.11"
|
"react-vtkjs-viewport": "0.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@ohif/core": "^0.50.5",
|
"@ohif/core": "^0.50.9",
|
||||||
"@ohif/ui": "^0.50.3",
|
"@ohif/ui": "^0.51.1",
|
||||||
"cornerstone-tools": "^3.13.0",
|
"cornerstone-tools": "^4.0.9",
|
||||||
"cornerstone-wado-image-loader": "^3.0.0",
|
"cornerstone-wado-image-loader": "^3.0.0",
|
||||||
"dcmjs": "^0.5.1",
|
"dcmjs": "^0.6.1",
|
||||||
"dicom-parser": "^1.8.3",
|
"dicom-parser": "^1.8.3",
|
||||||
"gh-pages": "^2.0.1",
|
"gh-pages": "^2.0.1",
|
||||||
"i18next": "^17.0.3",
|
"i18next": "^17.0.3",
|
||||||
|
|||||||
@@ -189,6 +189,11 @@ class OHIFVTKViewport extends Component {
|
|||||||
volumeActor.setMapper(volumeMapper);
|
volumeActor.setMapper(volumeMapper);
|
||||||
volumeMapper.setInputData(data);
|
volumeMapper.setInputData(data);
|
||||||
|
|
||||||
|
const range = data.getPointData().getScalars().getRange();
|
||||||
|
|
||||||
|
// TODO: For PET we might want to just set this to 0-5 SUV
|
||||||
|
volumeActor.getProperty().getRGBTransferFunction(0).setRange(range[0], range[1]);
|
||||||
|
|
||||||
// TODO: Should look into implementing autoAdjustSampleDistance in vtk
|
// TODO: Should look into implementing autoAdjustSampleDistance in vtk
|
||||||
const sampleDistance =
|
const sampleDistance =
|
||||||
1.2 *
|
1.2 *
|
||||||
@@ -233,9 +238,11 @@ class OHIFVTKViewport extends Component {
|
|||||||
frameIndex
|
frameIndex
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!labelmap) {
|
// TODO: Temporarily disabling this since it is not yet
|
||||||
|
// being used and hurts performance significantly.
|
||||||
|
/*if (!labelmap) {
|
||||||
labelmap = createLabelMapImageData(data);
|
labelmap = createLabelMapImageData(data);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
const volumeActor = this.getOrCreateVolume(data, displaySetInstanceUid);
|
const volumeActor = this.getOrCreateVolume(data, displaySetInstanceUid);
|
||||||
|
|
||||||
|
|||||||
+1
-20
@@ -3,7 +3,7 @@
|
|||||||
# TOML Reference:
|
# TOML Reference:
|
||||||
# https://www.netlify.com/docs/netlify-toml-reference/
|
# https://www.netlify.com/docs/netlify-toml-reference/
|
||||||
#
|
#
|
||||||
# We use Netlify for deploy previews and deploy previews only.
|
# We use Netlify for deploy previews and for publishing docs (gh-pages branch).
|
||||||
# https://viewer.ohif.org is created using a different process that is
|
# https://viewer.ohif.org is created using a different process that is
|
||||||
# managed by CircleCI and deployed to our Google Hosting
|
# managed by CircleCI and deployed to our Google Hosting
|
||||||
#
|
#
|
||||||
@@ -40,25 +40,6 @@
|
|||||||
publish = ".netlify/www/"
|
publish = ".netlify/www/"
|
||||||
command = "yarn config set workspaces-experimental true && chmod +x .netlify/build-deploy-preview.sh && .netlify/build-deploy-preview.sh"
|
command = "yarn config set workspaces-experimental true && chmod +x .netlify/build-deploy-preview.sh && .netlify/build-deploy-preview.sh"
|
||||||
|
|
||||||
# Redirects and headers are GLOBAL for all builds – they do not get scoped to
|
|
||||||
# contexts no matter where you define them in the file.
|
|
||||||
# For context-specific rules, use _headers or _redirects files, which are
|
|
||||||
# PER-DEPLOY.
|
|
||||||
# The following redirect is intended for use with most SPAs that handle
|
|
||||||
# routing internally.
|
|
||||||
# By default, redirects won't be applied if there's a file with the same
|
|
||||||
# path as the one defined in the `from` property. Setting `force` to `true`
|
|
||||||
# will make the redirect rule take precedence over any existing files.
|
|
||||||
[[redirects]]
|
|
||||||
from = "/*"
|
|
||||||
to = "/index.html"
|
|
||||||
status = 200
|
|
||||||
|
|
||||||
[[redirects]]
|
|
||||||
from = "/pwa/*"
|
|
||||||
to = "/pwa/index.html"
|
|
||||||
status = 200
|
|
||||||
|
|
||||||
[[headers]]
|
[[headers]]
|
||||||
# Define which paths this specific [[headers]] block will cover.
|
# Define which paths this specific [[headers]] block will cover.
|
||||||
for = "/*"
|
for = "/*"
|
||||||
|
|||||||
+7
-1
@@ -13,6 +13,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"cm": "npx git-cz",
|
"cm": "npx git-cz",
|
||||||
"build": "lerna run build:viewer --stream",
|
"build": "lerna run build:viewer --stream",
|
||||||
|
"build:e2e": "lerna run build:viewer:e2e --stream",
|
||||||
"build:ci": "lerna run build:viewer:ci --stream",
|
"build:ci": "lerna run build:viewer:ci --stream",
|
||||||
"build:demo": "lerna run build:viewer:demo --stream",
|
"build:demo": "lerna run build:viewer:demo --stream",
|
||||||
"build:package": "lerna run build:viewer:package --stream",
|
"build:package": "lerna run build:viewer:package --stream",
|
||||||
@@ -24,11 +25,14 @@
|
|||||||
"test": "yarn run test:unit",
|
"test": "yarn run test:unit",
|
||||||
"test:unit": "jest --collectCoverage",
|
"test:unit": "jest --collectCoverage",
|
||||||
"test:unit:ci": "lerna run test:unit:ci --parallel --stream",
|
"test:unit:ci": "lerna run test:unit:ci --parallel --stream",
|
||||||
|
"test:e2e": "lerna run test:e2e --stream",
|
||||||
|
"test:e2e:dist": "lerna run test:e2e:dist --stream",
|
||||||
"see-changed": "lerna changed",
|
"see-changed": "lerna changed",
|
||||||
"docs:publish": "chmod +x ./build-and-publish-docs.sh && ./build-and-publish-docs.sh",
|
"docs:publish": "chmod +x ./build-and-publish-docs.sh && ./build-and-publish-docs.sh",
|
||||||
"release": "yarn run lerna:version && yarn run lerna:publish",
|
"release": "yarn run lerna:version && yarn run lerna:publish",
|
||||||
"lerna:version": "npx lerna version prerelease --force-publish",
|
"lerna:version": "npx lerna version prerelease --force-publish",
|
||||||
"lerna:publish": "lerna publish from-package --canary --dist-tag canary"
|
"lerna:publish": "lerna publish from-package --canary --dist-tag canary",
|
||||||
|
"link-list": "npm ls --depth=0 --link=true"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.5.5",
|
"@babel/runtime": "^7.5.5",
|
||||||
@@ -78,7 +82,9 @@
|
|||||||
"react-dom": "^16.8.6",
|
"react-dom": "^16.8.6",
|
||||||
"react-hot-loader": "^4.12.11",
|
"react-hot-loader": "^4.12.11",
|
||||||
"redux-testkit": "^1.0.6",
|
"redux-testkit": "^1.0.6",
|
||||||
|
"serve": "^11.1.0",
|
||||||
"shader-loader": "^1.3.1",
|
"shader-loader": "^1.3.1",
|
||||||
|
"start-server-and-test": "^1.10.0",
|
||||||
"style-loader": "^1.0.0",
|
"style-loader": "^1.0.0",
|
||||||
"stylelint": "^10.1.0",
|
"stylelint": "^10.1.0",
|
||||||
"stylelint-config-recommended": "^2.2.0",
|
"stylelint-config-recommended": "^2.2.0",
|
||||||
|
|||||||
@@ -3,6 +3,44 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [0.50.9](https://github.com/OHIF/Viewers/compare/@ohif/core@0.50.8...@ohif/core@0.50.9) (2019-09-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* bump cornerstone-tools version in peerDeps ([4afc88c](https://github.com/OHIF/Viewers/commit/4afc88c))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.8](https://github.com/OHIF/Viewers/compare/@ohif/core@0.50.7...@ohif/core@0.50.8) (2019-09-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/core
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.7](https://github.com/OHIF/Viewers/compare/@ohif/core@0.50.6...@ohif/core@0.50.7) (2019-09-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* remove requestOptions when key is not needed ([32bc47d](https://github.com/OHIF/Viewers/commit/32bc47d))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.6](https://github.com/OHIF/Viewers/compare/@ohif/core@0.50.5...@ohif/core@0.50.6) (2019-09-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/core
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.50.5](https://github.com/OHIF/Viewers/compare/@ohif/core@0.50.4...@ohif/core@0.50.5) (2019-09-04)
|
## [0.50.5](https://github.com/OHIF/Viewers/compare/@ohif/core@0.50.4...@ohif/core@0.50.5) (2019-09-04)
|
||||||
|
|
||||||
**Note:** Version bump only for package @ohif/core
|
**Note:** Version bump only for package @ohif/core
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ can be used with Vue, React, Vanilla JS, or any number of other frameworks.
|
|||||||
|
|
||||||
The documentation for this library is sparse. The best way to get started is to
|
The documentation for this library is sparse. The best way to get started is to
|
||||||
look at its
|
look at its
|
||||||
[top level exports](https://github.com/OHIF/ohif-core/blob/master/src/index.js),
|
[top level exports](https://github.com/OHIF/Viewers/blob/master/platform/core/src/index.js),
|
||||||
and explore the source code of features that interest you. If you want to see
|
and explore the source code of features that interest you. If you want to see
|
||||||
how we use this library, you can check out [our viewer
|
how we use this library, you can check out [our viewer
|
||||||
implementation][react-viewer].
|
implementation][react-viewer].
|
||||||
@@ -57,12 +57,12 @@ yarn add @ohif/core --exact
|
|||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
Usage is dependent on the feature(s) you want to leverage. The bulk of
|
Usage is dependent on the feature(s) you want to leverage. The bulk of
|
||||||
`ohif-core`'s features are "pure" and can be imported and used in place.
|
`@ohif/core`'s features are "pure" and can be imported and used in place.
|
||||||
|
|
||||||
_Example: retrieving study metadata from a server_
|
_Example: retrieving study metadata from a server_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { studies } from "@ohif/core";
|
import { studies } from '@ohif/core';
|
||||||
|
|
||||||
const studiesMetadata = await studies.retrieveStudiesMetadata(
|
const studiesMetadata = await studies.retrieveStudiesMetadata(
|
||||||
server, // Object
|
server, // Object
|
||||||
@@ -125,11 +125,10 @@ Links:
|
|||||||
|
|
||||||
<!-- prettier-ignore-start -->
|
<!-- prettier-ignore-start -->
|
||||||
<!-- ROW -->
|
<!-- ROW -->
|
||||||
[npm-url]: https://npmjs.org/package/ohif-core
|
[npm-url]: https://npmjs.org/package/@ohif/core
|
||||||
[npm-downloads-image]: https://img.shields.io/npm/dm/ohif-core.svg?style=flat-square
|
[npm-downloads-image]: https://img.shields.io/npm/dm/@ohif/core.svg?style=flat-square
|
||||||
[npm-version-image]: https://img.shields.io/npm/v/ohif-core.svg?style=flat-square
|
[npm-version-image]: https://img.shields.io/npm/v/@ohif/core.svg?style=flat-square
|
||||||
[all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square
|
[all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square
|
||||||
[contributing-url]: https://github.com/OHIF/ohif-core/blob/master/CONTRIBUTING.md
|
|
||||||
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
|
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
|
||||||
[license-url]: LICENSE
|
[license-url]: LICENSE
|
||||||
<!-- Misc. -->
|
<!-- Misc. -->
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/core",
|
"name": "@ohif/core",
|
||||||
"version": "0.50.5",
|
"version": "0.50.9",
|
||||||
"description": "Generic business logic for web-based medical imaging applications",
|
"description": "Generic business logic for web-based medical imaging applications",
|
||||||
"author": "OHIF Core Team",
|
"author": "OHIF Core Team",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"cornerstone-core": "^2.2.8",
|
"cornerstone-core": "^2.2.8",
|
||||||
"cornerstone-tools": "^3.9.0",
|
"cornerstone-tools": "^4.0.9",
|
||||||
"cornerstone-wado-image-loader": "^3.0.0",
|
"cornerstone-wado-image-loader": "^3.0.0",
|
||||||
"dicom-parser": "^1.8.3"
|
"dicom-parser": "^1.8.3"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,17 +6,21 @@ import user from '../user';
|
|||||||
/**
|
/**
|
||||||
* Returns the Authorization header as part of an Object.
|
* Returns the Authorization header as part of an Object.
|
||||||
*
|
*
|
||||||
* @returns {Object}
|
* @export
|
||||||
|
* @param {Object} [server={}]
|
||||||
|
* @param {Object} [server.requestOptions]
|
||||||
|
* @param {string} [server.requestOptions.auth]
|
||||||
|
* @returns {Object} { Authorization }
|
||||||
*/
|
*/
|
||||||
export default function getAuthorizationHeader(server) {
|
export default function getAuthorizationHeader({ requestOptions } = {}) {
|
||||||
const headers = {};
|
const headers = {};
|
||||||
|
|
||||||
// Check for OHIF.user since this can also be run on the server
|
// Check for OHIF.user since this can also be run on the server
|
||||||
const accessToken = user && user.getAccessToken && user.getAccessToken();
|
const accessToken = user && user.getAccessToken && user.getAccessToken();
|
||||||
|
|
||||||
if (server && server.requestOptions && server.requestOptions.auth) {
|
if (requestOptions && requestOptions.auth) {
|
||||||
// HTTP Basic Auth (user:password)
|
// HTTP Basic Auth (user:password)
|
||||||
headers.Authorization = `Basic ${btoa(server.requestOptions.auth)}`;
|
headers.Authorization = `Basic ${btoa(requestOptions.auth)}`;
|
||||||
} else if (accessToken) {
|
} else if (accessToken) {
|
||||||
headers.Authorization = `Bearer ${accessToken}`;
|
headers.Authorization = `Bearer ${accessToken}`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,9 +11,6 @@ describe('addServers', () => {
|
|||||||
qidoSupportsIncludeField: true,
|
qidoSupportsIncludeField: true,
|
||||||
imageRendering: 'wadors',
|
imageRendering: 'wadors',
|
||||||
thumbnailRendering: 'wadors',
|
thumbnailRendering: 'wadors',
|
||||||
requestOptions: {
|
|
||||||
requestFromBrowser: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
oidc: [
|
oidc: [
|
||||||
@@ -52,7 +49,6 @@ describe('addServers', () => {
|
|||||||
name: 'DCM4CHEE',
|
name: 'DCM4CHEE',
|
||||||
qidoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
|
qidoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
|
||||||
qidoSupportsIncludeField: true,
|
qidoSupportsIncludeField: true,
|
||||||
requestOptions: { requestFromBrowser: true },
|
|
||||||
thumbnailRendering: 'wadors',
|
thumbnailRendering: 'wadors',
|
||||||
type: 'dicomWeb',
|
type: 'dicomWeb',
|
||||||
wadoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
|
wadoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [0.50.4](https://github.com/OHIF/Viewers/compare/@ohif/i18n@0.50.3...@ohif/i18n@0.50.4) (2019-09-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/i18n
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.50.3](https://github.com/OHIF/Viewers/compare/@ohif/i18n@0.50.2...@ohif/i18n@0.50.3) (2019-09-04)
|
## [0.50.3](https://github.com/OHIF/Viewers/compare/@ohif/i18n@0.50.2...@ohif/i18n@0.50.3) (2019-09-04)
|
||||||
|
|
||||||
**Note:** Version bump only for package @ohif/i18n
|
**Note:** Version bump only for package @ohif/i18n
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/i18n",
|
"name": "@ohif/i18n",
|
||||||
"version": "0.50.3",
|
"version": "0.50.4",
|
||||||
"description": "Internationalization library for The OHIF Viewer",
|
"description": "Internationalization library for The OHIF Viewer",
|
||||||
"author": "OHIF",
|
"author": "OHIF",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -32,8 +32,8 @@
|
|||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"i18next": "^17.0.3",
|
"i18next": "^17.0.3",
|
||||||
"i18next-browser-languagedetector": "^3.0.1",
|
"i18next-browser-languagedetector": "^3.0.1",
|
||||||
"react": "^16.0.0",
|
"react": "^16.8.6",
|
||||||
"react-dom": "^16.0.0",
|
"react-dom": "^16.8.6",
|
||||||
"react-i18next": "^10.11.0"
|
"react-i18next": "^10.11.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -3,6 +3,36 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [0.51.1](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.51.0...@ohif/ui@0.51.1) (2019-09-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Use HTML5Backend for drag-drop if the device does not support touch ([#927](https://github.com/OHIF/Viewers/issues/927)) ([6fdac4d](https://github.com/OHIF/Viewers/commit/6fdac4d))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [0.51.0](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.50.4...@ohif/ui@0.51.0) (2019-09-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **EraserTool:** add eraserTool to @ohif/extension-cornerstone ([#912](https://github.com/OHIF/Viewers/issues/912)) ([698d274](https://github.com/OHIF/Viewers/commit/698d274))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.4](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.50.3...@ohif/ui@0.50.4) (2019-09-06)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/ui
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.50.3](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.50.2...@ohif/ui@0.50.3) (2019-09-04)
|
## [0.50.3](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.50.2...@ohif/ui@0.50.3) (2019-09-04)
|
||||||
|
|
||||||
**Note:** Version bump only for package @ohif/ui
|
**Note:** Version bump only for package @ohif/ui
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ yarn add @ohif/ui --exact
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
import React, { Component } from "react";
|
import React, { Component } from 'react';
|
||||||
import { LayoutButton } from "@ohif/ui";
|
import { LayoutButton } from '@ohif/ui';
|
||||||
|
|
||||||
class Example extends Component {
|
class Example extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -58,10 +58,10 @@ class Example extends Component {
|
|||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
selectedCell: {
|
selectedCell: {
|
||||||
className: "hover",
|
className: 'hover',
|
||||||
col: 1,
|
col: 1,
|
||||||
row: 1
|
row: 1,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,10 +117,9 @@ Links:
|
|||||||
|
|
||||||
<!-- prettier-ignore-start -->
|
<!-- prettier-ignore-start -->
|
||||||
[all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square
|
[all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square
|
||||||
[contributing-url]: https://github.com/OHIF/react-viewerbase/blob/master/CONTRIBUTING.md
|
[npm-url]: https://npmjs.org/package/@ohif/ui
|
||||||
[npm-url]: https://npmjs.org/package/react-viewerbase
|
[npm-downloads-image]: https://img.shields.io/npm/dm/@ohif/ui.svg?style=flat-square
|
||||||
[npm-downloads-image]: https://img.shields.io/npm/dm/react-viewerbase.svg?style=flat-square
|
[npm-version-image]: https://img.shields.io/npm/v/@ohif/ui.svg?style=flat-square
|
||||||
[npm-version-image]: https://img.shields.io/npm/v/react-viewerbase.svg?style=flat-square
|
|
||||||
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
|
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
|
||||||
[license-url]: LICENSE
|
[license-url]: LICENSE
|
||||||
<!-- prettier-ignore-end -->
|
<!-- prettier-ignore-end -->
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/ui",
|
"name": "@ohif/ui",
|
||||||
"version": "0.50.3",
|
"version": "0.51.1",
|
||||||
"description": "A set of React components for Medical Imaging Viewers",
|
"description": "A set of React components for Medical Imaging Viewers",
|
||||||
"author": "OHIF Contributors",
|
"author": "OHIF Contributors",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -48,8 +48,9 @@
|
|||||||
"prop-types": "15.6.2",
|
"prop-types": "15.6.2",
|
||||||
"react-bootstrap-modal": "4.2.0",
|
"react-bootstrap-modal": "4.2.0",
|
||||||
"react-dates": "18.4.1",
|
"react-dates": "18.4.1",
|
||||||
"react-dnd": "8.0.3",
|
"react-dnd": "9.3.4",
|
||||||
"react-dnd-touch-backend": "^0.8.3",
|
"react-dnd-html5-backend": "^9.3.4",
|
||||||
|
"react-dnd-touch-backend": "^9.3.4",
|
||||||
"react-i18next": "^10.11.0",
|
"react-i18next": "^10.11.0",
|
||||||
"react-with-direction": "1.3.0"
|
"react-with-direction": "1.3.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ route: /compatibility
|
|||||||
|
|
||||||
## Browser Support
|
## Browser Support
|
||||||
|
|
||||||
React Viewerbase relies on
|
`@ohif/ui` relies on
|
||||||
[browsers supported by Styled Components](https://www.styled-components.com/docs/faqs#which-browsers-are-supported)
|
[browsers supported by Styled Components](https://www.styled-components.com/docs/faqs#which-browsers-are-supported)
|
||||||
or browsers supported by emotion.
|
or browsers supported by emotion.
|
||||||
|
|
||||||
|
|||||||
@@ -11,20 +11,20 @@ route: /getting-started
|
|||||||
> possibility of introducing breaking changes. Please depend on an "exact"
|
> possibility of introducing breaking changes. Please depend on an "exact"
|
||||||
> version in your projects to prevent issues caused by loose versioning.
|
> version in your projects to prevent issues caused by loose versioning.
|
||||||
|
|
||||||
Install `react-viewerbase` from npm:
|
Install `@ohif/ui` from npm:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
// with npm
|
// with npm
|
||||||
npm i react-viewerbase --save-exact
|
npm i @ohif/ui --save-exact
|
||||||
|
|
||||||
// with yarn
|
// with yarn
|
||||||
yarn add react-viewerbase --exact
|
yarn add @ohif/ui --exact
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
There is some setup required for `react-viewerbase`. We are working to eliminate
|
There is some setup required for `@ohif/ui`. We are working to eliminate these
|
||||||
these requirements with the goal of providing ready to use components.
|
requirements with the goal of providing ready to use components.
|
||||||
|
|
||||||
### External Dependencies
|
### External Dependencies
|
||||||
|
|
||||||
@@ -37,8 +37,8 @@ or the font you set for your theme:
|
|||||||
'https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700|Sanchez&display=swap';
|
'https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700|Sanchez&display=swap';
|
||||||
```
|
```
|
||||||
|
|
||||||
React Viewerbase also looks for theme CSS variabled defined on `:root`. You can
|
`@ohif/ui` also looks for theme CSS variabled defined on `:root`. You can find a
|
||||||
find a list of variables [on the theming page](/styling-and-theming)
|
list of variables [on the theming page](/styling-and-theming)
|
||||||
|
|
||||||
### Import & Use
|
### Import & Use
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ You can use components in your React app:
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { LayoutButton } from 'react-viewerbase';
|
import { LayoutButton } from '@ohif/ui';
|
||||||
|
|
||||||
class Example extends Component {
|
class Example extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ name: Introduction
|
|||||||
route: /
|
route: /
|
||||||
---
|
---
|
||||||
|
|
||||||
import { Playground, Props } from 'docz'
|
import { Playground, Props } from 'docz';
|
||||||
import { State } from 'react-powerplug'
|
import { State } from 'react-powerplug';
|
||||||
import { TableList, TableListItem } from './../index.js'
|
import { TableList, TableListItem } from './../index.js';
|
||||||
|
|
||||||
# Introduction
|
# Introduction
|
||||||
|
|
||||||
**React Viewerbase is a collection of components and utilities** that power
|
**@ohif/ui is a collection of components and utilities** that power OHIF's
|
||||||
OHIF's [zero-footprint DICOM viewer](https://github.com/OHIF/Viewers)
|
[zero-footprint DICOM viewer](https://github.com/OHIF/Viewers)
|
||||||
([demo][demo-url]). We maintain them as a separate component library to:
|
([demo][demo-url]). We maintain them as a separate component library to:
|
||||||
|
|
||||||
- Decouple presentation from business logic
|
- Decouple presentation from business logic
|
||||||
@@ -25,11 +25,11 @@ OHIF's [zero-footprint DICOM viewer](https://github.com/OHIF/Viewers)
|
|||||||
> version in your projects to prevent issues caused by loose versioning.
|
> version in your projects to prevent issues caused by loose versioning.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// Add 'react-viewerbase' as a dependency
|
// Add '@ohif/ui' as a dependency
|
||||||
yarn add react-viewerbase
|
yarn add @ohif/ui
|
||||||
|
|
||||||
// Import and use components
|
// Import and use components
|
||||||
import { TableList } from 'react-viewerbase'
|
import { TableList } from '@ohif/ui'
|
||||||
```
|
```
|
||||||
|
|
||||||
<Playground>
|
<Playground>
|
||||||
@@ -56,7 +56,7 @@ import { TableList } from 'react-viewerbase'
|
|||||||
>
|
>
|
||||||
<label>{item.label}</label>
|
<label>{item.label}</label>
|
||||||
</TableListItem>
|
</TableListItem>
|
||||||
)
|
);
|
||||||
})}
|
})}
|
||||||
</TableList>
|
</TableList>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -36,9 +36,9 @@ export default withTranslation('MyNameSpace')(MyComponent);
|
|||||||
For further information about namespaces and how they work, please visit
|
For further information about namespaces and how they work, please visit
|
||||||
[OHIF Namespaces docs](https://docs.ohif.org/essentials/translating.html#namespaces).
|
[OHIF Namespaces docs](https://docs.ohif.org/essentials/translating.html#namespaces).
|
||||||
|
|
||||||
### How to get right the Name Space of a react-viewerbase component?
|
### How to get right the Namespace of a `@ohif/ui` component?
|
||||||
|
|
||||||
Check the component's page in this site, the NameSpace information should be on
|
Check the component's page in this site, the Namespace information should be on
|
||||||
the bottom line.
|
the bottom line.
|
||||||
|
|
||||||
Also, a nameSpace is defined when exporting a component, this information can be
|
Also, a nameSpace is defined when exporting a component, this information can be
|
||||||
@@ -50,10 +50,10 @@ E.g.
|
|||||||
export default withTranslation('TheNamespaceYouAreLookingFor')(TheComponentYouWantToUse);
|
export default withTranslation('TheNamespaceYouAreLookingFor')(TheComponentYouWantToUse);
|
||||||
```
|
```
|
||||||
|
|
||||||
### How to use another NameSpace inside the current NameSpace?
|
### How to use another Namespace inside the current Namespace?
|
||||||
|
|
||||||
i18next provides a parsing feature able to get translations strings from any
|
i18next provides a parsing feature able to get translations strings from any
|
||||||
NameSpace, like this following example getting data from `InnerSpace` NameSpace:
|
Namespace, like this following example getting data from `InnerSpace` Namespace:
|
||||||
|
|
||||||
```
|
```
|
||||||
$t(InnerSpace:Reset)
|
$t(InnerSpace:Reset)
|
||||||
@@ -64,8 +64,8 @@ export default withTranslation('OuterSpace')(TheComponent);
|
|||||||
|
|
||||||
## I18next Provider
|
## I18next Provider
|
||||||
|
|
||||||
**React Viewerbase** pass down the `t` function trough the custom
|
**@ohif/ui** pass down the `t` function trough the custom
|
||||||
[withTranslation HOC](https://github.com/OHIF/react-viewerbase/blob/master/src/utils/LanguageProvider.js).
|
[withTranslation HOC](https://github.com/OHIF/Viewers/blob/master/platform/ui/src/utils/LanguageProvider.js).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -121,11 +121,6 @@ class CineDialog extends PureComponent {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO:
|
|
||||||
// - Add next / previous display set buttons which just call
|
|
||||||
// onClickNextDisplaySet and onClickPreviousDisplaySet which are passed in as props.
|
|
||||||
// See https://github.com/OHIF/Viewers/blob/master/Packages/ohif-viewerbase/client/components/viewer/cineDialog/cineDialog.html#L38
|
|
||||||
// - Add 'isEnabled' prop: https://github.com/OHIF/Viewers/blob/master/Packages/ohif-viewerbase/client/components/viewer/cineDialog/cineDialog.js#L301
|
|
||||||
render() {
|
render() {
|
||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import edit from './icons/edit.svg';
|
|||||||
import ellipseCircle from './icons/ellipse-circle.svg';
|
import ellipseCircle from './icons/ellipse-circle.svg';
|
||||||
import ellipseH from './icons/ellipse-h.svg';
|
import ellipseH from './icons/ellipse-h.svg';
|
||||||
import ellipseV from './icons/ellipse-v.svg';
|
import ellipseV from './icons/ellipse-v.svg';
|
||||||
|
import eraser from './icons/eraser.svg';
|
||||||
import exclamationCircle from './icons/exclamation-circle.svg';
|
import exclamationCircle from './icons/exclamation-circle.svg';
|
||||||
import exclamationTriangle from './icons/exclamation-triangle.svg';
|
import exclamationTriangle from './icons/exclamation-triangle.svg';
|
||||||
import fastBackward from './icons/fast-backward.svg';
|
import fastBackward from './icons/fast-backward.svg';
|
||||||
@@ -110,6 +111,7 @@ const ICONS = {
|
|||||||
'create-comment': createComment,
|
'create-comment': createComment,
|
||||||
'create-screen-capture': createScreenCapture,
|
'create-screen-capture': createScreenCapture,
|
||||||
edit,
|
edit,
|
||||||
|
eraser,
|
||||||
'fast-backward': fastBackward,
|
'fast-backward': fastBackward,
|
||||||
'fast-forward': fastForward,
|
'fast-forward': fastForward,
|
||||||
'object-group': objectGroup,
|
'object-group': objectGroup,
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 2048 1792"
|
||||||
|
aria-labelledby="eraser"
|
||||||
|
width="1em"
|
||||||
|
height="1em"
|
||||||
|
fill="currentColor"
|
||||||
|
>
|
||||||
|
<title id="title">Eraser</title>
|
||||||
|
<path transform="translate(0,1792) scale(1,-1)" fill="ACTIVE_COLOR" d="M960 1408l336-384h-768l-336 384h768zm1013-1077q15
|
||||||
|
34 9.5 71.5t-30.5 65.5l-896 1024q-38 44-96 44h-768q-38
|
||||||
|
0-69.5-20.5t-47.5-54.5q-15-34-9.5-71.5t30.5-65.5l896-1024q38-44 96-44h768q38
|
||||||
|
0 69.5 20.5t47.5 54.5z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 492 B |
@@ -1,13 +1,20 @@
|
|||||||
import { DragDropContext } from 'react-dnd';
|
import React from 'react';
|
||||||
|
import { DndProvider } from "react-dnd";
|
||||||
|
import HTML5Backend from 'react-dnd-html5-backend';
|
||||||
import TouchBackend from 'react-dnd-touch-backend';
|
import TouchBackend from 'react-dnd-touch-backend';
|
||||||
|
|
||||||
|
const isTouchDevice = !!('ontouchstart' in window || navigator.maxTouchPoints);
|
||||||
|
|
||||||
// See https://github.com/react-dnd/react-dnd/issues/186#issuecomment-335429067
|
// See https://github.com/react-dnd/react-dnd/issues/186#issuecomment-335429067
|
||||||
// https://github.com/react-dnd/react-dnd/issues/186#issuecomment-282789420
|
// https://github.com/react-dnd/react-dnd/issues/186#issuecomment-282789420
|
||||||
// TODO: Find a way for this context to be used in the parent application as well.
|
//
|
||||||
|
|
||||||
// http://react-dnd.github.io/react-dnd/docs/api/drag-drop-context
|
// http://react-dnd.github.io/react-dnd/docs/api/drag-drop-context
|
||||||
export default function viewerbaseDragDropContext(DecoratedClass) {
|
export default function viewerbaseDragDropContext(DecoratedClass) {
|
||||||
return DragDropContext(TouchBackend({ enableMouseEvents: true }), null, true)(
|
const backend = isTouchDevice ? TouchBackend({ enableMouseEvents: true }) : HTML5Backend;
|
||||||
DecoratedClass
|
|
||||||
|
return (props) => (
|
||||||
|
<DndProvider backend={backend}>
|
||||||
|
<DecoratedClass {...props}/>
|
||||||
|
</DndProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -4,16 +4,21 @@ const webpackCommon = require('./../../../.webpack/webpack.commonjs.js');
|
|||||||
//
|
//
|
||||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||||
const fontsToJavaScriptRule = require('./rules/fontsToJavaScript.js');
|
const fontsToJavaScriptRule = require('./rules/fontsToJavaScript.js');
|
||||||
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
// const
|
// const
|
||||||
const SRC_DIR = path.join(__dirname, '../src');
|
const SRC_DIR = path.join(__dirname, '../src');
|
||||||
const DIST_DIR = path.join(__dirname, '../dist');
|
const DIST_DIR = path.join(__dirname, '../dist');
|
||||||
|
const PUBLIC_DIR = path.join(__dirname, '../public');
|
||||||
|
// ~~ Env Vars
|
||||||
|
const HTML_TEMPLATE = process.env.HTML_TEMPLATE || 'script-tag.html';
|
||||||
|
const PUBLIC_URL = process.env.PUBLIC_URL || '/';
|
||||||
|
|
||||||
module.exports = (env, argv) => {
|
module.exports = (env, argv) => {
|
||||||
const commonConfig = webpackCommon(env, argv, { SRC_DIR, DIST_DIR });
|
const commonConfig = webpackCommon(env, argv, { SRC_DIR, DIST_DIR });
|
||||||
|
|
||||||
return merge(commonConfig, {
|
return merge(commonConfig, {
|
||||||
entry: {
|
entry: {
|
||||||
bundle: `${SRC_DIR}/index-umd.js`,
|
app: `${SRC_DIR}/index-umd.js`,
|
||||||
},
|
},
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
stats: {
|
stats: {
|
||||||
@@ -33,7 +38,7 @@ module.exports = (env, argv) => {
|
|||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: DIST_DIR,
|
path: DIST_DIR,
|
||||||
library: 'ohifViewer',
|
library: 'OHIFViewer',
|
||||||
libraryTarget: 'umd',
|
libraryTarget: 'umd',
|
||||||
filename: 'index.umd.js',
|
filename: 'index.umd.js',
|
||||||
},
|
},
|
||||||
@@ -43,6 +48,12 @@ module.exports = (env, argv) => {
|
|||||||
plugins: [
|
plugins: [
|
||||||
// Clean output.path
|
// Clean output.path
|
||||||
new CleanWebpackPlugin(),
|
new CleanWebpackPlugin(),
|
||||||
|
// Generate "index.html" w/ correct includes/imports
|
||||||
|
new HtmlWebpackPlugin({
|
||||||
|
inject: false,
|
||||||
|
template: `${PUBLIC_DIR}/html-templates/${HTML_TEMPLATE}`,
|
||||||
|
filename: 'index.html',
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -3,6 +3,196 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.1.10](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.1.9...@ohif/viewer@1.1.10) (2019-09-19)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [1.1.9](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.1.8...@ohif/viewer@1.1.9) (2019-09-19)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [1.1.8](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.1.7...@ohif/viewer@1.1.8) (2019-09-19)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [1.1.7](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.1.6...@ohif/viewer@1.1.7) (2019-09-19)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [1.1.6](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.1.5...@ohif/viewer@1.1.6) (2019-09-19)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [1.1.5](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.1.4...@ohif/viewer@1.1.5) (2019-09-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* bump cornerstone-tools to latest version ([f519f86](https://github.com/OHIF/Viewers/commit/f519f86))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [1.1.4](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.1.3...@ohif/viewer@1.1.4) (2019-09-17)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [1.1.3](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.1.2...@ohif/viewer@1.1.3) (2019-09-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 Fix issue on not loading gcloud ([#919](https://github.com/OHIF/Viewers/issues/919)) ([f723546](https://github.com/OHIF/Viewers/commit/f723546))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [1.1.2](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.1.1...@ohif/viewer@1.1.2) (2019-09-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [1.1.1](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.1.0...@ohif/viewer@1.1.1) (2019-09-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [1.1.0](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.0.5...@ohif/viewer@1.1.0) (2019-09-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* 🎸 Load local file or folder using native dialog ([#870](https://github.com/OHIF/Viewers/issues/870)) ([c221dd8](https://github.com/OHIF/Viewers/commit/c221dd8))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [1.0.5](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.0.4...@ohif/viewer@1.0.5) (2019-09-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [1.0.4](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.0.3...@ohif/viewer@1.0.4) (2019-09-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [1.0.3](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.0.2...@ohif/viewer@1.0.3) (2019-09-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* on-brand library global name ([ababe63](https://github.com/OHIF/Viewers/commit/ababe63))
|
||||||
|
* remove requestOptions when key is not needed ([32bc47d](https://github.com/OHIF/Viewers/commit/32bc47d))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [1.0.2](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.0.1...@ohif/viewer@1.0.2) (2019-09-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* import regenerator-runtime for umd build ([bad987a](https://github.com/OHIF/Viewers/commit/bad987a))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [1.0.1](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.0.0...@ohif/viewer@1.0.1) (2019-09-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [1.0.0](https://github.com/OHIF/Viewers/compare/@ohif/viewer@0.50.21...@ohif/viewer@1.0.0) (2019-09-06)
|
||||||
|
|
||||||
|
|
||||||
|
### Code Refactoring
|
||||||
|
|
||||||
|
* 💡 React components to consume appConfig using Context ([#852](https://github.com/OHIF/Viewers/issues/852)) ([7c4ee73](https://github.com/OHIF/Viewers/commit/7c4ee73)), closes [#725](https://github.com/OHIF/Viewers/issues/725) [#725](https://github.com/OHIF/Viewers/issues/725)
|
||||||
|
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
* #725
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.21](https://github.com/OHIF/Viewers/compare/@ohif/viewer@0.50.20...@ohif/viewer@0.50.21) (2019-09-06)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* viewer project should build output before publish ([94b625d](https://github.com/OHIF/Viewers/commit/94b625d))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.20](https://github.com/OHIF/Viewers/compare/@ohif/viewer@0.50.19...@ohif/viewer@0.50.20) (2019-09-06)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [0.50.19](https://github.com/OHIF/Viewers/compare/@ohif/viewer@0.50.18...@ohif/viewer@0.50.19) (2019-09-06)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* @ohif/viewer package build ([4aa7cbd](https://github.com/OHIF/Viewers/commit/4aa7cbd))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.50.18](https://github.com/OHIF/Viewers/compare/@ohif/viewer@0.50.17...@ohif/viewer@0.50.18) (2019-09-05)
|
## [0.50.18](https://github.com/OHIF/Viewers/compare/@ohif/viewer@0.50.17...@ohif/viewer@0.50.18) (2019-09-05)
|
||||||
|
|
||||||
**Note:** Version bump only for package @ohif/viewer
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|||||||
@@ -188,7 +188,6 @@ Links:
|
|||||||
[docker-pulls-img]: https://img.shields.io/docker/pulls/ohif/viewer.svg?style=flat-square
|
[docker-pulls-img]: https://img.shields.io/docker/pulls/ohif/viewer.svg?style=flat-square
|
||||||
[docker-image-url]: https://hub.docker.com/r/ohif/viewer
|
[docker-image-url]: https://hub.docker.com/r/ohif/viewer
|
||||||
[all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square
|
[all-contributors-image]: https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square
|
||||||
[contributing-url]: https://github.com/OHIF/Viewers/blob/react/CONTRIBUTING.md
|
|
||||||
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
|
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
|
||||||
[license-url]: LICENSE
|
[license-url]: LICENSE
|
||||||
<!-- DOCS -->
|
<!-- DOCS -->
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"baseUrl": "http://localhost:3000",
|
"baseUrl": "http://localhost:3000",
|
||||||
"video": true,
|
"video": false,
|
||||||
|
"chromeWebSecurity": false,
|
||||||
"projectId": "4oe38f"
|
"projectId": "4oe38f"
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
const dataTransfer = new DataTransfer();
|
||||||
|
|
||||||
|
export const DragSimulator = {
|
||||||
|
MAX_TRIES: 1,
|
||||||
|
DELAY_INTERVAL_MS: 10,
|
||||||
|
counter: 0,
|
||||||
|
rectsEqual(r1, r2) {
|
||||||
|
return (
|
||||||
|
r1.top === r2.top &&
|
||||||
|
r1.right === r2.right &&
|
||||||
|
r1.bottom === r2.bottom &&
|
||||||
|
r1.left === r2.left
|
||||||
|
);
|
||||||
|
},
|
||||||
|
get dropped() {
|
||||||
|
const currentSourcePosition = this.source.getBoundingClientRect();
|
||||||
|
return !this.rectsEqual(
|
||||||
|
this.initialSourcePosition,
|
||||||
|
currentSourcePosition
|
||||||
|
);
|
||||||
|
},
|
||||||
|
get hasTriesLeft() {
|
||||||
|
return this.counter < this.MAX_TRIES;
|
||||||
|
},
|
||||||
|
dragstart() {
|
||||||
|
cy.log('**DRAG START**');
|
||||||
|
cy.wrap(this.source)
|
||||||
|
.trigger('mousedown', { which: 1, button: 0 })
|
||||||
|
.trigger('dragstart', { dataTransfer })
|
||||||
|
.trigger('drag', {});
|
||||||
|
},
|
||||||
|
drop() {
|
||||||
|
cy.log('**DROP**');
|
||||||
|
return cy
|
||||||
|
.wrap(this.target)
|
||||||
|
.trigger('mousemove', 'center')
|
||||||
|
.trigger('dragover', { dataTransfer, force: true })
|
||||||
|
.trigger('drop', { dataTransfer, force: true })
|
||||||
|
.trigger('dragend', { dataTransfer })
|
||||||
|
.trigger('mouseup', { which: 1, button: 0 });
|
||||||
|
},
|
||||||
|
dragover() {
|
||||||
|
cy.log('**DRAGOVER**');
|
||||||
|
if (!this.dropped && this.hasTriesLeft) {
|
||||||
|
this.counter += 1;
|
||||||
|
return cy
|
||||||
|
.wrap(this.target)
|
||||||
|
.trigger('mousemove', 'center')
|
||||||
|
.trigger('dragover', {
|
||||||
|
dataTransfer,
|
||||||
|
position: this.position,
|
||||||
|
})
|
||||||
|
.wait(this.DELAY_INTERVAL_MS)
|
||||||
|
.then(() => this.dragover());
|
||||||
|
}
|
||||||
|
return this.drop().then(() => true);
|
||||||
|
},
|
||||||
|
init(source, target, position) {
|
||||||
|
this.source = source;
|
||||||
|
this.target = target;
|
||||||
|
this.position = position;
|
||||||
|
this.counter = 0;
|
||||||
|
|
||||||
|
this.dragstart();
|
||||||
|
|
||||||
|
return cy.wait(this.DELAY_INTERVAL_MS).then(() => {
|
||||||
|
this.initialSourcePosition = this.source.getBoundingClientRect();
|
||||||
|
return this.dragover();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
simulate(sourceWrapper, targetSelector, position = 'center') {
|
||||||
|
return cy
|
||||||
|
.get(targetSelector)
|
||||||
|
.then(targetWrapper =>
|
||||||
|
this.init(sourceWrapper.get(0), targetWrapper.get(0), position)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
File renamed without changes.
@@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
TODO: Temporarily commented out because it is failing on CI due to timing issues
|
||||||
|
describe('OHIF Study Viewer Page', () => {
|
||||||
|
|
||||||
|
before(() => {
|
||||||
|
cy.openStudy("MISTER^MR");
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checks if series thumbnails are being displayed', ()=> {
|
||||||
|
cy.get('.ThumbnailEntryContainer')
|
||||||
|
.its('length')
|
||||||
|
.should('be.gt', 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('drags and drop a series thumbnail into viewport', () => {
|
||||||
|
cy.get('.ThumbnailEntryContainer:nth-child(2)') //element to be dragged
|
||||||
|
.drag('.cornerstone-canvas'); //dropzone element
|
||||||
|
|
||||||
|
const overlaySeriesInformation = 'div.ViewportOverlay > div.bottom-left.overlay-element > div';
|
||||||
|
const expectedText = 'Ser: 2Img: 1 1/13512 x 512Loc: -17.60 mm Thick: 3.00 mm';
|
||||||
|
|
||||||
|
cy.get(overlaySeriesInformation)
|
||||||
|
.should('have.text', expectedText);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checks if Series left panel can be hidden/displayed', ()=> {
|
||||||
|
const seriesButton = '.pull-left > .RoundedButtonGroup > .roundedButtonWrapper > .roundedButton';
|
||||||
|
const leftPanel = 'section.sidepanel.from-left';
|
||||||
|
|
||||||
|
cy.get(seriesButton).click();
|
||||||
|
cy.get(leftPanel).should('not.be.enabled')
|
||||||
|
|
||||||
|
cy.get(seriesButton).click();
|
||||||
|
cy.get(leftPanel).should('be.visible');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checks if Measurements right panel can be hidden/displayed', ()=> {
|
||||||
|
const measurementsButton = '.pull-right > .RoundedButtonGroup > .roundedButtonWrapper > .roundedButton';
|
||||||
|
const rightPanel = 'section.sidepanel.from-right';
|
||||||
|
|
||||||
|
cy.get(measurementsButton).click();
|
||||||
|
cy.get(rightPanel).should('be.visible');
|
||||||
|
|
||||||
|
|
||||||
|
cy.get(measurementsButton).click();
|
||||||
|
cy.get(rightPanel).should('not.be.enabled');
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
*/
|
||||||
File renamed without changes.
@@ -1,3 +1,5 @@
|
|||||||
|
import { DragSimulator } from "../helpers/DragSimulator.js";
|
||||||
|
|
||||||
// ***********************************************
|
// ***********************************************
|
||||||
// This example commands.js shows you how to
|
// This example commands.js shows you how to
|
||||||
// create various custom commands and overwrite
|
// create various custom commands and overwrite
|
||||||
@@ -23,3 +25,17 @@
|
|||||||
//
|
//
|
||||||
// -- This is will overwrite an existing command --
|
// -- This is will overwrite an existing command --
|
||||||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
||||||
|
|
||||||
|
Cypress.Commands.add('openStudy', (patientName) => {
|
||||||
|
cy.visit('/');
|
||||||
|
cy.get('#patientName')
|
||||||
|
.type(patientName);
|
||||||
|
cy.get('.studylistStudy > .patientName')
|
||||||
|
.contains(patientName)
|
||||||
|
.click();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
Cypress.Commands.add('drag', {prevSubject: 'element',},
|
||||||
|
(...args) => DragSimulator.simulate(...args)
|
||||||
|
);
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
|
|
||||||
<meta name="description" content="Open Health Imaging Foundation DICOM Viewer" />
|
|
||||||
<meta name="viewport"
|
|
||||||
content="width=device-width,initial-scale=1.0,minimum-scale=1,maximum-scale=1,user-scalable=no" />
|
|
||||||
<meta name="theme-color" content="#000000" />
|
|
||||||
<meta http-equiv="cleartype" content="on" />
|
|
||||||
<meta name="MobileOptimized" content="320" />
|
|
||||||
<meta name="HandheldFriendly" content="True" />
|
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
||||||
|
|
||||||
<!-- Latest compiled and minified CSS -->
|
|
||||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
|
|
||||||
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" />
|
|
||||||
|
|
||||||
<title>OHIF Standalone Viewer</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<noscript> You need to enable JavaScript to run this app. </noscript>
|
|
||||||
|
|
||||||
<div id="root"></div>
|
|
||||||
|
|
||||||
<!-- Load React. -->
|
|
||||||
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
|
|
||||||
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
|
|
||||||
|
|
||||||
<script src="/index.umd.js" crossorigin></script>
|
|
||||||
<script>
|
|
||||||
window.config = {
|
|
||||||
// default: '/'
|
|
||||||
routerBasename: '/',
|
|
||||||
servers: {
|
|
||||||
dicomWeb: [
|
|
||||||
{
|
|
||||||
name: 'DCM4CHEE',
|
|
||||||
wadoUriRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/wado',
|
|
||||||
qidoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
|
|
||||||
wadoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
|
|
||||||
qidoSupportsIncludeField: true,
|
|
||||||
imageRendering: 'wadors',
|
|
||||||
thumbnailRendering: 'wadors',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
window.OHIFStandaloneViewer.installViewer(window.config);
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/viewer",
|
"name": "@ohif/viewer",
|
||||||
"version": "0.50.18",
|
"version": "1.1.10",
|
||||||
"description": "OHIF Viewer",
|
"description": "OHIF Viewer",
|
||||||
"author": "OHIF Contributors",
|
"author": "OHIF Contributors",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -18,17 +18,22 @@
|
|||||||
"proxy": "http://localhost:8042",
|
"proxy": "http://localhost:8042",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:package": "cross-env NODE_ENV=production node --max_old_space_size=4096 ./../../node_modules/webpack/bin/webpack.js --config .webpack/webpack.commonjs.js",
|
"build:package": "cross-env NODE_ENV=production node --max_old_space_size=4096 ./../../node_modules/webpack/bin/webpack.js --config .webpack/webpack.commonjs.js",
|
||||||
"build:viewer": "cross-env NODE_ENV=production node --max_old_space_size=4096 ./../../node_modules/webpack/bin/webpack.js --config .webpack/webpack.pwa.js",
|
"build:viewer": "cross-env NODE_ENV=production node --max_old_space_size=4096 ./../../node_modules/webpack/bin/webpack.js --config .webpack/webpack.pwa.js --progress",
|
||||||
|
"build:viewer:e2e": "cross-env NODE_ENV=development node --max_old_space_size=4096 ./../../node_modules/webpack/bin/webpack.js --config .webpack/webpack.pwa.js --progress",
|
||||||
"build:viewer:ci": "cross-env NODE_ENV=production PUBLIC_URL=/pwa/ APP_CONFIG=config/netlify.js node --max_old_space_size=4096 ./../../node_modules/webpack/bin/webpack.js --config .webpack/webpack.pwa.js",
|
"build:viewer:ci": "cross-env NODE_ENV=production PUBLIC_URL=/pwa/ APP_CONFIG=config/netlify.js node --max_old_space_size=4096 ./../../node_modules/webpack/bin/webpack.js --config .webpack/webpack.pwa.js",
|
||||||
"build:viewer:demo": "cross-env NODE_ENV=production APP_CONFIG=config/demo.js HTML_TEMPLATE=rollbar.html node --max_old_space_size=4096 ./../../node_modules/webpack/bin/webpack.js --progress --config .webpack/webpack.pwa.js",
|
"build:viewer:demo": "cross-env NODE_ENV=production APP_CONFIG=config/demo.js HTML_TEMPLATE=rollbar.html node --max_old_space_size=4096 ./../../node_modules/webpack/bin/webpack.js --progress --config .webpack/webpack.pwa.js",
|
||||||
"build:viewer:package": "yarn run build:package",
|
"build:viewer:package": "yarn run build:package",
|
||||||
"dev": "cross-env NODE_ENV=development webpack-dev-server --config .webpack/webpack.pwa.js -w",
|
"dev": "cross-env NODE_ENV=development webpack-dev-server --config .webpack/webpack.pwa.js --watch",
|
||||||
"dev:orthanc": "cross-env NODE_ENV=development PROXY_TARGET=/dicom-web PROXY_DOMAIN=http://localhost:8042 APP_CONFIG=config/docker_nginx-orthanc.js webpack-dev-server --config .webpack/webpack.pwa.js -w",
|
"dev:orthanc": "cross-env NODE_ENV=development PROXY_TARGET=/dicom-web PROXY_DOMAIN=http://localhost:8042 APP_CONFIG=config/docker_nginx-orthanc.js webpack-dev-server --config .webpack/webpack.pwa.js --watch",
|
||||||
"dev:viewer": "yarn run dev",
|
"dev:viewer": "yarn run dev",
|
||||||
"start": "yarn run dev",
|
"start": "yarn run dev",
|
||||||
"test:e2e": "cypress open",
|
"test:e2e": "cypress open",
|
||||||
|
"test:e2e:ci": "cypress run",
|
||||||
|
"test:e2e:dist": "start-server-and-test test:e2e:serve http://localhost:3000 test:e2e:ci",
|
||||||
|
"test:e2e:serve": "serve -l 3000 -s dist",
|
||||||
"test:unit": "jest --watchAll",
|
"test:unit": "jest --watchAll",
|
||||||
"test:unit:ci": "jest --ci --runInBand --collectCoverage"
|
"test:unit:ci": "jest --ci --runInBand --collectCoverage",
|
||||||
|
"prepublishOnly": "yarn run build:package"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist",
|
"dist",
|
||||||
@@ -40,22 +45,22 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.5.5",
|
"@babel/runtime": "^7.5.5",
|
||||||
"@ohif/core": "^0.50.5",
|
"@ohif/core": "^0.50.9",
|
||||||
"@ohif/extension-cornerstone": "^0.50.4",
|
"@ohif/extension-cornerstone": "^1.2.1",
|
||||||
"@ohif/extension-dicom-html": "^0.50.3",
|
"@ohif/extension-dicom-html": "^0.50.7",
|
||||||
"@ohif/extension-dicom-microscopy": "^0.50.4",
|
"@ohif/extension-dicom-microscopy": "^0.50.5",
|
||||||
"@ohif/extension-dicom-pdf": "^0.50.3",
|
"@ohif/extension-dicom-pdf": "^0.50.4",
|
||||||
"@ohif/extension-vtk": "^0.50.6",
|
"@ohif/extension-vtk": "^0.50.17",
|
||||||
"@ohif/i18n": "^0.50.3",
|
"@ohif/i18n": "^0.50.4",
|
||||||
"@ohif/ui": "^0.50.3",
|
"@ohif/ui": "^0.51.1",
|
||||||
"@tanem/react-nprogress": "^1.1.25",
|
"@tanem/react-nprogress": "^1.1.25",
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"core-js": "^3.2.1",
|
"core-js": "^3.2.1",
|
||||||
"cornerstone-core": "^2.2.8",
|
"cornerstone-core": "^2.2.8",
|
||||||
"cornerstone-math": "^0.1.8",
|
"cornerstone-math": "^0.1.8",
|
||||||
"cornerstone-tools": "^3.19.2",
|
"cornerstone-tools": "^4.0.9",
|
||||||
"cornerstone-wado-image-loader": "^3.0.0",
|
"cornerstone-wado-image-loader": "^3.0.0",
|
||||||
"dcmjs": "^0.4.7",
|
"dcmjs": "^0.6.1",
|
||||||
"dicom-parser": "^1.8.3",
|
"dicom-parser": "^1.8.3",
|
||||||
"dicomweb-client": "^0.4.4",
|
"dicomweb-client": "^0.4.4",
|
||||||
"hammerjs": "^2.0.8",
|
"hammerjs": "^2.0.8",
|
||||||
|
|||||||
@@ -13,9 +13,6 @@ window.config = {
|
|||||||
qidoSupportsIncludeField: true,
|
qidoSupportsIncludeField: true,
|
||||||
imageRendering: 'wadors',
|
imageRendering: 'wadors',
|
||||||
thumbnailRendering: 'wadors',
|
thumbnailRendering: 'wadors',
|
||||||
requestOptions: {
|
|
||||||
requestFromBrowser: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ window.config = {
|
|||||||
qidoSupportsIncludeField: true,
|
qidoSupportsIncludeField: true,
|
||||||
imageRendering: 'wadors',
|
imageRendering: 'wadors',
|
||||||
thumbnailRendering: 'wadors',
|
thumbnailRendering: 'wadors',
|
||||||
requestOptions: {
|
|
||||||
requestFromBrowser: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,9 +11,6 @@ window.config = {
|
|||||||
qidoSupportsIncludeField: false,
|
qidoSupportsIncludeField: false,
|
||||||
imageRendering: 'wadors',
|
imageRendering: 'wadors',
|
||||||
thumbnailRendering: 'wadors',
|
thumbnailRendering: 'wadors',
|
||||||
requestOptions: {
|
|
||||||
requestFromBrowser: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,13 +13,11 @@ window.config = {
|
|||||||
imageRendering: 'wadors',
|
imageRendering: 'wadors',
|
||||||
thumbnailRendering: 'wadors',
|
thumbnailRendering: 'wadors',
|
||||||
// REQUIRED TAG:
|
// REQUIRED TAG:
|
||||||
// https://github.com/OHIF/ohif-core/blob/59e1e04b92be24aee5d4402445cb3dcedb746995/src/studies/retrieveStudyMetadata.js#L54
|
|
||||||
// TODO: Remove tag after https://github.com/OHIF/ohif-core/pull/19 is merged and we bump version
|
// TODO: Remove tag after https://github.com/OHIF/ohif-core/pull/19 is merged and we bump version
|
||||||
requestOptions: {
|
// requestOptions: {
|
||||||
// undefined to use JWT + Bearer auth
|
// undefined to use JWT + Bearer auth
|
||||||
// auth: 'orthanc:orthanc',
|
// auth: 'orthanc:orthanc',
|
||||||
requestFromBrowser: true,
|
// },
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -39,4 +37,4 @@ window.config = {
|
|||||||
post_logout_redirect_uri: '/logout-redirect.html',
|
post_logout_redirect_uri: '/logout-redirect.html',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
};
|
||||||
@@ -12,15 +12,11 @@ window.config = {
|
|||||||
qidoSupportsIncludeField: false,
|
qidoSupportsIncludeField: false,
|
||||||
imageRendering: 'wadors',
|
imageRendering: 'wadors',
|
||||||
thumbnailRendering: 'wadors',
|
thumbnailRendering: 'wadors',
|
||||||
// REQUIRED TAG:
|
// requestOptions: {
|
||||||
// https://github.com/OHIF/ohif-core/blob/59e1e04b92be24aee5d4402445cb3dcedb746995/src/studies/retrieveStudyMetadata.js#L54
|
// undefined to use JWT + Bearer auth
|
||||||
// TODO: Remove tag after https://github.com/OHIF/ohif-core/pull/19 is merged and we bump version
|
// auth: 'orthanc:orthanc',
|
||||||
requestOptions: {
|
// },
|
||||||
// undefined to use JWT + Bearer auth
|
|
||||||
// auth: 'orthanc:orthanc',
|
|
||||||
requestFromBrowser: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
@@ -14,11 +14,10 @@ window.config = {
|
|||||||
imageRendering: 'wadors',
|
imageRendering: 'wadors',
|
||||||
thumbnailRendering: 'wadors',
|
thumbnailRendering: 'wadors',
|
||||||
requestOptions: {
|
requestOptions: {
|
||||||
requestFromBrowser: true,
|
|
||||||
auth: 'admin:admin',
|
auth: 'admin:admin',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
studyListFunctionsEnabled: true,
|
studyListFunctionsEnabled: true,
|
||||||
}
|
};
|
||||||
@@ -11,9 +11,6 @@ window.config = {
|
|||||||
qidoSupportsIncludeField: true,
|
qidoSupportsIncludeField: true,
|
||||||
imageRendering: 'wadors',
|
imageRendering: 'wadors',
|
||||||
thumbnailRendering: 'wadors',
|
thumbnailRendering: 'wadors',
|
||||||
requestOptions: {
|
|
||||||
requestFromBrowser: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,15 +11,12 @@ window.config = {
|
|||||||
qidoSupportsIncludeField: true,
|
qidoSupportsIncludeField: true,
|
||||||
imageRendering: 'wadors',
|
imageRendering: 'wadors',
|
||||||
thumbnailRendering: 'wadors',
|
thumbnailRendering: 'wadors',
|
||||||
requestOptions: {
|
|
||||||
requestFromBrowser: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
i18n: {
|
i18n: {
|
||||||
LOCIZE_PROJECTID: 'a8da3f9a-e467-4dd6-af33-474d582a0294',
|
LOCIZE_PROJECTID: 'a8da3f9a-e467-4dd6-af33-474d582a0294',
|
||||||
LOCIZE_API_KEY: null, // Developers can use this to do in-context editing. DO NOT COMMIT THIS KEY!
|
LOCIZE_API_KEY: null, // Developers can use this to do in-context editing. DO NOT COMMIT THIS KEY!
|
||||||
USE_LOCIZE: false
|
USE_LOCIZE: false,
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
|
||||||
|
<meta
|
||||||
|
name="description"
|
||||||
|
content="Open Health Imaging Foundation DICOM Viewer"
|
||||||
|
/>
|
||||||
|
<meta
|
||||||
|
name="viewport"
|
||||||
|
content="width=device-width,initial-scale=1.0,minimum-scale=1,maximum-scale=1,user-scalable=no"
|
||||||
|
/>
|
||||||
|
<meta name="theme-color" content="#000000" />
|
||||||
|
<meta http-equiv="cleartype" content="on" />
|
||||||
|
<meta name="MobileOptimized" content="320" />
|
||||||
|
<meta name="HandheldFriendly" content="True" />
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
|
|
||||||
|
<script src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CObject.values%2CArray.prototype.flat%2CObject.entries%2CSymbol%2CArray.prototype.includes%2CString.prototype.repeat%2CArray.prototype.find"></script>
|
||||||
|
|
||||||
|
<!-- WEB FONTS -->
|
||||||
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css?family=Sanchez"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<title>OHIF Standalone Viewer</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<noscript> You need to enable JavaScript to run this app. </noscript>
|
||||||
|
|
||||||
|
<div id="root"></div>
|
||||||
|
|
||||||
|
<script src="/index.umd.js" crossorigin></script>
|
||||||
|
<script>
|
||||||
|
var containerId = 'root';
|
||||||
|
var componentRenderedOrUpdatedCallback = function() {
|
||||||
|
console.log('OHIF Viewer rendered/updated');
|
||||||
|
};
|
||||||
|
window.OHIFViewer.installViewer(
|
||||||
|
{
|
||||||
|
// routerBasename: '/',
|
||||||
|
servers: {
|
||||||
|
dicomWeb: [
|
||||||
|
{
|
||||||
|
name: 'DCM4CHEE',
|
||||||
|
wadoUriRoot:
|
||||||
|
'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/wado',
|
||||||
|
qidoRoot:
|
||||||
|
'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
|
||||||
|
wadoRoot:
|
||||||
|
'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs',
|
||||||
|
qidoSupportsIncludeField: true,
|
||||||
|
imageRendering: 'wadors',
|
||||||
|
thumbnailRendering: 'wadors',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
containerId,
|
||||||
|
componentRenderedOrUpdatedCallback
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+66
-47
@@ -25,12 +25,15 @@ import { OidcProvider } from 'redux-oidc';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { BrowserRouter as Router } from 'react-router-dom';
|
import { BrowserRouter as Router } from 'react-router-dom';
|
||||||
import WhiteLabellingContext from './WhiteLabellingContext';
|
|
||||||
import { getActiveContexts } from './store/layout/selectors.js';
|
import { getActiveContexts } from './store/layout/selectors.js';
|
||||||
import i18n from '@ohif/i18n';
|
import i18n from '@ohif/i18n';
|
||||||
import setupTools from './setupTools.js';
|
import setupTools from './setupTools.js';
|
||||||
import store from './store';
|
import store from './store';
|
||||||
import UserManagerContext from './UserManagerContext';
|
|
||||||
|
// Contexts
|
||||||
|
import WhiteLabellingContext from './context/WhiteLabellingContext';
|
||||||
|
import UserManagerContext from './context/UserManagerContext';
|
||||||
|
import AppContext from './context/AppContext';
|
||||||
|
|
||||||
// ~~~~ APP SETUP
|
// ~~~~ APP SETUP
|
||||||
initCornerstoneTools({
|
initCornerstoneTools({
|
||||||
@@ -74,10 +77,66 @@ class App extends Component {
|
|||||||
extensions: [],
|
extensions: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_appConfig;
|
||||||
|
_userManager;
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
if (this.props.oidc.length) {
|
this._appConfig = props;
|
||||||
|
const { servers, extensions, hotkeys, oidc } = props;
|
||||||
|
|
||||||
|
this.initUserManager(oidc);
|
||||||
|
_initExtensions(extensions, hotkeys);
|
||||||
|
_initServers(servers);
|
||||||
|
initWebWorkers();
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const userManager = this._userManager;
|
||||||
|
const config = {
|
||||||
|
appConfig: this._appConfig,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (userManager) {
|
||||||
|
return (
|
||||||
|
<AppContext.Provider value={config}>
|
||||||
|
<Provider store={store}>
|
||||||
|
<I18nextProvider i18n={i18n}>
|
||||||
|
<OidcProvider store={store} userManager={userManager}>
|
||||||
|
<UserManagerContext.Provider value={userManager}>
|
||||||
|
<Router basename={this.props.routerBasename}>
|
||||||
|
<WhiteLabellingContext.Provider
|
||||||
|
value={this.props.whiteLabelling}
|
||||||
|
>
|
||||||
|
<OHIFStandaloneViewer userManager={userManager} />
|
||||||
|
</WhiteLabellingContext.Provider>
|
||||||
|
</Router>
|
||||||
|
</UserManagerContext.Provider>
|
||||||
|
</OidcProvider>
|
||||||
|
</I18nextProvider>
|
||||||
|
</Provider>
|
||||||
|
</AppContext.Provider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AppContext.Provider value={config}>
|
||||||
|
<Provider store={store}>
|
||||||
|
<I18nextProvider i18n={i18n}>
|
||||||
|
<Router basename={this.props.routerBasename}>
|
||||||
|
<WhiteLabellingContext.Provider value={this.props.whiteLabelling}>
|
||||||
|
<OHIFStandaloneViewer />
|
||||||
|
</WhiteLabellingContext.Provider>
|
||||||
|
</Router>
|
||||||
|
</I18nextProvider>
|
||||||
|
</Provider>
|
||||||
|
</AppContext.Provider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
initUserManager(oidc) {
|
||||||
|
if (oidc && !!oidc.length) {
|
||||||
const firstOpenIdClient = this.props.oidc[0];
|
const firstOpenIdClient = this.props.oidc[0];
|
||||||
|
|
||||||
const { protocol, host } = window.location;
|
const { protocol, host } = window.location;
|
||||||
@@ -102,58 +161,18 @@ class App extends Component {
|
|||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
this.userManager = getUserManagerForOpenIdConnectClient(
|
this._userManager = getUserManagerForOpenIdConnectClient(
|
||||||
store,
|
store,
|
||||||
openIdConnectConfiguration
|
openIdConnectConfiguration
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
_initExtensions(this.props.extensions);
|
|
||||||
_initServers(this.props.servers);
|
|
||||||
initWebWorkers();
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const userManager = this.userManager;
|
|
||||||
|
|
||||||
if (userManager) {
|
|
||||||
return (
|
|
||||||
<Provider store={store}>
|
|
||||||
<I18nextProvider i18n={i18n}>
|
|
||||||
<OidcProvider store={store} userManager={userManager}>
|
|
||||||
<UserManagerContext.Provider value={userManager}>
|
|
||||||
<Router basename={this.props.routerBasename}>
|
|
||||||
<WhiteLabellingContext.Provider
|
|
||||||
value={this.props.whiteLabelling}
|
|
||||||
>
|
|
||||||
<OHIFStandaloneViewer userManager={userManager} />
|
|
||||||
</WhiteLabellingContext.Provider>
|
|
||||||
</Router>
|
|
||||||
</UserManagerContext.Provider>
|
|
||||||
</OidcProvider>
|
|
||||||
</I18nextProvider>
|
|
||||||
</Provider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Provider store={store}>
|
|
||||||
<I18nextProvider i18n={i18n}>
|
|
||||||
<Router basename={this.props.routerBasename}>
|
|
||||||
<WhiteLabellingContext.Provider value={this.props.whiteLabelling}>
|
|
||||||
<OHIFStandaloneViewer />
|
|
||||||
</WhiteLabellingContext.Provider>
|
|
||||||
</Router>
|
|
||||||
</I18nextProvider>
|
|
||||||
</Provider>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param
|
* @param
|
||||||
*/
|
*/
|
||||||
function _initExtensions(extensions) {
|
function _initExtensions(extensions, hotkeys) {
|
||||||
const defaultExtensions = [
|
const defaultExtensions = [
|
||||||
GenericViewerCommands,
|
GenericViewerCommands,
|
||||||
MeasurementsPanel,
|
MeasurementsPanel,
|
||||||
@@ -163,8 +182,8 @@ function _initExtensions(extensions) {
|
|||||||
extensionManager.registerExtensions(mergedExtensions);
|
extensionManager.registerExtensions(mergedExtensions);
|
||||||
|
|
||||||
// Must run after extension commands are registered
|
// Must run after extension commands are registered
|
||||||
if (window.config.hotkeys) {
|
if (hotkeys) {
|
||||||
hotkeysManager.setHotkeys(window.config.hotkeys, true);
|
hotkeysManager.setHotkeys(hotkeys, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ import './OHIFStandaloneViewer.css';
|
|||||||
import './variables.css';
|
import './variables.css';
|
||||||
import './theme-tide.css';
|
import './theme-tide.css';
|
||||||
|
|
||||||
|
// Contexts
|
||||||
|
import AppContext from './context/AppContext';
|
||||||
|
|
||||||
// Dynamic Import Routes (CodeSplitting)
|
// Dynamic Import Routes (CodeSplitting)
|
||||||
// const IHEInvokeImageDisplay = asyncComponent(() =>
|
// const IHEInvokeImageDisplay = asyncComponent(() =>
|
||||||
// import('./routes/IHEInvokeImageDisplay.js')
|
// import('./routes/IHEInvokeImageDisplay.js')
|
||||||
@@ -37,6 +40,7 @@ import './theme-tide.css';
|
|||||||
const reload = () => window.location.reload();
|
const reload = () => window.location.reload();
|
||||||
|
|
||||||
class OHIFStandaloneViewer extends Component {
|
class OHIFStandaloneViewer extends Component {
|
||||||
|
static contextType = AppContext;
|
||||||
state = {
|
state = {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
};
|
};
|
||||||
@@ -63,7 +67,7 @@ class OHIFStandaloneViewer extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { user, userManager } = this.props;
|
const { user, userManager } = this.props;
|
||||||
|
const { appConfig = {} } = this.context;
|
||||||
const userNotLoggedIn = userManager && (!user || user.expired);
|
const userNotLoggedIn = userManager && (!user || user.expired);
|
||||||
if (userNotLoggedIn) {
|
if (userNotLoggedIn) {
|
||||||
const pathname = this.props.location.pathname;
|
const pathname = this.props.location.pathname;
|
||||||
@@ -140,9 +144,7 @@ class OHIFStandaloneViewer extends Component {
|
|||||||
];
|
];
|
||||||
|
|
||||||
const showStudyList =
|
const showStudyList =
|
||||||
window.config && window.config.showStudyList !== undefined
|
appConfig.showStudyList !== undefined ? appConfig.showStudyList : true;
|
||||||
? window.config.showStudyList
|
|
||||||
: true;
|
|
||||||
if (showStudyList) {
|
if (showStudyList) {
|
||||||
routes.push({
|
routes.push({
|
||||||
path: '/studylist',
|
path: '/studylist',
|
||||||
|
|||||||
@@ -11,13 +11,17 @@ import { AboutModal } from '@ohif/ui';
|
|||||||
import { hotkeysManager } from './../../App.js';
|
import { hotkeysManager } from './../../App.js';
|
||||||
import { withTranslation } from 'react-i18next';
|
import { withTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
// Context
|
||||||
|
import AppContext from './../../context/AppContext';
|
||||||
|
|
||||||
class Header extends Component {
|
class Header extends Component {
|
||||||
|
static contextType = AppContext;
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
home: PropTypes.bool.isRequired,
|
home: PropTypes.bool.isRequired,
|
||||||
location: PropTypes.object.isRequired,
|
location: PropTypes.object.isRequired,
|
||||||
children: PropTypes.node,
|
children: PropTypes.node,
|
||||||
t: PropTypes.func.isRequired,
|
t: PropTypes.func.isRequired,
|
||||||
userManager: PropTypes.object
|
userManager: PropTypes.object,
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
@@ -63,10 +67,10 @@ class Header extends Component {
|
|||||||
if (this.props.user && this.props.userManager) {
|
if (this.props.user && this.props.userManager) {
|
||||||
this.options.push({
|
this.options.push({
|
||||||
title: t('Logout'),
|
title: t('Logout'),
|
||||||
icon: { name: 'power-off' },
|
icon: { name: 'power-off' },
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
this.props.userManager.signoutRedirect();
|
this.props.userManager.signoutRedirect();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,10 +86,9 @@ class Header extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
|
const { appConfig = {} } = this.context;
|
||||||
const showStudyList =
|
const showStudyList =
|
||||||
window.config.showStudyList !== undefined
|
appConfig.showStudyList !== undefined ? appConfig.showStudyList : true;
|
||||||
? window.config.showStudyList
|
|
||||||
: true;
|
|
||||||
return (
|
return (
|
||||||
<div className={`entry-header ${this.props.home ? 'header-big' : ''}`}>
|
<div className={`entry-header ${this.props.home ? 'header-big' : ''}`}>
|
||||||
<div className="header-left-box">
|
<div className="header-left-box">
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import classNames from 'classnames';
|
|||||||
import { MODULE_TYPES } from '@ohif/core';
|
import { MODULE_TYPES } from '@ohif/core';
|
||||||
import OHIF from '@ohif/core';
|
import OHIF from '@ohif/core';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import WhiteLabellingContext from '../WhiteLabellingContext.js';
|
|
||||||
import ConnectedHeader from './ConnectedHeader.js';
|
import ConnectedHeader from './ConnectedHeader.js';
|
||||||
import ConnectedToolbarRow from './ConnectedToolbarRow.js';
|
import ConnectedToolbarRow from './ConnectedToolbarRow.js';
|
||||||
import ConnectedLabellingOverlay from './ConnectedLabellingOverlay';
|
import ConnectedLabellingOverlay from './ConnectedLabellingOverlay';
|
||||||
@@ -13,7 +12,11 @@ import ConnectedStudyBrowser from './ConnectedStudyBrowser.js';
|
|||||||
import ConnectedViewerMain from './ConnectedViewerMain.js';
|
import ConnectedViewerMain from './ConnectedViewerMain.js';
|
||||||
import SidePanel from './../components/SidePanel.js';
|
import SidePanel from './../components/SidePanel.js';
|
||||||
import { extensionManager } from './../App.js';
|
import { extensionManager } from './../App.js';
|
||||||
import UserManagerContext from '../UserManagerContext';
|
|
||||||
|
// Contexts
|
||||||
|
import WhiteLabellingContext from '../context/WhiteLabellingContext.js';
|
||||||
|
import UserManagerContext from '../context/UserManagerContext';
|
||||||
|
|
||||||
import './Viewer.css';
|
import './Viewer.css';
|
||||||
/**
|
/**
|
||||||
* Inits OHIF Hanging Protocol's onReady.
|
* Inits OHIF Hanging Protocol's onReady.
|
||||||
|
|||||||
@@ -13,3 +13,8 @@
|
|||||||
.drag-drop-instructions h4 {
|
.drag-drop-instructions h4 {
|
||||||
color: var(--text-secondary-color);
|
color: var(--text-secondary-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.link-dialog {
|
||||||
|
color: var(--active-color);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
@@ -12,6 +12,44 @@ import { withTranslation } from 'react-i18next';
|
|||||||
const { OHIFStudyMetadata } = metadata;
|
const { OHIFStudyMetadata } = metadata;
|
||||||
const { studyMetadataManager, updateMetaDataManager } = utils;
|
const { studyMetadataManager, updateMetaDataManager } = utils;
|
||||||
|
|
||||||
|
const dropZoneLinkDialog = (onDrop, i18n, dir) => {
|
||||||
|
return (
|
||||||
|
<Dropzone onDrop={onDrop} noDrag>
|
||||||
|
{({ getRootProps, getInputProps }) => (
|
||||||
|
<span {...getRootProps()} className="link-dialog">
|
||||||
|
{dir ? (
|
||||||
|
<span>
|
||||||
|
{i18n('Load folders')}
|
||||||
|
<input
|
||||||
|
{...getInputProps()}
|
||||||
|
webkitdirectory="true"
|
||||||
|
mozdirectory="true"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<span>
|
||||||
|
{i18n('Load files')}
|
||||||
|
<input {...getInputProps()} />
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</Dropzone>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const linksDialogMessage = (onDrop, i18n) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{i18n('Or click to ')}
|
||||||
|
{dropZoneLinkDialog(onDrop, i18n)}
|
||||||
|
{i18n(' or ')}
|
||||||
|
{dropZoneLinkDialog(onDrop, i18n, true)}
|
||||||
|
{i18n(' from dialog')}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
class ViewerLocalFileData extends Component {
|
class ViewerLocalFileData extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
studies: PropTypes.array,
|
studies: PropTypes.array,
|
||||||
@@ -73,7 +111,7 @@ class ViewerLocalFileData extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dropzone onDrop={onDrop}>
|
<Dropzone onDrop={onDrop} noClick>
|
||||||
{({ getRootProps, getInputProps }) => (
|
{({ getRootProps, getInputProps }) => (
|
||||||
<div {...getRootProps()} style={{ width: '100%', height: '100%' }}>
|
<div {...getRootProps()} style={{ width: '100%', height: '100%' }}>
|
||||||
{this.state.studies ? (
|
{this.state.studies ? (
|
||||||
@@ -96,15 +134,10 @@ class ViewerLocalFileData extends Component {
|
|||||||
'Drag and Drop DICOM files here to load them in the Viewer'
|
'Drag and Drop DICOM files here to load them in the Viewer'
|
||||||
)}
|
)}
|
||||||
</h3>
|
</h3>
|
||||||
<h4>
|
<h4>{linksDialogMessage(onDrop, this.props.t)}</h4>
|
||||||
{this.props.t(
|
|
||||||
"Or click to load the browser's file selector"
|
|
||||||
)}
|
|
||||||
</h4>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<input {...getInputProps()} style={{ display: 'none' }} />
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
let AppContext = React.createContext({});
|
||||||
|
|
||||||
|
export default AppContext;
|
||||||
File renamed without changes.
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import OHIFLogo from './components/OHIFLogo/OHIFLogo.js';
|
import OHIFLogo from '../components/OHIFLogo/OHIFLogo.js';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
const defaultContextValues = {
|
const defaultContextValues = {
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Entry point index.js for UMD packaging
|
* Entry point index.js for UMD packaging
|
||||||
*/
|
*/
|
||||||
|
import 'regenerator-runtime/runtime';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import App from './App.js';
|
import App from './App.js';
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import OHIFDicomPDFExtension from '@ohif/extension-dicom-pdf';
|
|||||||
let config = {};
|
let config = {};
|
||||||
const appDefaults = {
|
const appDefaults = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
relativeWebWorkerScriptsPath: '',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (window) {
|
if (window) {
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ export default function setupTools(store) {
|
|||||||
{ name: 'StackScroll', mouseButtonMasks: [1] },
|
{ name: 'StackScroll', mouseButtonMasks: [1] },
|
||||||
{ name: 'Brush', mouseButtonMasks: [1] },
|
{ name: 'Brush', mouseButtonMasks: [1] },
|
||||||
{
|
{
|
||||||
name: 'FreehandMouse',
|
name: 'FreehandRoi',
|
||||||
props: {
|
props: {
|
||||||
configuration: {
|
configuration: {
|
||||||
getMeasurementLocationCallback: toolLabellingFlowCallback,
|
getMeasurementLocationCallback: toolLabellingFlowCallback,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { reducer as oidcReducer } from 'redux-oidc';
|
|||||||
import { redux } from '@ohif/core';
|
import { redux } from '@ohif/core';
|
||||||
import thunkMiddleware from 'redux-thunk';
|
import thunkMiddleware from 'redux-thunk';
|
||||||
|
|
||||||
// Combine our ohif-core, ui, and oidc reducers
|
// Combine our @ohif/core, ui, and oidc reducers
|
||||||
// Set init data, using values found in localStorage
|
// Set init data, using values found in localStorage
|
||||||
const { reducers, localStorage } = redux;
|
const { reducers, localStorage } = redux;
|
||||||
const middleware = [thunkMiddleware];
|
const middleware = [thunkMiddleware];
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
import React from 'react';
|
import React, { useContext } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { withRouter } from 'react-router-dom';
|
import { withRouter } from 'react-router-dom';
|
||||||
import queryString from 'query-string';
|
import queryString from 'query-string';
|
||||||
import ConnectedStudyList from './ConnectedStudyList';
|
import ConnectedStudyList from './ConnectedStudyList';
|
||||||
|
|
||||||
|
// Contexts
|
||||||
|
import AppContext from '../context/AppContext';
|
||||||
|
|
||||||
// TODO: Move to @ohif/ui
|
// TODO: Move to @ohif/ui
|
||||||
|
|
||||||
function toLowerCaseFirstLetter(word) {
|
function toLowerCaseFirstLetter(word) {
|
||||||
@@ -22,16 +25,20 @@ function getFilters({ search }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function StudyListRouting({ location }) {
|
function StudyListRouting({ location }) {
|
||||||
|
const { appConfig = {} } = useContext(AppContext);
|
||||||
|
|
||||||
const filters = location ? getFilters(location) : undefined;
|
const filters = location ? getFilters(location) : undefined;
|
||||||
|
|
||||||
let studyListFunctionsEnabled = false;
|
let studyListFunctionsEnabled = false;
|
||||||
if (window.config && window.config.studyListFunctionsEnabled) {
|
if (appConfig.studyListFunctionsEnabled) {
|
||||||
studyListFunctionsEnabled = window.config.studyListFunctionsEnabled;
|
studyListFunctionsEnabled = appConfig.studyListFunctionsEnabled;
|
||||||
}
|
}
|
||||||
return <ConnectedStudyList
|
return (
|
||||||
filters={filters}
|
<ConnectedStudyList
|
||||||
studyListFunctionsEnabled={studyListFunctionsEnabled}
|
filters={filters}
|
||||||
/>;
|
studyListFunctionsEnabled={studyListFunctionsEnabled}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
StudyListRouting.propTypes = {
|
StudyListRouting.propTypes = {
|
||||||
|
|||||||
@@ -10,10 +10,14 @@ import moment from 'moment';
|
|||||||
import ConnectedDicomFilesUploader from '../googleCloud/ConnectedDicomFilesUploader';
|
import ConnectedDicomFilesUploader from '../googleCloud/ConnectedDicomFilesUploader';
|
||||||
import ConnectedDicomStorePicker from '../googleCloud/ConnectedDicomStorePicker';
|
import ConnectedDicomStorePicker from '../googleCloud/ConnectedDicomStorePicker';
|
||||||
import filesToStudies from '../lib/filesToStudies.js';
|
import filesToStudies from '../lib/filesToStudies.js';
|
||||||
import UserManagerContext from '../UserManagerContext';
|
|
||||||
import WhiteLabellingContext from '../WhiteLabellingContext';
|
// Contexts
|
||||||
|
import UserManagerContext from '../context/UserManagerContext';
|
||||||
|
import WhiteLabellingContext from '../context/WhiteLabellingContext';
|
||||||
|
import AppContext from '../context/AppContext';
|
||||||
|
|
||||||
class StudyListWithData extends Component {
|
class StudyListWithData extends Component {
|
||||||
|
static contextType = AppContext;
|
||||||
state = {
|
state = {
|
||||||
searchData: {},
|
searchData: {},
|
||||||
studies: [],
|
studies: [],
|
||||||
@@ -51,9 +55,10 @@ class StudyListWithData extends Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
const { appConfig = {} } = this.context;
|
||||||
// TODO: Avoid using timepoints here
|
// TODO: Avoid using timepoints here
|
||||||
//const params = { studyInstanceUids, seriesInstanceUids, timepointId, timepointsFilter={} };
|
//const params = { studyInstanceUids, seriesInstanceUids, timepointId, timepointsFilter={} };
|
||||||
if (!this.props.server && window.config.enableGoogleCloudAdapter) {
|
if (!this.props.server && appConfig.enableGoogleCloudAdapter) {
|
||||||
this.setState({
|
this.setState({
|
||||||
modalComponentId: 'DicomStorePicker',
|
modalComponentId: 'DicomStorePicker',
|
||||||
});
|
});
|
||||||
@@ -184,6 +189,7 @@ class StudyListWithData extends Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const { appConfig = {} } = this.context;
|
||||||
const onDrop = async acceptedFiles => {
|
const onDrop = async acceptedFiles => {
|
||||||
try {
|
try {
|
||||||
const studies = await filesToStudies(acceptedFiles);
|
const studies = await filesToStudies(acceptedFiles);
|
||||||
@@ -203,8 +209,7 @@ class StudyListWithData extends Component {
|
|||||||
let healthCareApiButtons = null;
|
let healthCareApiButtons = null;
|
||||||
let healthCareApiWindows = null;
|
let healthCareApiWindows = null;
|
||||||
|
|
||||||
// TODO: This should probably be a prop
|
if (appConfig.enableGoogleCloudAdapter) {
|
||||||
if (window.config.enableGoogleCloudAdapter) {
|
|
||||||
healthCareApiWindows = (
|
healthCareApiWindows = (
|
||||||
<ConnectedDicomStorePicker
|
<ConnectedDicomStorePicker
|
||||||
isOpen={this.state.modalComponentId === 'DicomStorePicker'}
|
isOpen={this.state.modalComponentId === 'DicomStorePicker'}
|
||||||
|
|||||||
Reference in new issue
Block a user