Compare commits

...
Author SHA1 Message Date
ohif-bot ec76bc3b0b chore(release): publish [skip ci]
- @ohif/extension-cornerstone@2.10.4
 - @ohif/extension-dicom-html@1.3.4
 - @ohif/extension-dicom-rt@0.6.7
 - @ohif/extension-dicom-segmentation@0.6.1
 - @ohif/extension-dicom-tag-browser@0.2.5
 - @ohif/extension-vtk@1.11.2
 - @ohif/core@2.13.1
 - @ohif/viewer@4.9.2
2021-03-09 19:43:21 +00:00
Davide Punzo b1070acaca Update dependency: dcmjs@0.18.3 (#2302) 2021-03-09 20:38:19 +01:00
ohif-bot 7b5beb8f98 chore(release): publish [skip ci]
- @ohif/extension-vtk@1.11.1
 - @ohif/viewer@4.9.1
2021-03-09 15:55:47 +00:00
97410e12b9 Added memoization on VTKMPRToolbarButton component to avoid unnecesary rebuilds (#2274)
* Added memoization on VTKMPRToolbarButton component to avoid unnecessary rebuilds

* update isDisplaySetReconstructable for float precision

Co-authored-by: Rodrigo Cáceres Vicencio <rcaceres@nursoft.cl>
Co-authored-by: Davide Punzo <punzodavide@hotmail.it>
2021-03-09 16:52:56 +01:00
ohif-bot bdecbfeee3 chore(release): publish [skip ci]
- @ohif/extension-debugging@0.2.0
 - @ohif/extension-dicom-microscopy@0.52.0
 - @ohif/extension-dicom-segmentation@0.6.0
 - @ohif/extension-vtk@1.11.0
 - @ohif/core@2.13.0
 - @ohif/ui@1.9.0
 - @ohif/viewer@4.9.0
2021-03-04 21:44:04 +00:00
Igor Octaviano 5a970056ae Merge pull request #2283 from OHIF/IDC-2223-update
feat(IDC-2223): add new log service to be used by debugger extension
2021-03-04 18:41:04 -03:00
igoroctaviano 8581405352 Add logger to viewport grid 2021-03-04 18:20:57 -03:00
igoroctaviano df8c4db2ed Update broken test 2021-03-03 20:06:58 -03:00
igoroctaviano ea62bdaddf Merge branch 'master' of github.com:OHIF/Viewers into IDC-2223-update 2021-03-03 19:18:36 -03:00
igoroctaviano e983b02677 Add onerror event to cover all other unhandled errors 2021-03-03 19:16:49 -03:00
ohif-bot 1e4b78d78d chore(release): publish [skip ci]
- @ohif/extension-cornerstone@2.10.3
 - @ohif/extension-dicom-html@1.3.3
 - @ohif/extension-dicom-rt@0.6.6
 - @ohif/extension-dicom-segmentation@0.5.4
 - @ohif/extension-dicom-tag-browser@0.2.4
 - @ohif/extension-vtk@1.10.6
 - @ohif/core@2.12.5
 - @ohif/viewer@4.8.12
2021-03-03 18:31:51 +00:00
igoroctaviano ee6131f98e Merge branch 'master' of github.com:OHIF/Viewers into IDC-2223-update 2021-03-03 15:28:23 -03:00
Igor Octaviano a56bdd035b Merge pull request #2290 from OHIF/bump-dcmjs
Update dependency: dcmjs@0.18.2
2021-03-03 15:27:54 -03:00
igoroctaviano 04901c296e Update dependency: dcmjs@0.18.2
dcmjs
  * @ohif/core: 0.18.1 → 0.18.2
  * @ohif/extension-cornerstone: 0.18.1 → 0.18.2
  * @ohif/extension-dicom-html: 0.18.1 → 0.18.2
  * @ohif/extension-dicom-rt: 0.18.1 → 0.18.2
  * @ohif/extension-dicom-segmentation: 0.18.1 → 0.18.2
  * @ohif/extension-dicom-tag-browser: 0.18.1 → 0.18.2
  * @ohif/extension-vtk: 0.18.1 → 0.18.2
  * @ohif/viewer: 0.18.1 → 0.18.2
2021-03-03 14:35:06 -03:00
ohif-bot 59cadad98c chore(release): publish [skip ci]
- @ohif/extension-cornerstone@2.10.2
 - @ohif/extension-dicom-html@1.3.2
 - @ohif/extension-dicom-rt@0.6.5
 - @ohif/extension-dicom-segmentation@0.5.3
 - @ohif/extension-dicom-tag-browser@0.2.3
 - @ohif/extension-vtk@1.10.5
 - @ohif/core@2.12.4
 - @ohif/viewer@4.8.11
2021-02-25 21:31:47 +00:00
igoroctaviano 14d6454eaf feat(log): add new log service 2021-02-25 18:29:28 -03:00
Igor Octaviano 64f87d2c93 Merge pull request #2281 from OHIF/fix/bump-dcmjs
Update dependency: dcmjs@0.18.1
2021-02-25 18:28:37 -03:00
igoroctaviano cfd66e5ef7 Update dependency: dcmjs@0.18.1
dcmjs
  * @ohif/core: 0.17.2 → 0.18.1
  * @ohif/extension-cornerstone: 0.17.2 → 0.18.1
  * @ohif/extension-dicom-html: 0.17.2 → 0.18.1
  * @ohif/extension-dicom-rt: 0.17.2 → 0.18.1
  * @ohif/extension-dicom-segmentation: 0.17.2 → 0.18.1
  * @ohif/extension-dicom-tag-browser: 0.17.2 → 0.18.1
  * @ohif/extension-vtk: 0.17.2 → 0.18.1
  * @ohif/viewer: 0.17.2 → 0.18.1
2021-02-25 17:05:24 -03:00
Andrey Fedorovandigoroctaviano 6480389778 chore: add acknowledgment of IDC (#2255)
* add acknowldgment of IDC

resolves #1136

* Fix typo + remove IDC ack example

Co-authored-by: igoroctaviano <igoroctaviano@gmail.com>
2021-02-12 12:08:43 +01:00
ohif-bot 0e736e7a56 chore(release): publish [skip ci]
- @ohif/viewer@4.8.10
2021-02-08 11:56:46 +00:00
Igor Octaviano d246cd9842 Merge pull request #2267 from OHIF/IDC-2251
IDC-2251: Add error page and not found pages if failed to retrieve study data
2021-02-08 08:53:35 -03:00
igoroctaviano 4fa1eb683d Merge branch 'master' of github.com:OHIF/Viewers into IDC-2251 2021-02-07 22:29:45 -03:00
ohif-bot ea6842a276 chore(release): publish [skip ci]
- @ohif/extension-dicom-tag-browser@0.2.2
 - @ohif/extension-vtk@1.10.4
 - @ohif/core@2.12.3
 - @ohif/ui@1.8.2
 - @ohif/viewer@4.8.9
2021-02-05 20:03:45 +00:00
igoroctaviano d97270f995 Merge branch 'master' of github.com:OHIF/Viewers into IDC-2251 2021-02-05 17:00:06 -03:00
Igor Octaviano 0ef76f8b66 Merge pull request #2260 from OHIF/IDC-2258
IDC-2258: Replace instance dropdown to slider for dicom tag browser
2021-02-05 16:59:38 -03:00
igoroctaviano 05b5a10af9 Merge branch 'master' of github.com:OHIF/Viewers into IDC-2258 2021-02-05 16:15:29 -03:00
ohif-bot e1150acaf6 chore(release): publish [skip ci]
- @ohif/extension-cornerstone@2.10.1
 - @ohif/extension-dicom-html@1.3.1
 - @ohif/extension-dicom-rt@0.6.4
 - @ohif/extension-dicom-segmentation@0.5.2
 - @ohif/extension-dicom-tag-browser@0.2.1
 - @ohif/extension-vtk@1.10.3
 - @ohif/core@2.12.2
 - @ohif/viewer@4.8.8
2021-02-05 18:42:46 +00:00
Igor Octaviano 4abdbe0584 Merge branch 'master' into IDC-2258 2021-02-05 15:40:40 -03:00
Igor Octaviano 9223a52af9 Merge pull request #2268 from OHIF/IDC-2252
Update dependency: dcmjs@0.17.2 to fix Failure to load a valid SEG object due to incorrect expectations about ReferencedSegmentNumber
2021-02-05 15:40:09 -03:00
igoroctaviano 06f58d18bf Bump dcmjs 2021-02-03 17:38:20 -03:00
igoroctaviano 7c5f9c44b6 Add error page and not found pages if failed to retrieve study data 2021-02-03 13:58:46 -03:00
igoroctaviano ef341d1518 Replace instance dropdown to slider for dicom tag browser 2021-01-28 15:43:51 -03:00
ohif-bot d956963ef0 chore(release): publish [skip ci]
- @ohif/viewer@4.8.7
2021-01-28 14:32:43 +00:00
noerog 83b7d9e8b4 fix(config): Update Google Healthcare API endpoint from v1beta1 to v1 (#2256) 2021-01-28 15:29:53 +01:00
ohif-bot 12e73228d1 chore(release): publish [skip ci]
- @ohif/viewer@4.8.6
2021-01-26 12:43:46 +00:00
Jason Klotzer 4002401c66 fixes #2249 2021-01-26 13:39:48 +01:00
ohif-bot 18a8e059b6 chore(release): publish [skip ci]
- @ohif/extension-dicom-rt@0.6.3
 - @ohif/viewer@4.8.5
2021-01-21 17:33:28 +00:00
Igor Octaviano f3582e514e Merge pull request #2244 from OHIF/IDC-2123
feat(IDC-2123): When RTSTRUCT does not apply to the specific image series, the button and the panel should not be shown
2021-01-21 14:30:41 -03:00
igoroctaviano c76bfd4a58 Merge branch 'IDC-2123' of github.com:OHIF/Viewers into IDC-2123 2021-01-21 14:15:25 -03:00
igoroctaviano 7f8cf5f5da :wq
erge branch 'master' of github.com:OHIF/Viewers into IDC-2123
2021-01-21 14:15:13 -03:00
Igor Octaviano 5ef926477c Merge pull request #2240 from OHIF/IDC-1136
docs(IDC-1136): Add funding acknowledgment of the IDC project
2021-01-21 13:59:34 -03:00
igoroctaviano 87f5b97983 Merge branch 'master' of github.com:OHIF/Viewers into IDC-1136 2021-01-21 13:12:00 -03:00
igoroctaviano d1e52dd6a6 Merge branch 'master' of github.com:OHIF/Viewers into IDC-1136 2021-01-21 11:55:17 -03:00
Igor Octaviano 0ebe8a67d2 Merge branch 'master' into IDC-2123 2021-01-21 09:31:29 -03:00
Igor Octaviano 39a988dac7 Merge branch 'master' into IDC-1136 2021-01-21 09:31:26 -03:00
igoroctaviano 649bc5825a Trigger netlify deploy 2021-01-21 09:06:29 -03:00
igoroctaviano 77c7463c53 RTSTRUCT does not apply to the specific image series, the button and the panel should not be shown 2021-01-19 17:56:41 -03:00
igoroctaviano e545dd5b28 Add funding acknowledgment of the IDC project 2021-01-15 09:53:32 -03:00
56 changed files with 1012 additions and 204 deletions

No files matched your search

+17 -2
View File
@@ -121,8 +121,7 @@ window.config = {
}; };
``` ```
- Install the viewer: - Install the viewer: `window.OHIFViewer.installViewer(window.config);`
`window.OHIFViewer.installViewer(window.config);`
This exact setup is demonstrated in this This exact setup is demonstrated in this
[CodeSandbox](https://codesandbox.io/s/viewer-script-tag-tprch) and in our [CodeSandbox](https://codesandbox.io/s/viewer-script-tag-tprch) and in our
@@ -259,6 +258,22 @@ Cancer Institute, Informatics Technology for Cancer Research (ITCR) program,
under a under a
[grant to Dr. Gordon Harris at Massachusetts General Hospital (U24 CA199460)](https://projectreporter.nih.gov/project_info_description.cfm?aid=8971104). [grant to Dr. Gordon Harris at Massachusetts General Hospital (U24 CA199460)](https://projectreporter.nih.gov/project_info_description.cfm?aid=8971104).
## Projects that contributed to OHIF Viewer
The following is a (partial) list of projects that contributed resources towards
development of OHIF Viewer:
- [NCI Imaging Data Commons (IDC) project](https://imaging.datacommons.cancer.gov/)
supported development of new features and bug fixes marked with
["IDC:priority"](https://github.com/OHIF/Viewers/issues?q=is%3Aissue+is%3Aopen+label%3AIDC%3Apriority),
["IDC:candidate"](https://github.com/OHIF/Viewers/issues?q=is%3Aissue+is%3Aopen+label%3AIDC%3Acandidate)
or
["IDC:collaboration"](https://github.com/OHIF/Viewers/issues?q=is%3Aissue+is%3Aopen+label%3AIDC%3Acollaboration).
NCI Imaging Data Commons is supported by the contract number 19X037Q from
Leidos Biomedical Research under Task Order HHSN26100071 from NCI.
[IDC Viewer](https://learn.canceridc.dev/portal/visualization) is a customized
version of the OHIF Viewer.
## License ## License
MIT © [OHIF](https://github.com/OHIF) MIT © [OHIF](https://github.com/OHIF)
+32
View File
@@ -3,6 +3,38 @@
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.
## [2.10.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@2.10.3...@ohif/extension-cornerstone@2.10.4) (2021-03-09)
**Note:** Version bump only for package @ohif/extension-cornerstone
## [2.10.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@2.10.2...@ohif/extension-cornerstone@2.10.3) (2021-03-03)
**Note:** Version bump only for package @ohif/extension-cornerstone
## [2.10.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@2.10.1...@ohif/extension-cornerstone@2.10.2) (2021-02-25)
**Note:** Version bump only for package @ohif/extension-cornerstone
## [2.10.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@2.10.0...@ohif/extension-cornerstone@2.10.1) (2021-02-05)
**Note:** Version bump only for package @ohif/extension-cornerstone
# [2.10.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@2.9.6...@ohif/extension-cornerstone@2.10.0) (2020-12-10) # [2.10.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@2.9.6...@ohif/extension-cornerstone@2.10.0) (2020-12-10)
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ohif/extension-cornerstone", "name": "@ohif/extension-cornerstone",
"version": "2.10.0", "version": "2.10.4",
"description": "OHIF extension for Cornerstone", "description": "OHIF extension for Cornerstone",
"author": "OHIF", "author": "OHIF",
"license": "MIT", "license": "MIT",
@@ -36,7 +36,7 @@
"cornerstone-math": "^0.1.8", "cornerstone-math": "^0.1.8",
"cornerstone-tools": "^4.20.1", "cornerstone-tools": "^4.20.1",
"cornerstone-wado-image-loader": "^3.1.0", "cornerstone-wado-image-loader": "^3.1.0",
"dcmjs": "0.17.0", "dcmjs": "0.18.3",
"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",
+11
View File
@@ -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.2.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-debugging@0.1.6...@ohif/extension-debugging@0.2.0) (2021-03-04)
### Features
* **log:** add new log service ([14d6454](https://github.com/OHIF/Viewers/commit/14d6454eafaa2ccb50e133c2945c9558052ea27e))
## [0.1.6](https://github.com/OHIF/Viewers/compare/@ohif/extension-debugging@0.1.5...@ohif/extension-debugging@0.1.6) (2020-10-06) ## [0.1.6](https://github.com/OHIF/Viewers/compare/@ohif/extension-debugging@0.1.5...@ohif/extension-debugging@0.1.6) (2020-10-06)
**Note:** Version bump only for package @ohif/extension-debugging **Note:** Version bump only for package @ohif/extension-debugging
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ohif/extension-debugging", "name": "@ohif/extension-debugging",
"version": "0.1.6", "version": "0.2.0",
"description": "OHIF extension for debugging.", "description": "OHIF extension for debugging.",
"author": "OHIF", "author": "OHIF",
"license": "MIT", "license": "MIT",
@@ -12,3 +12,15 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
} }
.debug-report-modal-container .errors {
margin-top: 10px;
}
.debug-report-modal-container .errors-container {
border: 1px solid var(--active-color);
border-radius: 5px;
padding: 10px;
overflow: scroll;
max-height: 300px;
}
@@ -10,6 +10,7 @@ const DubugReportModal = ({
extensionManager, extensionManager,
mailTo, mailTo,
debugModalMessage, debugModalMessage,
errors = [],
}) => { }) => {
const copyDebugDataToClipboard = () => { const copyDebugDataToClipboard = () => {
const body = getEmailBody(); const body = getEmailBody();
@@ -131,6 +132,19 @@ const DubugReportModal = ({
{getLayout(viewports)} {getLayout(viewports)}
</table> </table>
</div> </div>
<div className="errors">
<h3>Errors ({errors.length})</h3>
<div className="errors-container">
{errors.map(error => {
return (
<div>
<pre>Message: {error.message}</pre>
{error.error && <pre>Stack: {error.error.stack}</pre>}
</div>
);
})}
</div>
</div>
</div> </div>
); );
}; };
@@ -1,4 +1,6 @@
import OHIF from '@ohif/core'; import OHIF from '@ohif/core';
import { ToolbarButton, useLogger } from '@ohif/ui';
import { import {
save, save,
upload, upload,
@@ -95,6 +97,7 @@ export function getCommands(context, servicesManager, extensionManager) {
const { UIModalService } = servicesManager.services; const { UIModalService } = servicesManager.services;
const WrappedDebugReportModal = function() { const WrappedDebugReportModal = function() {
const { state } = useLogger();
return ( return (
<DebugReportModal <DebugReportModal
viewports={viewports} viewports={viewports}
@@ -103,6 +106,7 @@ export function getCommands(context, servicesManager, extensionManager) {
extensionManager={extensionManager} extensionManager={extensionManager}
mailTo={state.mailTo} mailTo={state.mailTo}
debugModalMessage={state.debugModalMessage} debugModalMessage={state.debugModalMessage}
errors={state.errors}
/> />
); );
}; };
+32
View File
@@ -3,6 +3,38 @@
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.3.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@1.3.3...@ohif/extension-dicom-html@1.3.4) (2021-03-09)
**Note:** Version bump only for package @ohif/extension-dicom-html
## [1.3.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@1.3.2...@ohif/extension-dicom-html@1.3.3) (2021-03-03)
**Note:** Version bump only for package @ohif/extension-dicom-html
## [1.3.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@1.3.1...@ohif/extension-dicom-html@1.3.2) (2021-02-25)
**Note:** Version bump only for package @ohif/extension-dicom-html
## [1.3.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@1.3.0...@ohif/extension-dicom-html@1.3.1) (2021-02-05)
**Note:** Version bump only for package @ohif/extension-dicom-html
# [1.3.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@1.2.9...@ohif/extension-dicom-html@1.3.0) (2020-12-10) # [1.3.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@1.2.9...@ohif/extension-dicom-html@1.3.0) (2020-12-10)
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ohif/extension-dicom-html", "name": "@ohif/extension-dicom-html",
"version": "1.3.0", "version": "1.3.4",
"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",
@@ -29,7 +29,7 @@
}, },
"peerDependencies": { "peerDependencies": {
"@ohif/core": "^0.50.0", "@ohif/core": "^0.50.0",
"dcmjs": "0.17.0", "dcmjs": "0.18.3",
"prop-types": "^15.6.2", "prop-types": "^15.6.2",
"react": "^16.8.6", "react": "^16.8.6",
"react-dom": "^16.8.6" "react-dom": "^16.8.6"
+11
View File
@@ -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.52.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-microscopy@0.51.4...@ohif/extension-dicom-microscopy@0.52.0) (2021-03-04)
### Features
* **log:** add new log service ([14d6454](https://github.com/OHIF/Viewers/commit/14d6454eafaa2ccb50e133c2945c9558052ea27e))
## [0.51.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-microscopy@0.51.3...@ohif/extension-dicom-microscopy@0.51.4) (2021-01-21) ## [0.51.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-microscopy@0.51.3...@ohif/extension-dicom-microscopy@0.51.4) (2021-01-21)
**Note:** Version bump only for package @ohif/extension-dicom-microscopy **Note:** Version bump only for package @ohif/extension-dicom-microscopy
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ohif/extension-dicom-microscopy", "name": "@ohif/extension-dicom-microscopy",
"version": "0.51.4", "version": "0.52.0",
"description": "OHIF extension for Dicom Microscopy", "description": "OHIF extension for Dicom Microscopy",
"author": "OHIF", "author": "OHIF",
"license": "MIT", "license": "MIT",
@@ -70,12 +70,18 @@ class DicomMicroscopyViewport extends Component {
}); });
} catch (error) { } catch (error) {
console.error('[Microscopy Viewer] Failed to load:', error); console.error('[Microscopy Viewer] Failed to load:', error);
const { UINotificationService } = this.props.servicesManager.services; const {
UINotificationService,
LoggerService,
} = this.props.servicesManager.services;
if (UINotificationService) { if (UINotificationService) {
const message =
'Failed to load viewport. Please check that you have hardware acceleration enabled.';
LoggerService.error({ error, message });
UINotificationService.show({ UINotificationService.show({
autoClose: false,
title: 'Microscopy Viewport', title: 'Microscopy Viewport',
message: message,
'Failed to load viewport. Please check that you have hardware acceleration enabled.',
type: 'error', type: 'error',
}); });
} }
+40
View File
@@ -3,6 +3,46 @@
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.6.7](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-rt@0.6.6...@ohif/extension-dicom-rt@0.6.7) (2021-03-09)
**Note:** Version bump only for package @ohif/extension-dicom-rt
## [0.6.6](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-rt@0.6.5...@ohif/extension-dicom-rt@0.6.6) (2021-03-03)
**Note:** Version bump only for package @ohif/extension-dicom-rt
## [0.6.5](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-rt@0.6.4...@ohif/extension-dicom-rt@0.6.5) (2021-02-25)
**Note:** Version bump only for package @ohif/extension-dicom-rt
## [0.6.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-rt@0.6.3...@ohif/extension-dicom-rt@0.6.4) (2021-02-05)
**Note:** Version bump only for package @ohif/extension-dicom-rt
## [0.6.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-rt@0.6.2...@ohif/extension-dicom-rt@0.6.3) (2021-01-21)
**Note:** Version bump only for package @ohif/extension-dicom-rt
## [0.6.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-rt@0.6.1...@ohif/extension-dicom-rt@0.6.2) (2021-01-21) ## [0.6.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-rt@0.6.1...@ohif/extension-dicom-rt@0.6.2) (2021-01-21)
**Note:** Version bump only for package @ohif/extension-dicom-rt **Note:** Version bump only for package @ohif/extension-dicom-rt
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ohif/extension-dicom-rt", "name": "@ohif/extension-dicom-rt",
"version": "0.6.2", "version": "0.6.7",
"description": "OHIF extension for rendering DICOM RTSTRUCTs on top of cornerstone images.", "description": "OHIF extension for rendering DICOM RTSTRUCTs on top of cornerstone images.",
"author": "OHIF", "author": "OHIF",
"license": "MIT", "license": "MIT",
@@ -31,7 +31,7 @@
"@ohif/core": "^0.50.0", "@ohif/core": "^0.50.0",
"cornerstone-core": "^2.2.8", "cornerstone-core": "^2.2.8",
"cornerstone-tools": "^4.20.1", "cornerstone-tools": "^4.20.1",
"dcmjs": "0.17.0", "dcmjs": "0.18.3",
"gl-matrix": "^3.3.0", "gl-matrix": "^3.3.0",
"prop-types": "^15.6.2", "prop-types": "^15.6.2",
"react": "^16.8.6", "react": "^16.8.6",
+27 -14
View File
@@ -5,6 +5,9 @@ import id from './id.js';
import RTPanel from './components/RTPanel/RTPanel'; import RTPanel from './components/RTPanel/RTPanel';
import { version } from '../package.json'; import { version } from '../package.json';
import { utils } from '@ohif/core';
const { studyMetadataManager } = utils;
export default { export default {
/** /**
* Only required property. Should be a unique value across all extensions. * Only required property. Should be a unique value across all extensions.
@@ -45,24 +48,34 @@ export default {
icon: 'list', icon: 'list',
label: 'RTSTRUCT', label: 'RTSTRUCT',
target: 'rt-panel', target: 'rt-panel',
isDisabled: studies => { isDisabled: (studies, activeViewport) => {
if (!studies) { if (!studies) {
return true; return true;
} }
for (let i = 0; i < studies.length; i++) { if (activeViewport) {
const study = studies[i]; const study = studies.find(
s => s.StudyInstanceUID === activeViewport.StudyInstanceUID
if (study && study.series) { );
for (let j = 0; j < study.series.length; j++) { const ds = study.displaySets.find(
const series = study.series[j]; ds =>
if ( ds.displaySetInstanceUID ===
/* Could be expanded to contain RTPLAN and RTDOSE information in the future */ activeViewport.displaySetInstanceUID
['RTSTRUCT'].includes(series.Modality) );
) { const studyMetadata = studyMetadataManager.get(
return false; activeViewport.StudyInstanceUID
} );
} const referencedDisplaySets = studyMetadata.getDerivedDatasets({
referencedSeriesInstanceUID: activeViewport.SeriesInstanceUID,
Modality: 'RTSTRUCT',
});
if (
referencedDisplaySets &&
referencedDisplaySets.some(ds =>
['RTSTRUCT'].includes(ds.Modality)
)
) {
return false;
} }
} }
@@ -3,6 +3,49 @@
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.6.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-segmentation@0.6.0...@ohif/extension-dicom-segmentation@0.6.1) (2021-03-09)
**Note:** Version bump only for package @ohif/extension-dicom-segmentation
# [0.6.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-segmentation@0.5.4...@ohif/extension-dicom-segmentation@0.6.0) (2021-03-04)
### Features
* **log:** add new log service ([14d6454](https://github.com/OHIF/Viewers/commit/14d6454eafaa2ccb50e133c2945c9558052ea27e))
## [0.5.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-segmentation@0.5.3...@ohif/extension-dicom-segmentation@0.5.4) (2021-03-03)
**Note:** Version bump only for package @ohif/extension-dicom-segmentation
## [0.5.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-segmentation@0.5.2...@ohif/extension-dicom-segmentation@0.5.3) (2021-02-25)
**Note:** Version bump only for package @ohif/extension-dicom-segmentation
## [0.5.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-segmentation@0.5.1...@ohif/extension-dicom-segmentation@0.5.2) (2021-02-05)
**Note:** Version bump only for package @ohif/extension-dicom-segmentation
## [0.5.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-segmentation@0.5.0...@ohif/extension-dicom-segmentation@0.5.1) (2021-01-21) ## [0.5.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-segmentation@0.5.0...@ohif/extension-dicom-segmentation@0.5.1) (2021-01-21)
**Note:** Version bump only for package @ohif/extension-dicom-segmentation **Note:** Version bump only for package @ohif/extension-dicom-segmentation
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ohif/extension-dicom-segmentation", "name": "@ohif/extension-dicom-segmentation",
"version": "0.5.1", "version": "0.6.1",
"description": "OHIF extension for viewing segmentations in the 2D MPR view", "description": "OHIF extension for viewing segmentations in the 2D MPR view",
"author": "OHIF", "author": "OHIF",
"license": "MIT", "license": "MIT",
@@ -31,7 +31,7 @@
"@ohif/core": "^0.50.0", "@ohif/core": "^0.50.0",
"cornerstone-core": "^2.2.8", "cornerstone-core": "^2.2.8",
"cornerstone-tools": "^4.20.1", "cornerstone-tools": "^4.20.1",
"dcmjs": "0.17.0", "dcmjs": "0.18.3",
"prop-types": "^15.6.2", "prop-types": "^15.6.2",
"react": "^16.8.6", "react": "^16.8.6",
"react-dom": "^16.8.6" "react-dom": "^16.8.6"
+2 -1
View File
@@ -25,12 +25,13 @@ export default {
return toolbarModule; return toolbarModule;
}, },
getPanelModule({ commandsManager, api, servicesManager }) { getPanelModule({ commandsManager, api, servicesManager }) {
const { UINotificationService } = servicesManager.services; const { UINotificationService, LoggerService } = servicesManager.services;
const ExtendedSegmentationPanel = props => { const ExtendedSegmentationPanel = props => {
const { activeContexts } = api.hooks.useAppContext(); const { activeContexts } = api.hooks.useAppContext();
const onDisplaySetLoadFailureHandler = error => { const onDisplaySetLoadFailureHandler = error => {
LoggerService.error({ error, message: error.message });
UINotificationService.show({ UINotificationService.show({
title: 'DICOM Segmentation Loader', title: 'DICOM Segmentation Loader',
message: error.message, message: error.message,
+40
View File
@@ -3,6 +3,46 @@
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.2.5](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-tag-browser@0.2.4...@ohif/extension-dicom-tag-browser@0.2.5) (2021-03-09)
**Note:** Version bump only for package @ohif/extension-dicom-tag-browser
## [0.2.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-tag-browser@0.2.3...@ohif/extension-dicom-tag-browser@0.2.4) (2021-03-03)
**Note:** Version bump only for package @ohif/extension-dicom-tag-browser
## [0.2.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-tag-browser@0.2.2...@ohif/extension-dicom-tag-browser@0.2.3) (2021-02-25)
**Note:** Version bump only for package @ohif/extension-dicom-tag-browser
## [0.2.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-tag-browser@0.2.1...@ohif/extension-dicom-tag-browser@0.2.2) (2021-02-05)
**Note:** Version bump only for package @ohif/extension-dicom-tag-browser
## [0.2.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-tag-browser@0.2.0...@ohif/extension-dicom-tag-browser@0.2.1) (2021-02-05)
**Note:** Version bump only for package @ohif/extension-dicom-tag-browser
# [0.2.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-tag-browser@0.1.1...@ohif/extension-dicom-tag-browser@0.2.0) (2020-12-10) # [0.2.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-tag-browser@0.1.1...@ohif/extension-dicom-tag-browser@0.2.0) (2020-12-10)
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ohif/extension-dicom-tag-browser", "name": "@ohif/extension-dicom-tag-browser",
"version": "0.2.0", "version": "0.2.5",
"description": "OHIF extension for checking DICOM headers.", "description": "OHIF extension for checking DICOM headers.",
"author": "OHIF", "author": "OHIF",
"license": "MIT", "license": "MIT",
@@ -28,7 +28,7 @@
}, },
"peerDependencies": { "peerDependencies": {
"@ohif/core": "^2.6.0", "@ohif/core": "^2.6.0",
"dcmjs": "0.17.0", "dcmjs": "0.18.3",
"react": "^16.8.6" "react": "^16.8.6"
}, },
"dependencies": { "dependencies": {
@@ -3,6 +3,11 @@
margin-left: auto; margin-left: auto;
} }
.dicom-tag-browser-table-wrapper {
height: 500px;
overflow-y: scroll;
}
.dicom-tag-browser-table tr { .dicom-tag-browser-table tr {
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
@@ -11,6 +16,20 @@
white-space: nowrap; white-space: nowrap;
} }
.dicom-tag-browser-content {
overflow: hidden;
width: 100%;
padding-bottom: 50px;
}
.dicom-tag-browser-instance-range .range {
height: 20px;
}
.dicom-tag-browser-instance-range {
padding: 20px 0 20px 0;
}
.dicom-tag-browser-table td.dicom-tag-browser-table-center { .dicom-tag-browser-table td.dicom-tag-browser-table-center {
text-align: center; text-align: center;
} }
@@ -1,5 +1,6 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { classes, cornerstone as OHIFCornerstone } from '@ohif/core'; import { classes, cornerstone as OHIFCornerstone } from '@ohif/core';
import { Range } from '@ohif/ui';
import dcmjs from 'dcmjs'; import dcmjs from 'dcmjs';
import DicomBrowserSelect from './DicomBrowserSelect'; import DicomBrowserSelect from './DicomBrowserSelect';
import moment from 'moment'; import moment from 'moment';
@@ -99,26 +100,35 @@ const DicomTagBrowser = ({ displaySets, displaySetInstanceUID }) => {
let instanceSelectList = null; let instanceSelectList = null;
if (isImageStack) { if (isImageStack) {
const selectedInstanceValue = instanceList[activeInstance];
instanceSelectList = ( instanceSelectList = (
<DicomBrowserSelect <div className="dicom-tag-browser-instance-range">
value={selectedInstanceValue} <Range
formatOptionLabel={DicomBrowserSelectItem} showValue
options={instanceList} step={1}
/> min={1}
max={instanceList.length - 1}
value={activeInstance}
valueRenderer={value => <p>Instance Number: {value}</p>}
onChange={({ target }) => {
const instanceIndex = parseInt(target.value);
setActiveInstance(instanceIndex);
}}
/>
</div>
); );
} }
return ( return (
<div> <div className="dicom-tag-browser-content">
<DicomBrowserSelect <DicomBrowserSelect
value={selectedDisplaySetValue} value={selectedDisplaySetValue}
formatOptionLabel={DicomBrowserSelectItem} formatOptionLabel={DicomBrowserSelectItem}
options={displaySetList} options={displaySetList}
/> />
{instanceSelectList} {instanceSelectList}
<DicomTagTable tags={tags} meta={meta}></DicomTagTable> <div className="dicom-tag-browser-table-wrapper">
<DicomTagTable tags={tags} meta={meta}></DicomTagTable>
</div>
</div> </div>
); );
}; };
@@ -127,30 +137,28 @@ function DicomTagTable({ tags, meta }) {
const rows = getFormattedRowsFromTags(tags, meta); const rows = getFormattedRowsFromTags(tags, meta);
return ( return (
<div> <table className="dicom-tag-browser-table">
<table className="dicom-tag-browser-table"> <tbody>
<tbody> <tr>
<tr> <th className="dicom-tag-browser-table-left">Tag</th>
<th className="dicom-tag-browser-table-left">Tag</th> <th className="dicom-tag-browser-table-left">Value Representation</th>
<th className="dicom-tag-browser-table-left">Value Representation</th> <th className="dicom-tag-browser-table-left">Keyword</th>
<th className="dicom-tag-browser-table-left">Keyword</th> <th className="dicom-tag-browser-table-left">Value</th>
<th className="dicom-tag-browser-table-left">Value</th> </tr>
</tr> {rows.map((row, index) => {
{rows.map((row, index) => { const className = row.className ? row.className : null;
const className = row.className ? row.className : null;
return ( return (
<tr className={className} key={`DICOMTagRow-${index}`}> <tr className={className} key={`DICOMTagRow-${index}`}>
<td>{row[0]}</td> <td>{row[0]}</td>
<td className="dicom-tag-browser-table-center">{row[1]}</td> <td className="dicom-tag-browser-table-center">{row[1]}</td>
<td>{row[2]}</td> <td>{row[2]}</td>
<td>{row[3]}</td> <td>{row[3]}</td>
</tr> </tr>
); );
})} })}
</tbody> </tbody>
</table> </table>
</div>
); );
} }
@@ -183,12 +191,16 @@ function getFormattedRowsFromTags(tags, meta) {
} else { } else {
if (tagInfo.vr === 'xs') { if (tagInfo.vr === 'xs') {
try { try {
const dataset = metadataProvider.getStudyDataset(meta.StudyInstanceUID); const dataset = metadataProvider.getStudyDataset(
meta.StudyInstanceUID
);
const tag = dcmjs.data.Tag.fromPString(tagInfo.tag).toCleanString(); const tag = dcmjs.data.Tag.fromPString(tagInfo.tag).toCleanString();
const originalTagInfo = dataset[tag]; const originalTagInfo = dataset[tag];
tagInfo.vr = originalTagInfo.vr; tagInfo.vr = originalTagInfo.vr;
} catch (error) { } catch (error) {
console.error(`Failed to parse value representation for tag '${tagInfo.keyword}'`); console.error(
`Failed to parse value representation for tag '${tagInfo.keyword}'`
);
} }
} }
@@ -21,7 +21,7 @@ export default function getCommandsModule(servicesManager) {
const { UIModalService } = servicesManager.services; const { UIModalService } = servicesManager.services;
const WrappedDicomTagBrowser = function () { const WrappedDicomTagBrowser = function() {
return ( return (
<DicomTagBrowser <DicomTagBrowser
displaySets={displaySets} displaySets={displaySets}
@@ -34,7 +34,7 @@ export default function getCommandsModule(servicesManager) {
content: WrappedDicomTagBrowser, content: WrappedDicomTagBrowser,
title: `DICOM Tag Browser`, title: `DICOM Tag Browser`,
fullscreen: true, fullscreen: true,
showScrollbar: true noScroll: true,
}); });
}, },
}; };
+59
View File
@@ -3,6 +3,65 @@
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.11.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.11.1...@ohif/extension-vtk@1.11.2) (2021-03-09)
**Note:** Version bump only for package @ohif/extension-vtk
## [1.11.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.11.0...@ohif/extension-vtk@1.11.1) (2021-03-09)
**Note:** Version bump only for package @ohif/extension-vtk
# [1.11.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.10.6...@ohif/extension-vtk@1.11.0) (2021-03-04)
### Features
* **log:** add new log service ([14d6454](https://github.com/OHIF/Viewers/commit/14d6454eafaa2ccb50e133c2945c9558052ea27e))
## [1.10.6](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.10.5...@ohif/extension-vtk@1.10.6) (2021-03-03)
**Note:** Version bump only for package @ohif/extension-vtk
## [1.10.5](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.10.4...@ohif/extension-vtk@1.10.5) (2021-02-25)
**Note:** Version bump only for package @ohif/extension-vtk
## [1.10.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.10.3...@ohif/extension-vtk@1.10.4) (2021-02-05)
**Note:** Version bump only for package @ohif/extension-vtk
## [1.10.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.10.2...@ohif/extension-vtk@1.10.3) (2021-02-05)
**Note:** Version bump only for package @ohif/extension-vtk
## [1.10.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.10.1...@ohif/extension-vtk@1.10.2) (2021-01-21) ## [1.10.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.10.1...@ohif/extension-vtk@1.10.2) (2021-01-21)
**Note:** Version bump only for package @ohif/extension-vtk **Note:** Version bump only for package @ohif/extension-vtk
+4 -4
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ohif/extension-vtk", "name": "@ohif/extension-vtk",
"version": "1.10.2", "version": "1.11.2",
"description": "OHIF extension for VTK.js", "description": "OHIF extension for VTK.js",
"author": "OHIF", "author": "OHIF",
"license": "MIT", "license": "MIT",
@@ -35,7 +35,7 @@
"cornerstone-core": "^2.2.8", "cornerstone-core": "^2.2.8",
"cornerstone-tools": "^4.20.1", "cornerstone-tools": "^4.20.1",
"cornerstone-wado-image-loader": "^3.1.0", "cornerstone-wado-image-loader": "^3.1.0",
"dcmjs": "0.17.0", "dcmjs": "0.18.3",
"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",
@@ -53,8 +53,8 @@
"react-vtkjs-viewport": "^0.14.2" "react-vtkjs-viewport": "^0.14.2"
}, },
"devDependencies": { "devDependencies": {
"@ohif/core": "^2.12.1", "@ohif/core": "^2.13.1",
"@ohif/ui": "^1.8.1", "@ohif/ui": "^1.9.0",
"cornerstone-tools": "^4.20.1", "cornerstone-tools": "^4.20.1",
"cornerstone-wado-image-loader": "^3.1.0", "cornerstone-wado-image-loader": "^3.1.0",
"dicom-parser": "^1.8.3", "dicom-parser": "^1.8.3",
+10 -3
View File
@@ -360,12 +360,15 @@ class OHIFVTKViewport extends Component {
} catch (error) { } catch (error) {
const errorTitle = 'Failed to load 2D MPR'; const errorTitle = 'Failed to load 2D MPR';
console.error(errorTitle, error); console.error(errorTitle, error);
const { UINotificationService } = this.props.servicesManager.services; const {
UINotificationService,
LoggerService,
} = this.props.servicesManager.services;
if (this.props.viewportIndex === 0) { if (this.props.viewportIndex === 0) {
const message = error.message.includes('buffer') const message = error.message.includes('buffer')
? 'Dataset is too big to display in MPR' ? 'Dataset is too big to display in MPR'
: error.message; : error.message;
console.error(errorTitle, error); LoggerService.error({ error, message });
UINotificationService.show({ UINotificationService.show({
title: errorTitle, title: errorTitle,
message, message,
@@ -428,11 +431,15 @@ class OHIFVTKViewport extends Component {
}; };
const onPixelDataInsertedErrorCallback = error => { const onPixelDataInsertedErrorCallback = error => {
const { UINotificationService } = this.props.servicesManager.services; const {
UINotificationService,
LoggerService,
} = this.props.servicesManager.services;
if (!this.hasError) { if (!this.hasError) {
if (this.props.viewportIndex === 0) { if (this.props.viewportIndex === 0) {
// Only show the notification from one viewport 1 in MPR2D. // Only show the notification from one viewport 1 in MPR2D.
LoggerService.error({ error, message: error.message });
UINotificationService.show({ UINotificationService.show({
title: 'MPR Load Error', title: 'MPR Load Error',
message: error.message, message: error.message,
+8 -4
View File
@@ -14,7 +14,9 @@ import OHIFVTKViewport from './OHIFVTKViewport';
const { BlendMode } = Constants; const { BlendMode } = Constants;
const commandsModule = ({ commandsManager, UINotificationService }) => { const commandsModule = ({ commandsManager, servicesManager }) => {
const { UINotificationService, LoggerService } = servicesManager.services;
// TODO: Put this somewhere else // TODO: Put this somewhere else
let apis = {}; let apis = {};
let defaultVOI; let defaultVOI;
@@ -175,7 +177,7 @@ const commandsModule = ({ commandsManager, UINotificationService }) => {
segmentNumber, segmentNumber,
frameIndex, frameIndex,
frame, frame,
done = () => { }, done = () => {},
}) => { }) => {
let api = apis[viewports.activeViewportIndex]; let api = apis[viewports.activeViewportIndex];
@@ -473,10 +475,12 @@ const commandsModule = ({ commandsManager, UINotificationService }) => {
const volumeLength = dimensions[0] * dimensions[1] * dimensions[2]; const volumeLength = dimensions[0] * dimensions[1] * dimensions[2];
if (volumeLength > maxBufferLengthFloat32) { if (volumeLength > maxBufferLengthFloat32) {
const message =
'This volume is too large to fit in WebGL 1 textures and will display incorrectly. Please use a different browser to view this data';
LoggerService.error({ message });
UINotificationService.show({ UINotificationService.show({
title: 'Browser does not support WebGL 2', title: 'Browser does not support WebGL 2',
message: message,
'This volume is too large to fit in WebGL 1 textures and will display incorrectly. Please use a different browser to view this data',
type: 'error', type: 'error',
autoClose: false, autoClose: false,
}); });
+1 -2
View File
@@ -35,8 +35,7 @@ const vtkExtension = {
return toolbarModule; return toolbarModule;
}, },
getCommandsModule({ commandsManager, servicesManager }) { getCommandsModule({ commandsManager, servicesManager }) {
const { UINotificationService } = servicesManager.services; return commandsModule({ commandsManager, servicesManager });
return commandsModule({ commandsManager, UINotificationService });
}, },
}; };
@@ -1,21 +1,18 @@
import React from 'react'; import React, { useMemo } from 'react';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { ToolbarButton } from '@ohif/ui'; import { ToolbarButton } from '@ohif/ui';
import { utils } from '@ohif/core'; import { utils } from '@ohif/core';
import { createSelector } from 'reselect';
const { studyMetadataManager } = utils; const { studyMetadataManager } = utils;
let isVisible = true; const _isDisplaySetReconstructable = (
displaySetInstanceUID = '',
const _isDisplaySetReconstructable = (viewportSpecificData = {}, activeViewportIndex) => { StudyInstanceUID = ''
if (!viewportSpecificData[activeViewportIndex]) { ) => {
if (displaySetInstanceUID == '' || StudyInstanceUID == '') {
return false; return false;
}; }
const { displaySetInstanceUID, StudyInstanceUID } = viewportSpecificData[
activeViewportIndex
];
const studies = studyMetadataManager.all(); const studies = studyMetadataManager.all();
@@ -27,7 +24,9 @@ const _isDisplaySetReconstructable = (viewportSpecificData = {}, activeViewportI
return false; return false;
} }
const displaySet = study._displaySets.find(set => set.displaySetInstanceUID === displaySetInstanceUID); const displaySet = study._displaySets.find(
set => set.displaySetInstanceUID === displaySetInstanceUID
);
if (!displaySet) { if (!displaySet) {
return false; return false;
@@ -45,33 +44,43 @@ const _isDisplaySetReconstructable = (viewportSpecificData = {}, activeViewportI
const image = displaySet.images[ii]; const image = displaySet.images[ii];
if (!image) continue; if (!image) continue;
const imageIdControl = image.getImageId() const imageIdControl = image.getImageId();
const instanceMetadataControl = cornerstone.metaData.get('instance', imageIdControl) const instanceMetadataControl = cornerstone.metaData.get(
'instance',
imageIdControl
);
if (!instanceMetadataControl || if (
!instanceMetadataControl ||
instanceMetadataControl === undefined || instanceMetadataControl === undefined ||
!instanceMetadataControl.ImagePositionPatient || !instanceMetadataControl.ImagePositionPatient ||
instanceMetadataControl.ImagePositionPatient === undefined) { instanceMetadataControl.ImagePositionPatient === undefined
) {
// if ImagePositionPatient is missing, skip the 4D datasets check. // if ImagePositionPatient is missing, skip the 4D datasets check.
// do not return false, because it could be a 3D dataset. // do not return false, because it could be a 3D dataset.
continue; continue;
} }
let xImagePositionPatientControl = instanceMetadataControl.ImagePositionPatient[0]; let xImagePositionPatientControl =
let yImagePositionPatientControl = instanceMetadataControl.ImagePositionPatient[1]; instanceMetadataControl.ImagePositionPatient[0];
let zImagePositionPatientControl = instanceMetadataControl.ImagePositionPatient[2]; let yImagePositionPatientControl =
instanceMetadataControl.ImagePositionPatient[1];
let zImagePositionPatientControl =
instanceMetadataControl.ImagePositionPatient[2];
for (let jj = ii + 1; jj < displaySet.numImageFrames; ++jj) { for (let jj = ii + 1; jj < displaySet.numImageFrames; ++jj) {
const image = displaySet.images[jj]; const image = displaySet.images[jj];
if (!image) continue; if (!image) continue;
const imageId = image.getImageId() const imageId = image.getImageId();
const instanceMetadata = cornerstone.metaData.get('instance', imageId) const instanceMetadata = cornerstone.metaData.get('instance', imageId);
if (!instanceMetadata || if (
!instanceMetadata ||
instanceMetadata === undefined || instanceMetadata === undefined ||
!instanceMetadata.ImagePositionPatient || !instanceMetadata.ImagePositionPatient ||
instanceMetadata.ImagePositionPatient === undefined) { instanceMetadata.ImagePositionPatient === undefined
) {
// if ImagePositionPatient is missing, skip the 4D datasets check. // if ImagePositionPatient is missing, skip the 4D datasets check.
// do not return false, because it could be a 3D dataset. // do not return false, because it could be a 3D dataset.
continue; continue;
@@ -81,9 +90,12 @@ const _isDisplaySetReconstructable = (viewportSpecificData = {}, activeViewportI
let yImagePositionPatient = instanceMetadata.ImagePositionPatient[1]; let yImagePositionPatient = instanceMetadata.ImagePositionPatient[1];
let zImagePositionPatient = instanceMetadata.ImagePositionPatient[2]; let zImagePositionPatient = instanceMetadata.ImagePositionPatient[2];
if (xImagePositionPatientControl === xImagePositionPatient && // ImagePositionPatient is float
yImagePositionPatientControl === yImagePositionPatient && if (
zImagePositionPatientControl === zImagePositionPatient) { Math.abs( xImagePositionPatientControl - xImagePositionPatient ) < 1e-6 &&
Math.abs( yImagePositionPatientControl - yImagePositionPatient ) < 1e-6 &&
Math.abs( zImagePositionPatientControl - zImagePositionPatient ) < 1e-6
) {
return false; return false;
} }
} }
@@ -92,30 +104,53 @@ const _isDisplaySetReconstructable = (viewportSpecificData = {}, activeViewportI
return displaySet.isReconstructable; return displaySet.isReconstructable;
}; };
function VTKMPRToolbarButton({ const selectDisplaySetInstanceUID = state => {
parentContext, if (
toolbarClickCallback, state.viewports.viewportSpecificData[state.viewports.activeViewportIndex]
button, ) {
activeButtons, return state.viewports.viewportSpecificData[
isActive, state.viewports.activeViewportIndex
className, ].displaySetInstanceUID;
}) { } else {
const { id, label, icon } = button; return '';
const { viewportSpecificData, activeViewportIndex } = useSelector(state => { }
const { viewports = {} } = state; };
const { viewportSpecificData, activeViewportIndex } = viewports;
const selectStudyInstanceUID = state => {
if (
state.viewports.viewportSpecificData[state.viewports.activeViewportIndex]
) {
return state.viewports.viewportSpecificData[
state.viewports.activeViewportIndex
].StudyInstanceUID;
} else {
return '';
}
};
const stateSelector = createSelector(
[selectDisplaySetInstanceUID, selectStudyInstanceUID],
(displaySetInstanceUID, StudyInstanceUID) => {
return { return {
viewportSpecificData, displaySetInstanceUID,
activeViewportIndex, StudyInstanceUID,
} };
}); }
);
isVisible = _isDisplaySetReconstructable( function VTKMPRToolbarButton({ toolbarClickCallback, button, isActive }) {
viewportSpecificData, const { id, label, icon } = button;
activeViewportIndex, const { displaySetInstanceUID, StudyInstanceUID } = useSelector(
stateSelector
); );
const isVisible = useMemo(() => {
return _isDisplaySetReconstructable(
displaySetInstanceUID,
StudyInstanceUID
);
}, [displaySetInstanceUID, StudyInstanceUID]);
return ( return (
<React.Fragment> <React.Fragment>
{isVisible && ( {isVisible && (
+51
View File
@@ -3,6 +3,57 @@
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.
## [2.13.1](https://github.com/OHIF/Viewers/compare/@ohif/core@2.13.0...@ohif/core@2.13.1) (2021-03-09)
**Note:** Version bump only for package @ohif/core
# [2.13.0](https://github.com/OHIF/Viewers/compare/@ohif/core@2.12.5...@ohif/core@2.13.0) (2021-03-04)
### Features
* **log:** add new log service ([14d6454](https://github.com/OHIF/Viewers/commit/14d6454eafaa2ccb50e133c2945c9558052ea27e))
## [2.12.5](https://github.com/OHIF/Viewers/compare/@ohif/core@2.12.4...@ohif/core@2.12.5) (2021-03-03)
**Note:** Version bump only for package @ohif/core
## [2.12.4](https://github.com/OHIF/Viewers/compare/@ohif/core@2.12.3...@ohif/core@2.12.4) (2021-02-25)
**Note:** Version bump only for package @ohif/core
## [2.12.3](https://github.com/OHIF/Viewers/compare/@ohif/core@2.12.2...@ohif/core@2.12.3) (2021-02-05)
**Note:** Version bump only for package @ohif/core
## [2.12.2](https://github.com/OHIF/Viewers/compare/@ohif/core@2.12.1...@ohif/core@2.12.2) (2021-02-05)
**Note:** Version bump only for package @ohif/core
## [2.12.1](https://github.com/OHIF/Viewers/compare/@ohif/core@2.12.0...@ohif/core@2.12.1) (2021-01-21) ## [2.12.1](https://github.com/OHIF/Viewers/compare/@ohif/core@2.12.0...@ohif/core@2.12.1) (2021-01-21)
**Note:** Version bump only for package @ohif/core **Note:** Version bump only for package @ohif/core
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ohif/core", "name": "@ohif/core",
"version": "2.12.1", "version": "2.13.1",
"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",
@@ -39,7 +39,7 @@
"dependencies": { "dependencies": {
"@babel/runtime": "^7.5.5", "@babel/runtime": "^7.5.5",
"ajv": "^6.10.0", "ajv": "^6.10.0",
"dcmjs": "0.17.0", "dcmjs": "0.18.3",
"dicomweb-client": "^0.6.0", "dicomweb-client": "^0.6.0",
"immer": "6.0.2", "immer": "6.0.2",
"isomorphic-base64": "^1.0.2", "isomorphic-base64": "^1.0.2",
+7 -2
View File
@@ -63,10 +63,15 @@ export class HotkeysManager {
definitions.forEach(definition => this.registerHotkeys(definition)); definitions.forEach(definition => this.registerHotkeys(definition));
} catch (error) { } catch (error) {
const { UINotificationService } = this._servicesManager.services; const {
UINotificationService,
LoggerService,
} = this._servicesManager.services;
const message = 'Erro while setting hotkeys';
LoggerService.error({ error, message });
UINotificationService.show({ UINotificationService.show({
title: 'Hotkeys Manager', title: 'Hotkeys Manager',
message: 'Erro while setting hotkeys', message,
type: 'error', type: 'error',
}); });
} }
+3
View File
@@ -26,6 +26,7 @@ import {
UIModalService, UIModalService,
UIDialogService, UIDialogService,
MeasurementService, MeasurementService,
LoggerService,
} from './services'; } from './services';
const OHIF = { const OHIF = {
@@ -60,6 +61,7 @@ const OHIF = {
UIModalService, UIModalService,
UIDialogService, UIDialogService,
MeasurementService, MeasurementService,
LoggerService,
}; };
export { export {
@@ -93,6 +95,7 @@ export {
UIModalService, UIModalService,
UIDialogService, UIDialogService,
MeasurementService, MeasurementService,
LoggerService,
}; };
export { OHIF }; export { OHIF };
+1
View File
@@ -14,6 +14,7 @@ describe('Top level exports', () => {
'UIModalService', 'UIModalService',
'UIDialogService', 'UIDialogService',
'MeasurementService', 'MeasurementService',
'LoggerService',
// //
'utils', 'utils',
'hotkeys', 'hotkeys',
@@ -0,0 +1,67 @@
const name = 'LoggerService';
const publicAPI = {
name,
info: _info,
error: _error,
setServiceImplementation,
};
const serviceImplementation = {
_info: () => console.warn('info() NOT IMPLEMENTED'),
_error: () => console.warn('error() NOT IMPLEMENTED'),
};
/**
* Logs an info
*
* @param {object} props { message, displayOnConsole }
*/
function _info({ message, displayOnConsole }) {
return serviceImplementation._info({
message,
displayOnConsole,
});
}
/**
* Logs an error
*
* @param {object} props { error, stack, message, displayOnConsole }
* @returns void
*/
function _error({ error, stack, message, displayOnConsole }) {
return serviceImplementation._error({
error,
stack,
message,
displayOnConsole,
});
}
/**
*
*
* @param {*} {
* info: infoImplementation,
* error: errorImplementation,
* }
*/
function setServiceImplementation({
info: infoImplementation,
error: errorImplementation,
}) {
if (infoImplementation) {
serviceImplementation._info = infoImplementation;
}
if (errorImplementation) {
serviceImplementation._error = errorImplementation;
}
}
export default {
name,
create: ({ configuration = {} }) => {
return publicAPI;
},
};
@@ -9,7 +9,8 @@
* @property {boolean} [closeButton=true] Should the modal body render the close button. * @property {boolean} [closeButton=true] Should the modal body render the close button.
* @property {string} [title=null] Should the modal render the title independently of the body content. * @property {string} [title=null] Should the modal render the title independently of the body content.
* @property {string} [customClassName=null] The custom class to style the modal. * @property {string} [customClassName=null] The custom class to style the modal.
* @property {boolean} [showScrollbar=null] Show or hide scrollbar. * @property {boolean} [showScrollbar=false] Show or hide scrollbar.
* @property {boolean} [noScroll=false] Disable or not the scrollbar.
*/ */
const name = 'UIModalService'; const name = 'UIModalService';
@@ -29,7 +30,7 @@ const serviceImplementation = {
/** /**
* Show a new UI modal; * Show a new UI modal;
* *
* @param {ModalProps} props { content, contentProps, shouldCloseOnEsc, isOpen, onClose, closeButton, title, customClassName, showScrollbar } * @param {ModalProps} props { content, contentProps, shouldCloseOnEsc, isOpen, onClose, closeButton, title, customClassName, showScrollbar, noScroll }
*/ */
function _show({ function _show({
content = null, content = null,
@@ -41,7 +42,8 @@ function _show({
title = null, title = null,
fullscreen = false, fullscreen = false,
customClassName = null, customClassName = null,
showScrollbar = false showScrollbar = false,
noScroll = false,
}) { }) {
return serviceImplementation._show({ return serviceImplementation._show({
content, content,
@@ -53,7 +55,8 @@ function _show({
title, title,
fullscreen, fullscreen,
customClassName, customClassName,
showScrollbar showScrollbar,
noScroll,
}); });
} }
+2
View File
@@ -3,6 +3,7 @@ import UINotificationService from './UINotificationService';
import UIModalService from './UIModalService'; import UIModalService from './UIModalService';
import UIDialogService from './UIDialogService'; import UIDialogService from './UIDialogService';
import MeasurementService from './MeasurementService'; import MeasurementService from './MeasurementService';
import LoggerService from './LoggerService';
export { export {
UINotificationService, UINotificationService,
@@ -10,4 +11,5 @@ export {
UIDialogService, UIDialogService,
ServicesManager, ServicesManager,
MeasurementService, MeasurementService,
LoggerService,
}; };
+19
View File
@@ -3,6 +3,25 @@
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.9.0](https://github.com/OHIF/Viewers/compare/@ohif/ui@1.8.2...@ohif/ui@1.9.0) (2021-03-04)
### Features
* **log:** add new log service ([14d6454](https://github.com/OHIF/Viewers/commit/14d6454eafaa2ccb50e133c2945c9558052ea27e))
## [1.8.2](https://github.com/OHIF/Viewers/compare/@ohif/ui@1.8.1...@ohif/ui@1.8.2) (2021-02-05)
**Note:** Version bump only for package @ohif/ui
## [1.8.1](https://github.com/OHIF/Viewers/compare/@ohif/ui@1.8.0...@ohif/ui@1.8.1) (2021-01-21) ## [1.8.1](https://github.com/OHIF/Viewers/compare/@ohif/ui@1.8.0...@ohif/ui@1.8.1) (2021-01-21)
**Note:** Version bump only for package @ohif/ui **Note:** Version bump only for package @ohif/ui
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ohif/ui", "name": "@ohif/ui",
"version": "1.8.1", "version": "1.9.0",
"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",
@@ -32,6 +32,10 @@
max-height: 90vh; max-height: 90vh;
overflow-y: auto; overflow-y: auto;
&.noScroll &__content {
overflow: hidden;
}
&:not(.visibleScrollbar) &__content &:not(.visibleScrollbar) &__content
overflow-x: hidden; overflow-x: hidden;
scrollbar-width: none; scrollbar-width: none;
@@ -0,0 +1,104 @@
import React, { useState, createContext, useContext, useEffect } from 'react';
import PropTypes from 'prop-types';
const LoggerContext = createContext(null);
const { Provider } = LoggerContext;
export const useLogger = () => useContext(LoggerContext);
const LoggerProvider = ({ children, service }) => {
const [state, setState] = useState({
errors: [],
infos: [],
});
useEffect(() => {
const onErrorHandler = ({ error: errorObject, message }) => {
error({ error: errorObject, message });
};
window.addEventListener('error', onErrorHandler);
return () => {
window.removeEventListener('error', onErrorHandler);
};
}, []);
/**
* Logs an error
*
* @param {object} props { error, stack, message, displayOnConsole }
* @returns void
*/
const error = ({
error = {},
stack = '',
message = '',
displayOnConsole = true,
}) => {
const errorObject = { error, stack, message, displayOnConsole };
setState(state => ({ ...state, errors: [...state.errors, errorObject] }));
if (displayOnConsole) {
console.error(error);
}
};
/**
* Logs an info
*
* @param {object} props { message, displayOnConsole }
* @returns void
*/
const info = ({ message = '', displayOnConsole = true }) => {
setState(state => ({
...state,
infos: state.infos.push({ message, displayOnConsole }),
}));
if (displayOnConsole) {
console.info(message);
}
};
/**
* Sets the implementation of a log service that can be used by extensions
*
* @returns void
*/
useEffect(() => {
if (service) {
service.setServiceImplementation({ error, info });
}
}, [error, service, info]);
return <Provider value={{ info, error, state }}>{children}</Provider>;
};
/**
* Higher Order Component to use the log methods through a Class Component
*
* @returns
*/
export const withLogger = Component => {
return function WrappedComponent(props) {
const { error, info, state } = useLogger();
return <Component {...props} logger={{ error, info, state }} />;
};
};
LoggerProvider.defaultProps = {
service: null,
};
LoggerProvider.propTypes = {
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node,
]).isRequired,
service: PropTypes.shape({
setServiceImplementation: PropTypes.func,
}),
};
export default LoggerProvider;
export const LogConsumer = LoggerContext.Consumer;
@@ -82,14 +82,20 @@ const ModalProvider = ({ children, modal: Modal, service }) => {
shouldCloseOnEsc, shouldCloseOnEsc,
fullscreen, fullscreen,
closeButton, closeButton,
showScrollbar showScrollbar,
noScroll,
} = options; } = options;
return ( return (
<Provider value={{ show, hide }}> <Provider value={{ show, hide }}>
{ModalContent && ( {ModalContent && (
<Modal <Modal
className={classNames(customClassName, ModalContent.className, { 'visibleScrollbar': showScrollbar })} className={classNames(
customClassName,
ModalContent.className,
{ visibleScrollbar: showScrollbar },
{ noScroll }
)}
shouldCloseOnEsc={shouldCloseOnEsc} shouldCloseOnEsc={shouldCloseOnEsc}
isOpen={isOpen} isOpen={isOpen}
title={title} title={title}
@@ -18,3 +18,8 @@ export {
withDialog, withDialog,
useDialog, useDialog,
} from './DialogProvider.js'; } from './DialogProvider.js';
export {
default as LoggerProvider,
withLogger,
useLogger,
} from './LoggerProvider.js';
+8 -1
View File
@@ -28,7 +28,13 @@ class Range extends Component {
className="range" className="range"
/> />
{this.props.showPercentage && <span>{`${this.state.value}%`}</span>} {this.props.showPercentage && <span>{`${this.state.value}%`}</span>}
{this.props.showValue && <span>{this.state.value}</span>} {this.props.showValue && (
<span>
{this.props.valueRenderer
? this.props.valueRenderer(this.state.value)
: this.state.value}
</span>
)}
</> </>
); );
} }
@@ -40,6 +46,7 @@ Range.propTypes = {
max: PropTypes.number.isRequired, max: PropTypes.number.isRequired,
step: PropTypes.number, step: PropTypes.number,
id: PropTypes.string, id: PropTypes.string,
valueRenderer: PropTypes.func,
onChange: PropTypes.func, onChange: PropTypes.func,
showPercentage: PropTypes.bool, showPercentage: PropTypes.bool,
showValue: PropTypes.bool, showValue: PropTypes.bool,
+8 -2
View File
@@ -30,7 +30,7 @@ import {
AboutContent, AboutContent,
OHIFModal, OHIFModal,
ErrorBoundary, ErrorBoundary,
ErrorPage ErrorPage,
} from './components'; } from './components';
import { useDebounce, useMedia } from './hooks'; import { useDebounce, useMedia } from './hooks';
@@ -66,6 +66,9 @@ import {
ModalConsumer, ModalConsumer,
useModal, useModal,
withModal, withModal,
LoggerProvider,
withLogger,
useLogger,
} from './contextProviders'; } from './contextProviders';
export { export {
@@ -127,11 +130,14 @@ export {
useDialog, useDialog,
ErrorBoundary, ErrorBoundary,
ErrorPage, ErrorPage,
LoggerProvider,
withLogger,
useLogger,
// Hooks // Hooks
useDebounce, useDebounce,
useMedia, useMedia,
// Utils // Utils
ViewerbaseDragDropContext, ViewerbaseDragDropContext,
asyncComponent, asyncComponent,
retryImport retryImport,
}; };
+94
View File
@@ -3,6 +3,100 @@
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.
## [4.9.2](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.9.1...@ohif/viewer@4.9.2) (2021-03-09)
**Note:** Version bump only for package @ohif/viewer
## [4.9.1](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.9.0...@ohif/viewer@4.9.1) (2021-03-09)
**Note:** Version bump only for package @ohif/viewer
# [4.9.0](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.8.12...@ohif/viewer@4.9.0) (2021-03-04)
### Features
* **log:** add new log service ([14d6454](https://github.com/OHIF/Viewers/commit/14d6454eafaa2ccb50e133c2945c9558052ea27e))
## [4.8.12](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.8.11...@ohif/viewer@4.8.12) (2021-03-03)
**Note:** Version bump only for package @ohif/viewer
## [4.8.11](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.8.10...@ohif/viewer@4.8.11) (2021-02-25)
**Note:** Version bump only for package @ohif/viewer
## [4.8.10](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.8.9...@ohif/viewer@4.8.10) (2021-02-08)
**Note:** Version bump only for package @ohif/viewer
## [4.8.9](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.8.8...@ohif/viewer@4.8.9) (2021-02-05)
**Note:** Version bump only for package @ohif/viewer
## [4.8.8](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.8.7...@ohif/viewer@4.8.8) (2021-02-05)
**Note:** Version bump only for package @ohif/viewer
## [4.8.7](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.8.6...@ohif/viewer@4.8.7) (2021-01-28)
### Bug Fixes
* **config:** Update Google Healthcare API endpoint from v1beta1 to v1 ([#2256](https://github.com/OHIF/Viewers/issues/2256)) ([83b7d9e](https://github.com/OHIF/Viewers/commit/83b7d9e8b4240a928eb43735280000e97f186d90))
## [4.8.6](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.8.5...@ohif/viewer@4.8.6) (2021-01-26)
**Note:** Version bump only for package @ohif/viewer
## [4.8.5](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.8.4...@ohif/viewer@4.8.5) (2021-01-21)
**Note:** Version bump only for package @ohif/viewer
## [4.8.4](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.8.3...@ohif/viewer@4.8.4) (2021-01-21) ## [4.8.4](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.8.3...@ohif/viewer@4.8.4) (2021-01-21)
**Note:** Version bump only for package @ohif/viewer **Note:** Version bump only for package @ohif/viewer
+11 -11
View File
@@ -1,6 +1,6 @@
{ {
"name": "@ohif/viewer", "name": "@ohif/viewer",
"version": "4.8.4", "version": "4.9.2",
"description": "OHIF Viewer", "description": "OHIF Viewer",
"author": "OHIF Contributors", "author": "OHIF Contributors",
"license": "MIT", "license": "MIT",
@@ -49,18 +49,18 @@
}, },
"dependencies": { "dependencies": {
"@babel/runtime": "^7.5.5", "@babel/runtime": "^7.5.5",
"@ohif/core": "^2.12.1", "@ohif/core": "^2.13.1",
"@ohif/extension-cornerstone": "^2.10.0", "@ohif/extension-cornerstone": "^2.10.4",
"@ohif/extension-debugging": "^0.1.6", "@ohif/extension-debugging": "^0.2.0",
"@ohif/extension-dicom-html": "^1.3.0", "@ohif/extension-dicom-html": "^1.3.4",
"@ohif/extension-dicom-microscopy": "^0.51.4", "@ohif/extension-dicom-microscopy": "^0.52.0",
"@ohif/extension-dicom-pdf": "^1.0.6", "@ohif/extension-dicom-pdf": "^1.0.6",
"@ohif/extension-dicom-rt": "^0.6.2", "@ohif/extension-dicom-rt": "^0.6.7",
"@ohif/extension-dicom-segmentation": "^0.5.1", "@ohif/extension-dicom-segmentation": "^0.6.1",
"@ohif/extension-lesion-tracker": "^0.2.1", "@ohif/extension-lesion-tracker": "^0.2.1",
"@ohif/extension-vtk": "^1.10.2", "@ohif/extension-vtk": "^1.11.2",
"@ohif/i18n": "^0.53.0", "@ohif/i18n": "^0.53.0",
"@ohif/ui": "^1.8.1", "@ohif/ui": "^1.9.0",
"@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",
@@ -68,7 +68,7 @@
"cornerstone-math": "^0.1.8", "cornerstone-math": "^0.1.8",
"cornerstone-tools": "^4.20.1", "cornerstone-tools": "^4.20.1",
"cornerstone-wado-image-loader": "^3.1.0", "cornerstone-wado-image-loader": "^3.1.0",
"dcmjs": "0.17.0", "dcmjs": "0.18.3",
"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",
+1 -1
View File
@@ -1,7 +1,7 @@
window.config = { window.config = {
routerBasename: '/', routerBasename: '/',
enableGoogleCloudAdapter: true, enableGoogleCloudAdapter: true,
healthcareApiEndpoint: 'https://healthcare.googleapis.com/v1beta1', healthcareApiEndpoint: 'https://healthcare.googleapis.com/v1',
servers: { servers: {
// This is an array, but we'll only use the first entry for now // This is an array, but we'll only use the first entry for now
dicomWeb: [], dicomWeb: [],
+30 -19
View File
@@ -13,6 +13,7 @@ import {
ModalProvider, ModalProvider,
DialogProvider, DialogProvider,
OHIFModal, OHIFModal,
LoggerProvider,
ErrorBoundary, ErrorBoundary,
} from '@ohif/ui'; } from '@ohif/ui';
@@ -24,6 +25,7 @@ import {
UINotificationService, UINotificationService,
UIModalService, UIModalService,
UIDialogService, UIDialogService,
LoggerService,
MeasurementService, MeasurementService,
utils, utils,
redux as reduxOHIF, redux as reduxOHIF,
@@ -141,6 +143,7 @@ class App extends Component {
UIModalService, UIModalService,
UIDialogService, UIDialogService,
MeasurementService, MeasurementService,
LoggerService,
]); ]);
_initExtensions( _initExtensions(
[...defaultExtensions, ...extensions], [...defaultExtensions, ...extensions],
@@ -164,6 +167,7 @@ class App extends Component {
UIDialogService, UIDialogService,
UIModalService, UIModalService,
MeasurementService, MeasurementService,
LoggerService,
} = servicesManager.services; } = servicesManager.services;
if (this._userManager) { if (this._userManager) {
@@ -176,18 +180,20 @@ class App extends Component {
<UserManagerContext.Provider value={this._userManager}> <UserManagerContext.Provider value={this._userManager}>
<Router basename={routerBasename}> <Router basename={routerBasename}>
<WhiteLabelingContext.Provider value={whiteLabeling}> <WhiteLabelingContext.Provider value={whiteLabeling}>
<SnackbarProvider service={UINotificationService}> <LoggerProvider service={LoggerService}>
<DialogProvider service={UIDialogService}> <SnackbarProvider service={UINotificationService}>
<ModalProvider <DialogProvider service={UIDialogService}>
modal={OHIFModal} <ModalProvider
service={UIModalService} modal={OHIFModal}
> service={UIModalService}
<OHIFStandaloneViewer >
userManager={this._userManager} <OHIFStandaloneViewer
/> userManager={this._userManager}
</ModalProvider> />
</DialogProvider> </ModalProvider>
</SnackbarProvider> </DialogProvider>
</SnackbarProvider>
</LoggerProvider>
</WhiteLabelingContext.Provider> </WhiteLabelingContext.Provider>
</Router> </Router>
</UserManagerContext.Provider> </UserManagerContext.Provider>
@@ -206,13 +212,18 @@ class App extends Component {
<I18nextProvider i18n={i18n}> <I18nextProvider i18n={i18n}>
<Router basename={routerBasename}> <Router basename={routerBasename}>
<WhiteLabelingContext.Provider value={whiteLabeling}> <WhiteLabelingContext.Provider value={whiteLabeling}>
<SnackbarProvider service={UINotificationService}> <LoggerProvider service={LoggerService}>
<DialogProvider service={UIDialogService}> <SnackbarProvider service={UINotificationService}>
<ModalProvider modal={OHIFModal} service={UIModalService}> <DialogProvider service={UIDialogService}>
<OHIFStandaloneViewer /> <ModalProvider
</ModalProvider> modal={OHIFModal}
</DialogProvider> service={UIModalService}
</SnackbarProvider> >
<OHIFStandaloneViewer />
</ModalProvider>
</DialogProvider>
</SnackbarProvider>
</LoggerProvider>
</WhiteLabelingContext.Provider> </WhiteLabelingContext.Provider>
</Router> </Router>
</I18nextProvider> </I18nextProvider>
@@ -4,7 +4,7 @@ import React, { useEffect } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import { utils } from '@ohif/core'; import { utils } from '@ohif/core';
import { useSnackbarContext } from '@ohif/ui'; import { useSnackbarContext, useLogger } from '@ohif/ui';
// //
import ViewportPane from './ViewportPane.js'; import ViewportPane from './ViewportPane.js';
import DefaultViewport from './DefaultViewport.js'; import DefaultViewport from './DefaultViewport.js';
@@ -12,7 +12,7 @@ import EmptyViewport from './EmptyViewport.js';
const { loadAndCacheDerivedDisplaySets } = utils; const { loadAndCacheDerivedDisplaySets } = utils;
const ViewportGrid = function (props) { const ViewportGrid = function(props) {
const { const {
activeViewportIndex, activeViewportIndex,
availablePlugins, availablePlugins,
@@ -36,14 +36,15 @@ const ViewportGrid = function (props) {
} }
const snackbar = useSnackbarContext(); const snackbar = useSnackbarContext();
const logger = useLogger();
useEffect(() => { useEffect(() => {
if (isStudyLoaded) { if (isStudyLoaded) {
viewportData.forEach(displaySet => { viewportData.forEach(displaySet => {
const promises = loadAndCacheDerivedDisplaySets(displaySet, studies); const promises = loadAndCacheDerivedDisplaySets(displaySet, studies);
promises.forEach(promise => { promises.forEach(promise => {
promise.catch(error => { promise.catch(error => {
logger.error({ error, message: error.message });
snackbar.show({ snackbar.show({
title: 'Error loading derived display set:', title: 'Error loading derived display set:',
message: error.message, message: error.message,
@@ -86,7 +86,7 @@ class ToolbarRow extends Component {
// Note: This does not cleanly handle `studies` prop updating with panel open // Note: This does not cleanly handle `studies` prop updating with panel open
const isDisabled = const isDisabled =
typeof menuOption.isDisabled === 'function' && typeof menuOption.isDisabled === 'function' &&
menuOption.isDisabled(this.props.studies); menuOption.isDisabled(this.props.studies, this.props.activeViewport);
if (hasActiveContext && !isDisabled) { if (hasActiveContext && !isDisabled) {
const menuOptionEntry = { const menuOptionEntry = {
@@ -114,25 +114,30 @@ class ToolbarRow extends Component {
prevProps.activeContexts !== this.props.activeContexts; prevProps.activeContexts !== this.props.activeContexts;
const prevStudies = prevProps.studies; const prevStudies = prevProps.studies;
const prevActiveViewport = prevProps.activeViewport;
const activeViewport = this.props.activeViewport;
const studies = this.props.studies; const studies = this.props.studies;
const seriesPerStudyCount = this.seriesPerStudyCount; const seriesPerStudyCount = this.seriesPerStudyCount;
let studiesUpdated = false; let shouldUpdate = false;
if (prevStudies.length !== studies.length) { if (
studiesUpdated = true; prevStudies.length !== studies.length ||
prevActiveViewport !== activeViewport
) {
shouldUpdate = true;
} else { } else {
for (let i = 0; i < studies.length; i++) { for (let i = 0; i < studies.length; i++) {
if (studies[i].series.length !== seriesPerStudyCount[i]) { if (studies[i].series.length !== seriesPerStudyCount[i]) {
seriesPerStudyCount[i] = studies[i].series.length; seriesPerStudyCount[i] = studies[i].series.length;
studiesUpdated = true; shouldUpdate = true;
break; break;
} }
} }
} }
if (studiesUpdated) { if (shouldUpdate) {
this.updateButtonGroups(); this.updateButtonGroups();
} }
@@ -268,6 +268,9 @@ class Viewer extends Component {
{/* TOOLBAR */} {/* TOOLBAR */}
<ErrorBoundaryDialog context="ToolbarRow"> <ErrorBoundaryDialog context="ToolbarRow">
<ToolbarRow <ToolbarRow
activeViewport={
this.props.viewports[this.props.activeViewportIndex]
}
isLeftSidePanelOpen={this.state.isLeftSidePanelOpen} isLeftSidePanelOpen={this.state.isLeftSidePanelOpen}
isRightSidePanelOpen={this.state.isRightSidePanelOpen} isRightSidePanelOpen={this.state.isRightSidePanelOpen}
selectedLeftSidePanel={ selectedLeftSidePanel={
@@ -320,11 +323,11 @@ class Viewer extends Component {
activeIndex={this.props.activeViewportIndex} activeIndex={this.props.activeViewportIndex}
/> />
) : ( ) : (
<ConnectedStudyBrowser <ConnectedStudyBrowser
studies={this.state.thumbnails} studies={this.state.thumbnails}
studyMetadata={this.props.studies} studyMetadata={this.props.studies}
/> />
)} )}
</SidePanel> </SidePanel>
</ErrorBoundaryDialog> </ErrorBoundaryDialog>
@@ -347,7 +350,9 @@ class Viewer extends Component {
viewports={this.props.viewports} viewports={this.props.viewports}
studies={this.props.studies} studies={this.props.studies}
activeIndex={this.props.activeViewportIndex} activeIndex={this.props.activeViewportIndex}
activeViewport={this.props.viewports[this.props.activeViewportIndex]} activeViewport={
this.props.viewports[this.props.activeViewportIndex]
}
getActiveViewport={this._getActiveViewport} getActiveViewport={this._getActiveViewport}
/> />
)} )}
@@ -371,7 +376,7 @@ export default withDialog(Viewer);
* @param {Study[]} studies * @param {Study[]} studies
* @param {DisplaySet[]} studies[].displaySets * @param {DisplaySet[]} studies[].displaySets
*/ */
const _mapStudiesToThumbnails = function (studies) { const _mapStudiesToThumbnails = function(studies) {
return studies.map(study => { return studies.map(study => {
const { StudyInstanceUID } = study; const { StudyInstanceUID } = study;
@@ -5,10 +5,11 @@ import usePrevious from '../customHooks/usePrevious';
import ConnectedViewer from './ConnectedViewer.js'; import ConnectedViewer from './ConnectedViewer.js';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { extensionManager } from './../App.js'; import { extensionManager } from './../App.js';
import { useSnackbarContext } from '@ohif/ui'; import { useSnackbarContext, ErrorPage } from '@ohif/ui';
// Contexts // Contexts
import AppContext from '../context/AppContext'; import AppContext from '../context/AppContext';
import NotFound from '../routes/NotFound';
const { OHIFStudyMetadata, OHIFSeriesMetadata } = metadata; const { OHIFStudyMetadata, OHIFSeriesMetadata } = metadata;
const { retrieveStudiesMetadata, deleteStudyMetadataPromise } = studies; const { retrieveStudiesMetadata, deleteStudyMetadataPromise } = studies;
@@ -291,7 +292,7 @@ function ViewerRetrieveStudyData({
}) })
.catch(error => { .catch(error => {
if (error && !error.isCanceled) { if (error && !error.isCanceled) {
setError(true); setError(error);
log.error(error); log.error(error);
} }
}); });
@@ -358,13 +359,13 @@ function ViewerRetrieveStudyData({
}) })
.catch(error => { .catch(error => {
if (error && !error.isCanceled) { if (error && !error.isCanceled) {
setError(true); setError(error);
log.error(error); log.error(error);
} }
}); });
} catch (error) { } catch (error) {
if (error) { if (error) {
setError(true); setError(error);
log.error(error); log.error(error);
} }
} }
@@ -411,7 +412,12 @@ function ViewerRetrieveStudyData({
}, []); }, []);
if (error) { if (error) {
return <div>Error: {JSON.stringify(error)}</div>; const content = JSON.stringify(error);
if (content.includes('404') || content.includes('NOT_FOUND')) {
return <NotFound />;
}
return <NotFound message="Failed to retrieve study data" />;
} }
return ( return (
@@ -336,12 +336,6 @@ async function getStudyList(
} = filters; } = filters;
const sortFieldName = sort.fieldName || 'PatientName'; const sortFieldName = sort.fieldName || 'PatientName';
const sortDirection = sort.direction || 'desc'; const sortDirection = sort.direction || 'desc';
const studyDateFrom =
filters.studyDateFrom ||
moment()
.subtract(25000, 'days')
.toDate();
const studyDateTo = filters.studyDateTo || new Date();
const mappedFilters = { const mappedFilters = {
PatientID: filters.PatientID, PatientID: filters.PatientID,
@@ -350,8 +344,8 @@ async function getStudyList(
StudyDescription: filters.StudyDescription, StudyDescription: filters.StudyDescription,
ModalitiesInStudy: filters.modalities, ModalitiesInStudy: filters.modalities,
// NEVER CHANGE // NEVER CHANGE
studyDateFrom, studyDateFrom: filters.studyDateFrom,
studyDateTo, studyDateTo: filters.studyDateTo,
limit: rowsPerPage, limit: rowsPerPage,
offset: pageNumber * rowsPerPage, offset: pageNumber * rowsPerPage,
fuzzymatching: server.supportsFuzzyMatching === true, fuzzymatching: server.supportsFuzzyMatching === true,
+4 -4
View File
@@ -6619,10 +6619,10 @@ dateformat@^3.0.0:
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae"
integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==
dcmjs@0.17.0: dcmjs@0.18.3:
version "0.17.0" version "0.18.3"
resolved "https://registry.yarnpkg.com/dcmjs/-/dcmjs-0.17.0.tgz#dbfd6db3efd2936f9bead9c902b7db396f64e9f5" resolved "https://registry.yarnpkg.com/dcmjs/-/dcmjs-0.18.3.tgz#17d5a23d96b63264b8a1a859e4cb000b3e20495b"
integrity sha512-7JnNqNWXqjGyspLRwKM4nn+TU/+w3iMl9boU4eHrr831M4crMWWIiSQDejpOnfDT9+opqyeaYcNkiekr7p6TFg== integrity sha512-nmG6wEBcIMnadXAZOTcXwacBv+lrh8bqPwIKZwdy7AkdihLEwI6/OnyP+PYjzcdltuPu9wOQcKZionvXuCteag==
dependencies: dependencies:
"@babel/polyfill" "^7.8.3" "@babel/polyfill" "^7.8.3"
"@babel/runtime" "^7.8.4" "@babel/runtime" "^7.8.4"