From 073be065cff362716a0be1c50b1cd65363d55622 Mon Sep 17 00:00:00 2001 From: igoroctaviano Date: Fri, 1 Oct 2021 18:09:35 -0300 Subject: [PATCH 01/18] Update badge number based on active ds --- extensions/dicom-rt/src/index.js | 4 ++++ extensions/dicom-segmentation/src/index.js | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/extensions/dicom-rt/src/index.js b/extensions/dicom-rt/src/index.js index ff308e1332c..29efbcee6f1 100644 --- a/extensions/dicom-rt/src/index.js +++ b/extensions/dicom-rt/src/index.js @@ -112,6 +112,10 @@ export default { ['RTSTRUCT'].includes(ds.Modality) ) ) { + triggerRTPanelUpdatedEvent({ + badgeNumber: referencedDisplaySets.length, + target: 'rt-panel', + }); return false; } } diff --git a/extensions/dicom-segmentation/src/index.js b/extensions/dicom-segmentation/src/index.js index c36d3fab770..3136527d245 100644 --- a/extensions/dicom-segmentation/src/index.js +++ b/extensions/dicom-segmentation/src/index.js @@ -126,7 +126,7 @@ export default { label: 'Segmentations', target: 'segmentation-panel', stateEvent: SegmentationPanelTabUpdatedEvent, - isDisabled: studies => { + isDisabled: (studies, activeViewport) => { if (!studies) { return true; } @@ -139,6 +139,20 @@ export default { const series = study.series[j]; if (series.Modality === 'SEG') { + if (activeViewport) { + const studyMetadata = studyMetadataManager.get( + activeViewport.StudyInstanceUID + ); + const referencedDS = studyMetadata.getDerivedDatasets({ + referencedSeriesInstanceUID: + activeViewport.SeriesInstanceUID, + Modality: 'SEG', + }); + triggerSegmentationPanelTabUpdatedEvent({ + badgeNumber: referencedDS.length, + target: 'segmentation-panel', + }); + } return false; } } From 9481e2a99ee510a29c017a7c25e2a2253ed098ac Mon Sep 17 00:00:00 2001 From: ohif-bot Date: Wed, 6 Oct 2021 21:01:00 +0000 Subject: [PATCH 02/18] chore(release): publish [skip ci] - @ohif/extension-dicom-rt@0.7.2 - @ohif/extension-dicom-segmentation@0.7.2 - @ohif/viewer@4.12.1 --- extensions/dicom-rt/CHANGELOG.md | 8 ++++++++ extensions/dicom-rt/package.json | 2 +- extensions/dicom-segmentation/CHANGELOG.md | 8 ++++++++ extensions/dicom-segmentation/package.json | 2 +- platform/viewer/CHANGELOG.md | 8 ++++++++ platform/viewer/package.json | 6 +++--- 6 files changed, 29 insertions(+), 5 deletions(-) diff --git a/extensions/dicom-rt/CHANGELOG.md b/extensions/dicom-rt/CHANGELOG.md index e8ac12e8eef..56a3696eb86 100644 --- a/extensions/dicom-rt/CHANGELOG.md +++ b/extensions/dicom-rt/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.7.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-rt@0.7.1...@ohif/extension-dicom-rt@0.7.2) (2021-10-06) + +**Note:** Version bump only for package @ohif/extension-dicom-rt + + + + + ## [0.7.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-rt@0.7.0...@ohif/extension-dicom-rt@0.7.1) (2021-09-28) **Note:** Version bump only for package @ohif/extension-dicom-rt diff --git a/extensions/dicom-rt/package.json b/extensions/dicom-rt/package.json index 8377f8c0f78..9e411f98b6a 100644 --- a/extensions/dicom-rt/package.json +++ b/extensions/dicom-rt/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/extension-dicom-rt", - "version": "0.7.1", + "version": "0.7.2", "description": "OHIF extension for rendering DICOM RTSTRUCTs on top of cornerstone images.", "author": "OHIF", "license": "MIT", diff --git a/extensions/dicom-segmentation/CHANGELOG.md b/extensions/dicom-segmentation/CHANGELOG.md index 749889742fa..156beeeed75 100644 --- a/extensions/dicom-segmentation/CHANGELOG.md +++ b/extensions/dicom-segmentation/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.7.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-segmentation@0.7.1...@ohif/extension-dicom-segmentation@0.7.2) (2021-10-06) + +**Note:** Version bump only for package @ohif/extension-dicom-segmentation + + + + + ## [0.7.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-segmentation@0.7.0...@ohif/extension-dicom-segmentation@0.7.1) (2021-09-28) **Note:** Version bump only for package @ohif/extension-dicom-segmentation diff --git a/extensions/dicom-segmentation/package.json b/extensions/dicom-segmentation/package.json index 3fea29106f0..83fe40929a6 100644 --- a/extensions/dicom-segmentation/package.json +++ b/extensions/dicom-segmentation/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/extension-dicom-segmentation", - "version": "0.7.1", + "version": "0.7.2", "description": "OHIF extension for viewing segmentations in the 2D MPR view", "author": "OHIF", "license": "MIT", diff --git a/platform/viewer/CHANGELOG.md b/platform/viewer/CHANGELOG.md index f7ac79527f2..91b55088335 100644 --- a/platform/viewer/CHANGELOG.md +++ b/platform/viewer/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.12.1](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.12.0...@ohif/viewer@4.12.1) (2021-10-06) + +**Note:** Version bump only for package @ohif/viewer + + + + + # [4.12.0](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.11.2...@ohif/viewer@4.12.0) (2021-10-04) diff --git a/platform/viewer/package.json b/platform/viewer/package.json index d4ec299139f..4584c8df55b 100644 --- a/platform/viewer/package.json +++ b/platform/viewer/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/viewer", - "version": "4.12.0", + "version": "4.12.1", "description": "OHIF Viewer", "author": "OHIF Contributors", "license": "MIT", @@ -53,8 +53,8 @@ "@ohif/extension-dicom-html": "^1.3.11", "@ohif/extension-dicom-microscopy": "^0.52.0", "@ohif/extension-dicom-pdf": "^1.1.0", - "@ohif/extension-dicom-rt": "^0.7.1", - "@ohif/extension-dicom-segmentation": "^0.7.1", + "@ohif/extension-dicom-rt": "^0.7.2", + "@ohif/extension-dicom-segmentation": "^0.7.2", "@ohif/extension-lesion-tracker": "^0.2.1", "@ohif/extension-vtk": "^1.12.3", "@ohif/i18n": "^0.53.0", From 8903adaea76b8fb91661d787490fcec90c1647a2 Mon Sep 17 00:00:00 2001 From: Davide Punzo Date: Fri, 15 Oct 2021 13:29:36 +0200 Subject: [PATCH 03/18] Re #2571: thumbnail footer remove instance number and add link icon if any derived display set is present (#2582) * Re #2571, thumbnail footer layout modifications: remove instance number and add link icon if any derived display set is present. --- .../components/studyBrowser/StudyBrowser.js | 8 ++- .../src/components/studyBrowser/Thumbnail.js | 57 +++++++++++++++---- .../viewer/src/connectedComponents/Viewer.js | 35 +++++++++++- 3 files changed, 83 insertions(+), 17 deletions(-) diff --git a/platform/ui/src/components/studyBrowser/StudyBrowser.js b/platform/ui/src/components/studyBrowser/StudyBrowser.js index a745c02fb24..c4afcf53b67 100644 --- a/platform/ui/src/components/studyBrowser/StudyBrowser.js +++ b/platform/ui/src/components/studyBrowser/StudyBrowser.js @@ -25,11 +25,12 @@ function StudyBrowser(props) { altImageText, displaySetInstanceUID, imageId, - InstanceNumber, + derivedDisplaySetsNumber, numImageFrames, SeriesDescription, SeriesNumber, hasWarnings, + hasDerivedDisplaySets, } = thumb; return ( @@ -48,12 +49,13 @@ function StudyBrowser(props) { // Thumb altImageText={altImageText} imageId={imageId} - InstanceNumber={InstanceNumber} + derivedDisplaySetsNumber={derivedDisplaySetsNumber} displaySetInstanceUID={displaySetInstanceUID} // used by drop numImageFrames={numImageFrames} SeriesDescription={SeriesDescription} SeriesNumber={SeriesNumber} hasWarnings={hasWarnings} + hasDerivedDisplaySets={hasDerivedDisplaySets} // Events onClick={onThumbnailClick.bind( undefined, @@ -83,7 +85,7 @@ StudyBrowser.propTypes = { altImageText: PropTypes.string, displaySetInstanceUID: PropTypes.string.isRequired, imageId: PropTypes.string, - InstanceNumber: PropTypes.number, + derivedDisplaySetsNumber: PropTypes.number, numImageFrames: PropTypes.number, SeriesDescription: PropTypes.string, SeriesNumber: PropTypes.number, diff --git a/platform/ui/src/components/studyBrowser/Thumbnail.js b/platform/ui/src/components/studyBrowser/Thumbnail.js index d09a6c8b8f8..edde866da8a 100644 --- a/platform/ui/src/components/studyBrowser/Thumbnail.js +++ b/platform/ui/src/components/studyBrowser/Thumbnail.js @@ -15,11 +15,12 @@ const StudyLoadingListener = classes.StudyLoadingListener; function ThumbnailFooter({ SeriesDescription, SeriesNumber, - InstanceNumber, numImageFrames, hasWarnings, + hasDerivedDisplaySets, }) { const [inconsistencyWarnings, inconsistencyWarningsSet] = useState([]); + const [derivedDisplaySetsActive, derivedDisplaySetsActiveSet] = useState([]); useEffect(() => { let unmounted = false; @@ -28,10 +29,15 @@ function ThumbnailFooter({ inconsistencyWarningsSet(response); } }); + hasDerivedDisplaySets.then(response => { + if (!unmounted) { + derivedDisplaySetsActiveSet(response); + } + }); return () => { unmounted = true; }; - }, [hasWarnings]); + }, [hasWarnings, hasDerivedDisplaySets]); const infoOnly = !SeriesDescription; @@ -88,20 +94,47 @@ function ThumbnailFooter({ ); }; + + const getDerivedInfo = derivedDisplaySetsActive => { + return ( + + {derivedDisplaySetsActive ? ( +
+ +
+ ) : ( + + )} +
+ ); + }; + const getSeriesInformation = ( SeriesNumber, - InstanceNumber, numImageFrames, - inconsistencyWarnings + inconsistencyWarnings, + derivedDisplaySetsActive ) => { - if (!SeriesNumber && !InstanceNumber && !numImageFrames) { + if (!SeriesNumber && !numImageFrames) { return; } const seriesInformation = (
- {getInfo(SeriesNumber, 'S:')} - {getInfo(InstanceNumber, 'I:')} - {getInfo(numImageFrames, '', 'image-frames')} + + {SeriesNumber !== undefined ? ( + getInfo(SeriesNumber, 'S:') + ) : ( + + )} + + + {numImageFrames !== undefined ? ( + getInfo(numImageFrames, '', 'image-frames') + ) : ( + + )} + + {getDerivedInfo(derivedDisplaySetsActive)} {getWarningInfo(SeriesNumber, inconsistencyWarnings)}
); @@ -114,9 +147,9 @@ function ThumbnailFooter({
{SeriesDescription}
{getSeriesInformation( SeriesNumber, - InstanceNumber, numImageFrames, - inconsistencyWarnings + inconsistencyWarnings, + derivedDisplaySetsActive )} ); @@ -130,11 +163,11 @@ function Thumbnail(props) { displaySetInstanceUID, imageId, imageSrc, - InstanceNumber, numImageFrames, SeriesDescription, SeriesNumber, hasWarnings, + hasDerivedDisplaySets, StudyInstanceUID, onClick, onDoubleClick, @@ -232,8 +265,8 @@ Thumbnail.propTypes = { altImageText: PropTypes.string, SeriesDescription: PropTypes.string, SeriesNumber: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - InstanceNumber: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), hasWarnings: PropTypes.instanceOf(Promise), + hasDerivedDisplaySets: PropTypes.instanceOf(Promise), numImageFrames: PropTypes.number, onDoubleClick: PropTypes.func, onClick: PropTypes.func, diff --git a/platform/viewer/src/connectedComponents/Viewer.js b/platform/viewer/src/connectedComponents/Viewer.js index f0eb0831506..9178c98fc7c 100644 --- a/platform/viewer/src/connectedComponents/Viewer.js +++ b/platform/viewer/src/connectedComponents/Viewer.js @@ -23,6 +23,8 @@ import './Viewer.css'; import StudyPrefetcher from '../components/StudyPrefetcher.js'; import StudyLoadingMonitor from '../components/StudyLoadingMonitor'; +const { studyMetadataManager } = OHIF.utils; + class Viewer extends Component { static propTypes = { studies: PropTypes.arrayOf( @@ -429,6 +431,31 @@ class Viewer extends Component { export default withDialog(Viewer); +/** + * Async function to check if the displaySet has any derived one + * + * @param {*object} displaySet + * @param {*object} study + * @returns {bool} + */ +const _checkForDerivedDisplaySets = async function(displaySet, study) { + let derivedDisplaySetsNumber = 0; + if ( + displaySet.Modality && + !['SEG', 'SR', 'RTSTRUCT', 'RTDOSE'].includes(displaySet.Modality) + ) { + const studyMetadata = studyMetadataManager.get(study.StudyInstanceUID); + + const derivedDisplaySets = studyMetadata.getDerivedDatasets({ + referencedSeriesInstanceUID: displaySet.SeriesInstanceUID, + }); + + derivedDisplaySetsNumber = derivedDisplaySets.length; + } + + return derivedDisplaySetsNumber > 0; +}; + /** * Async function to check if there are any inconsistences in the series. * @@ -684,7 +711,6 @@ const _mapStudiesToThumbnails = function(studies, activeDisplaySetInstanceUID) { const { displaySetInstanceUID, SeriesDescription, - InstanceNumber, numImageFrames, SeriesNumber, } = displaySet; @@ -709,6 +735,11 @@ const _mapStudiesToThumbnails = function(studies, activeDisplaySetInstanceUID) { studies ); + const hasDerivedDisplaySets = _checkForDerivedDisplaySets( + displaySet, + study + ); + return { active: _isDisplaySetActive( displaySet, @@ -719,10 +750,10 @@ const _mapStudiesToThumbnails = function(studies, activeDisplaySetInstanceUID) { altImageText, displaySetInstanceUID, SeriesDescription, - InstanceNumber, numImageFrames, SeriesNumber, hasWarnings, + hasDerivedDisplaySets, }; }); From 52c95a1209509805811b24449f6a8f992be4340c Mon Sep 17 00:00:00 2001 From: ohif-bot Date: Fri, 15 Oct 2021 11:37:07 +0000 Subject: [PATCH 04/18] chore(release): publish [skip ci] - @ohif/extension-vtk@1.12.4 - @ohif/ui@1.10.3 - @ohif/viewer@4.12.2 --- extensions/vtk/CHANGELOG.md | 8 ++++++++ extensions/vtk/package.json | 4 ++-- platform/ui/CHANGELOG.md | 8 ++++++++ platform/ui/package.json | 2 +- platform/viewer/CHANGELOG.md | 8 ++++++++ platform/viewer/package.json | 6 +++--- 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/extensions/vtk/CHANGELOG.md b/extensions/vtk/CHANGELOG.md index d73d0d9cfed..e4176515700 100644 --- a/extensions/vtk/CHANGELOG.md +++ b/extensions/vtk/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.12.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.12.3...@ohif/extension-vtk@1.12.4) (2021-10-15) + +**Note:** Version bump only for package @ohif/extension-vtk + + + + + ## [1.12.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.12.2...@ohif/extension-vtk@1.12.3) (2021-10-04) **Note:** Version bump only for package @ohif/extension-vtk diff --git a/extensions/vtk/package.json b/extensions/vtk/package.json index 0fb309adf72..fd1734f7fbc 100644 --- a/extensions/vtk/package.json +++ b/extensions/vtk/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/extension-vtk", - "version": "1.12.3", + "version": "1.12.4", "description": "OHIF extension for VTK.js", "author": "OHIF", "license": "MIT", @@ -54,7 +54,7 @@ }, "devDependencies": { "@ohif/core": "^2.16.0", - "@ohif/ui": "^1.10.2", + "@ohif/ui": "^1.10.3", "cornerstone-tools": "^6.0.0", "cornerstone-wado-image-loader": "^4.0.3", "dicom-parser": "^1.8.9", diff --git a/platform/ui/CHANGELOG.md b/platform/ui/CHANGELOG.md index a000474dea6..bda33634b0a 100644 --- a/platform/ui/CHANGELOG.md +++ b/platform/ui/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.10.3](https://github.com/OHIF/Viewers/compare/@ohif/ui@1.10.2...@ohif/ui@1.10.3) (2021-10-15) + +**Note:** Version bump only for package @ohif/ui + + + + + ## [1.10.2](https://github.com/OHIF/Viewers/compare/@ohif/ui@1.10.1...@ohif/ui@1.10.2) (2021-09-24) diff --git a/platform/ui/package.json b/platform/ui/package.json index 130b5e34d8a..ebd9ff3008c 100644 --- a/platform/ui/package.json +++ b/platform/ui/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/ui", - "version": "1.10.2", + "version": "1.10.3", "description": "A set of React components for Medical Imaging Viewers", "author": "OHIF Contributors", "license": "MIT", diff --git a/platform/viewer/CHANGELOG.md b/platform/viewer/CHANGELOG.md index 91b55088335..07d35f7fa73 100644 --- a/platform/viewer/CHANGELOG.md +++ b/platform/viewer/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.12.2](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.12.1...@ohif/viewer@4.12.2) (2021-10-15) + +**Note:** Version bump only for package @ohif/viewer + + + + + ## [4.12.1](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.12.0...@ohif/viewer@4.12.1) (2021-10-06) **Note:** Version bump only for package @ohif/viewer diff --git a/platform/viewer/package.json b/platform/viewer/package.json index 4584c8df55b..7ac84178672 100644 --- a/platform/viewer/package.json +++ b/platform/viewer/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/viewer", - "version": "4.12.1", + "version": "4.12.2", "description": "OHIF Viewer", "author": "OHIF Contributors", "license": "MIT", @@ -56,9 +56,9 @@ "@ohif/extension-dicom-rt": "^0.7.2", "@ohif/extension-dicom-segmentation": "^0.7.2", "@ohif/extension-lesion-tracker": "^0.2.1", - "@ohif/extension-vtk": "^1.12.3", + "@ohif/extension-vtk": "^1.12.4", "@ohif/i18n": "^0.53.0", - "@ohif/ui": "^1.10.2", + "@ohif/ui": "^1.10.3", "@tanem/react-nprogress": "^1.1.25", "classnames": "^2.2.6", "core-js": "^3.2.1", From 9194ec2404c4f951eb60bd8dc020af2c2577b4f5 Mon Sep 17 00:00:00 2001 From: Bill Wallace Date: Mon, 25 Oct 2021 11:08:10 -0400 Subject: [PATCH 05/18] fix(OHIF):The header depth was too deep for display SR files. (#2594) --- extensions/dicom-html/src/DicomHtmlViewport.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/dicom-html/src/DicomHtmlViewport.js b/extensions/dicom-html/src/DicomHtmlViewport.js index fe7f8d48881..0c4cd4fece2 100644 --- a/extensions/dicom-html/src/DicomHtmlViewport.js +++ b/extensions/dicom-html/src/DicomHtmlViewport.js @@ -160,7 +160,7 @@ const getContentSequence = (data, level = 1) => { const root = []; if (header) { - const HeaderDynamicLevel = `h${level}`; + const HeaderDynamicLevel = `h${Math.min(level, 6)}`; root.push({header}); } @@ -170,7 +170,7 @@ const getContentSequence = (data, level = 1) => { if (key === '_meta') { const HeaderDynamicLevel = `h3`; - root.push(
); + root.push(
); root.push( DICOM File Meta Information From 729272a985fbc43a6ed627500a8b1d1aa71ecc41 Mon Sep 17 00:00:00 2001 From: ohif-bot Date: Mon, 25 Oct 2021 15:11:00 +0000 Subject: [PATCH 06/18] chore(release): publish [skip ci] - @ohif/extension-dicom-html@1.3.12 - @ohif/viewer@4.12.3 --- extensions/dicom-html/CHANGELOG.md | 8 ++++++++ extensions/dicom-html/package.json | 2 +- platform/viewer/CHANGELOG.md | 8 ++++++++ platform/viewer/package.json | 4 ++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/extensions/dicom-html/CHANGELOG.md b/extensions/dicom-html/CHANGELOG.md index deb0b02899d..6b90cdacc7b 100644 --- a/extensions/dicom-html/CHANGELOG.md +++ b/extensions/dicom-html/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.3.12](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@1.3.11...@ohif/extension-dicom-html@1.3.12) (2021-10-25) + +**Note:** Version bump only for package @ohif/extension-dicom-html + + + + + ## [1.3.11](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@1.3.10...@ohif/extension-dicom-html@1.3.11) (2021-09-28) **Note:** Version bump only for package @ohif/extension-dicom-html diff --git a/extensions/dicom-html/package.json b/extensions/dicom-html/package.json index a527b444d9a..5904406dd43 100644 --- a/extensions/dicom-html/package.json +++ b/extensions/dicom-html/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/extension-dicom-html", - "version": "1.3.11", + "version": "1.3.12", "description": "OHIF extension for rendering structured reports to HTML", "author": "OHIF", "license": "MIT", diff --git a/platform/viewer/CHANGELOG.md b/platform/viewer/CHANGELOG.md index 07d35f7fa73..50258bb3972 100644 --- a/platform/viewer/CHANGELOG.md +++ b/platform/viewer/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.12.3](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.12.2...@ohif/viewer@4.12.3) (2021-10-25) + +**Note:** Version bump only for package @ohif/viewer + + + + + ## [4.12.2](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.12.1...@ohif/viewer@4.12.2) (2021-10-15) **Note:** Version bump only for package @ohif/viewer diff --git a/platform/viewer/package.json b/platform/viewer/package.json index 7ac84178672..8660ab8e87b 100644 --- a/platform/viewer/package.json +++ b/platform/viewer/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/viewer", - "version": "4.12.2", + "version": "4.12.3", "description": "OHIF Viewer", "author": "OHIF Contributors", "license": "MIT", @@ -50,7 +50,7 @@ "@ohif/core": "^2.16.0", "@ohif/extension-cornerstone": "^2.12.1", "@ohif/extension-debugging": "^0.3.0", - "@ohif/extension-dicom-html": "^1.3.11", + "@ohif/extension-dicom-html": "^1.3.12", "@ohif/extension-dicom-microscopy": "^0.52.0", "@ohif/extension-dicom-pdf": "^1.1.0", "@ohif/extension-dicom-rt": "^0.7.2", From 03a34a75a1cafbbed97d1ff6ddffe6236d40c23d Mon Sep 17 00:00:00 2001 From: Igor Octaviano Date: Tue, 26 Oct 2021 05:19:12 -0300 Subject: [PATCH 07/18] Add checks for study metadata in rt and seg panels + bump dcmjs to fix circular references issues naturalizing datasets (#2588) Co-authored-by: Davide Punzo --- extensions/cornerstone/package.json | 2 +- extensions/dicom-html/package.json | 2 +- extensions/dicom-html/src/DicomHtmlViewport.js | 2 +- extensions/dicom-rt/package.json | 2 +- extensions/dicom-rt/src/index.js | 11 +++-------- extensions/dicom-segmentation/package.json | 2 +- extensions/dicom-segmentation/src/index.js | 3 +++ extensions/dicom-tag-browser/package.json | 2 +- extensions/vtk/package.json | 2 +- platform/core/package.json | 2 +- platform/ui/src/contextProviders/SnackbarProvider.js | 2 +- platform/viewer/package.json | 2 +- yarn.lock | 8 ++++---- 13 files changed, 20 insertions(+), 22 deletions(-) diff --git a/extensions/cornerstone/package.json b/extensions/cornerstone/package.json index c191fe35dbd..da3fd873bfc 100644 --- a/extensions/cornerstone/package.json +++ b/extensions/cornerstone/package.json @@ -36,7 +36,7 @@ "cornerstone-math": "^0.1.9", "cornerstone-tools": "^6.0.0", "cornerstone-wado-image-loader": "^4.0.3", - "dcmjs": "0.18.9", + "dcmjs": "0.18.10", "dicom-parser": "^1.8.9", "hammerjs": "^2.0.8", "prop-types": "^15.6.2", diff --git a/extensions/dicom-html/package.json b/extensions/dicom-html/package.json index 5904406dd43..85dbc286f02 100644 --- a/extensions/dicom-html/package.json +++ b/extensions/dicom-html/package.json @@ -29,7 +29,7 @@ }, "peerDependencies": { "@ohif/core": "^0.50.0", - "dcmjs": "0.18.9", + "dcmjs": "0.18.10", "prop-types": "^15.6.2", "react": "^16.8.6", "react-dom": "^16.8.6" diff --git a/extensions/dicom-html/src/DicomHtmlViewport.js b/extensions/dicom-html/src/DicomHtmlViewport.js index 0c4cd4fece2..5acedaac9d9 100644 --- a/extensions/dicom-html/src/DicomHtmlViewport.js +++ b/extensions/dicom-html/src/DicomHtmlViewport.js @@ -217,7 +217,7 @@ class DicomHtmlViewport extends Component { }; componentDidMount() { - const dataSet = this.setContentFromByteArray(this.props.byteArray); + this.setContentFromByteArray(this.props.byteArray); } setContentFromByteArray(byteArray) { diff --git a/extensions/dicom-rt/package.json b/extensions/dicom-rt/package.json index 9e411f98b6a..eff9e7360cb 100644 --- a/extensions/dicom-rt/package.json +++ b/extensions/dicom-rt/package.json @@ -31,7 +31,7 @@ "@ohif/core": "^0.50.0", "cornerstone-core": "^2.5.0", "cornerstone-tools": "^6.0.0", - "dcmjs": "0.18.9", + "dcmjs": "0.18.10", "gl-matrix": "^3.3.0", "prop-types": "^15.6.2", "react": "^16.8.6", diff --git a/extensions/dicom-rt/src/index.js b/extensions/dicom-rt/src/index.js index 29efbcee6f1..383440e1051 100644 --- a/extensions/dicom-rt/src/index.js +++ b/extensions/dicom-rt/src/index.js @@ -91,17 +91,12 @@ export default { } if (activeViewport) { - const study = studies.find( - s => s.StudyInstanceUID === activeViewport.StudyInstanceUID - ); - const ds = study.displaySets.find( - ds => - ds.displaySetInstanceUID === - activeViewport.displaySetInstanceUID - ); const studyMetadata = studyMetadataManager.get( activeViewport.StudyInstanceUID ); + if (!studyMetadata) { + return; + } const referencedDisplaySets = studyMetadata.getDerivedDatasets({ referencedSeriesInstanceUID: activeViewport.SeriesInstanceUID, Modality: 'RTSTRUCT', diff --git a/extensions/dicom-segmentation/package.json b/extensions/dicom-segmentation/package.json index 83fe40929a6..3bb507d4233 100644 --- a/extensions/dicom-segmentation/package.json +++ b/extensions/dicom-segmentation/package.json @@ -31,7 +31,7 @@ "@ohif/core": "^0.50.0", "cornerstone-core": "^2.5.0", "cornerstone-tools": "^6.0.0", - "dcmjs": "0.18.9", + "dcmjs": "0.18.10", "prop-types": "^15.6.2", "react": "^16.8.6", "react-dom": "^16.8.6" diff --git a/extensions/dicom-segmentation/src/index.js b/extensions/dicom-segmentation/src/index.js index 3136527d245..17bd246b7e0 100644 --- a/extensions/dicom-segmentation/src/index.js +++ b/extensions/dicom-segmentation/src/index.js @@ -143,6 +143,9 @@ export default { const studyMetadata = studyMetadataManager.get( activeViewport.StudyInstanceUID ); + if (!studyMetadata) { + return; + } const referencedDS = studyMetadata.getDerivedDatasets({ referencedSeriesInstanceUID: activeViewport.SeriesInstanceUID, diff --git a/extensions/dicom-tag-browser/package.json b/extensions/dicom-tag-browser/package.json index f02aa341e2e..4563f2a88f5 100644 --- a/extensions/dicom-tag-browser/package.json +++ b/extensions/dicom-tag-browser/package.json @@ -28,7 +28,7 @@ }, "peerDependencies": { "@ohif/core": "^2.6.0", - "dcmjs": "0.18.9", + "dcmjs": "0.18.10", "react": "^16.8.6" }, "dependencies": { diff --git a/extensions/vtk/package.json b/extensions/vtk/package.json index fd1734f7fbc..aa0d098d645 100644 --- a/extensions/vtk/package.json +++ b/extensions/vtk/package.json @@ -35,7 +35,7 @@ "cornerstone-core": "^2.5.0", "cornerstone-tools": "^6.0.0", "cornerstone-wado-image-loader": "^4.0.3", - "dcmjs": "0.18.9", + "dcmjs": "0.18.10", "dicom-parser": "^1.8.9", "i18next": "^17.0.3", "i18next-browser-languagedetector": "^3.0.1", diff --git a/platform/core/package.json b/platform/core/package.json index 1fffa158756..087678cf282 100644 --- a/platform/core/package.json +++ b/platform/core/package.json @@ -39,7 +39,7 @@ "dependencies": { "@babel/runtime": "^7.5.5", "ajv": "^6.10.0", - "dcmjs": "0.18.9", + "dcmjs": "0.18.10", "dicomweb-client": "^0.8.1", "immer": "6.0.2", "isomorphic-base64": "^1.0.2", diff --git a/platform/ui/src/contextProviders/SnackbarProvider.js b/platform/ui/src/contextProviders/SnackbarProvider.js index 6e54f2334a8..840833af9e3 100644 --- a/platform/ui/src/contextProviders/SnackbarProvider.js +++ b/platform/ui/src/contextProviders/SnackbarProvider.js @@ -41,7 +41,7 @@ const SnackbarProvider = ({ children, service }) => { LogManager.subscribe(LogManager.EVENTS.OnLog, onLogHandler); return () => { - LogManager.subscribe(LogManager.EVENTS.OnLog, onLogHandler); + LogManager.unsubscribe(LogManager.EVENTS.OnLog, onLogHandler); }; }, [show]); diff --git a/platform/viewer/package.json b/platform/viewer/package.json index 8660ab8e87b..7271b526234 100644 --- a/platform/viewer/package.json +++ b/platform/viewer/package.json @@ -66,7 +66,7 @@ "cornerstone-math": "^0.1.9", "cornerstone-tools": "^6.0.0", "cornerstone-wado-image-loader": "^4.0.3", - "dcmjs": "0.18.9", + "dcmjs": "0.18.10", "dicom-parser": "^1.8.9", "dicomweb-client": "^0.8.1", "hammerjs": "^2.0.8", diff --git a/yarn.lock b/yarn.lock index 08f3afd08a5..f7df087f1d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6647,10 +6647,10 @@ dateformat@^3.0.0: resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== -dcmjs@0.18.9: - version "0.18.9" - resolved "https://registry.yarnpkg.com/dcmjs/-/dcmjs-0.18.9.tgz#0e18fcff975aaae8ca01a96e781fa75c29ec97f3" - integrity sha512-aTu4fUo3TSgohJC+U509qdXL1per09XvlYdQva0BGtIZMr/iR5n8h/ojpcDTRJoVtSuaj331KJj1yCj8FMMK4Q== +dcmjs@0.18.10: + version "0.18.10" + resolved "https://registry.yarnpkg.com/dcmjs/-/dcmjs-0.18.10.tgz#9e293a20dc359c7eba6c81b6afaf5a52fa841288" + integrity sha512-GLW1KJmzs+1ye8WA29wDy+cOHa4dYv2Q5XPQuX33X4bK5AqzS+56IzuCH+WkQXnvALZZDBFgbPztOVdUwnN4uw== dependencies: "@babel/polyfill" "^7.8.3" "@babel/runtime" "^7.8.4" From 5b0b6301b99a04ff55e568cd1d51e5d30a498a17 Mon Sep 17 00:00:00 2001 From: ohif-bot Date: Tue, 26 Oct 2021 08:23:03 +0000 Subject: [PATCH 08/18] chore(release): publish [skip ci] - @ohif/extension-cornerstone@2.12.2 - @ohif/extension-dicom-html@1.3.13 - @ohif/extension-dicom-rt@0.7.3 - @ohif/extension-dicom-segmentation@0.7.3 - @ohif/extension-dicom-tag-browser@0.2.13 - @ohif/extension-vtk@1.12.5 - @ohif/core@2.16.1 - @ohif/ui@1.10.4 - @ohif/viewer@4.12.4 --- extensions/cornerstone/CHANGELOG.md | 8 ++++++++ extensions/cornerstone/package.json | 2 +- extensions/dicom-html/CHANGELOG.md | 8 ++++++++ extensions/dicom-html/package.json | 2 +- extensions/dicom-rt/CHANGELOG.md | 8 ++++++++ extensions/dicom-rt/package.json | 2 +- extensions/dicom-segmentation/CHANGELOG.md | 8 ++++++++ extensions/dicom-segmentation/package.json | 2 +- extensions/dicom-tag-browser/CHANGELOG.md | 8 ++++++++ extensions/dicom-tag-browser/package.json | 2 +- extensions/vtk/CHANGELOG.md | 8 ++++++++ extensions/vtk/package.json | 6 +++--- platform/core/CHANGELOG.md | 8 ++++++++ platform/core/package.json | 2 +- platform/ui/CHANGELOG.md | 8 ++++++++ platform/ui/package.json | 2 +- platform/viewer/CHANGELOG.md | 8 ++++++++ platform/viewer/package.json | 16 ++++++++-------- 18 files changed, 90 insertions(+), 18 deletions(-) diff --git a/extensions/cornerstone/CHANGELOG.md b/extensions/cornerstone/CHANGELOG.md index afdc57dd2d0..5d8235cf22d 100644 --- a/extensions/cornerstone/CHANGELOG.md +++ b/extensions/cornerstone/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.12.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@2.12.1...@ohif/extension-cornerstone@2.12.2) (2021-10-26) + +**Note:** Version bump only for package @ohif/extension-cornerstone + + + + + ## [2.12.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@2.12.0...@ohif/extension-cornerstone@2.12.1) (2021-09-28) **Note:** Version bump only for package @ohif/extension-cornerstone diff --git a/extensions/cornerstone/package.json b/extensions/cornerstone/package.json index da3fd873bfc..4b4406479cc 100644 --- a/extensions/cornerstone/package.json +++ b/extensions/cornerstone/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/extension-cornerstone", - "version": "2.12.1", + "version": "2.12.2", "description": "OHIF extension for Cornerstone", "author": "OHIF", "license": "MIT", diff --git a/extensions/dicom-html/CHANGELOG.md b/extensions/dicom-html/CHANGELOG.md index 6b90cdacc7b..155319e9336 100644 --- a/extensions/dicom-html/CHANGELOG.md +++ b/extensions/dicom-html/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.3.13](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@1.3.12...@ohif/extension-dicom-html@1.3.13) (2021-10-26) + +**Note:** Version bump only for package @ohif/extension-dicom-html + + + + + ## [1.3.12](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@1.3.11...@ohif/extension-dicom-html@1.3.12) (2021-10-25) **Note:** Version bump only for package @ohif/extension-dicom-html diff --git a/extensions/dicom-html/package.json b/extensions/dicom-html/package.json index 85dbc286f02..df2153a7980 100644 --- a/extensions/dicom-html/package.json +++ b/extensions/dicom-html/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/extension-dicom-html", - "version": "1.3.12", + "version": "1.3.13", "description": "OHIF extension for rendering structured reports to HTML", "author": "OHIF", "license": "MIT", diff --git a/extensions/dicom-rt/CHANGELOG.md b/extensions/dicom-rt/CHANGELOG.md index 56a3696eb86..8b082fefecb 100644 --- a/extensions/dicom-rt/CHANGELOG.md +++ b/extensions/dicom-rt/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.7.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-rt@0.7.2...@ohif/extension-dicom-rt@0.7.3) (2021-10-26) + +**Note:** Version bump only for package @ohif/extension-dicom-rt + + + + + ## [0.7.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-rt@0.7.1...@ohif/extension-dicom-rt@0.7.2) (2021-10-06) **Note:** Version bump only for package @ohif/extension-dicom-rt diff --git a/extensions/dicom-rt/package.json b/extensions/dicom-rt/package.json index eff9e7360cb..5c61eb14f85 100644 --- a/extensions/dicom-rt/package.json +++ b/extensions/dicom-rt/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/extension-dicom-rt", - "version": "0.7.2", + "version": "0.7.3", "description": "OHIF extension for rendering DICOM RTSTRUCTs on top of cornerstone images.", "author": "OHIF", "license": "MIT", diff --git a/extensions/dicom-segmentation/CHANGELOG.md b/extensions/dicom-segmentation/CHANGELOG.md index 156beeeed75..4475bc5cf80 100644 --- a/extensions/dicom-segmentation/CHANGELOG.md +++ b/extensions/dicom-segmentation/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.7.3](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-segmentation@0.7.2...@ohif/extension-dicom-segmentation@0.7.3) (2021-10-26) + +**Note:** Version bump only for package @ohif/extension-dicom-segmentation + + + + + ## [0.7.2](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-segmentation@0.7.1...@ohif/extension-dicom-segmentation@0.7.2) (2021-10-06) **Note:** Version bump only for package @ohif/extension-dicom-segmentation diff --git a/extensions/dicom-segmentation/package.json b/extensions/dicom-segmentation/package.json index 3bb507d4233..adbab36e8bd 100644 --- a/extensions/dicom-segmentation/package.json +++ b/extensions/dicom-segmentation/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/extension-dicom-segmentation", - "version": "0.7.2", + "version": "0.7.3", "description": "OHIF extension for viewing segmentations in the 2D MPR view", "author": "OHIF", "license": "MIT", diff --git a/extensions/dicom-tag-browser/CHANGELOG.md b/extensions/dicom-tag-browser/CHANGELOG.md index 86146a71693..f9fb6503f9a 100644 --- a/extensions/dicom-tag-browser/CHANGELOG.md +++ b/extensions/dicom-tag-browser/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.13](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-tag-browser@0.2.12...@ohif/extension-dicom-tag-browser@0.2.13) (2021-10-26) + +**Note:** Version bump only for package @ohif/extension-dicom-tag-browser + + + + + ## [0.2.12](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-tag-browser@0.2.11...@ohif/extension-dicom-tag-browser@0.2.12) (2021-09-28) **Note:** Version bump only for package @ohif/extension-dicom-tag-browser diff --git a/extensions/dicom-tag-browser/package.json b/extensions/dicom-tag-browser/package.json index 4563f2a88f5..44b22c6e20e 100644 --- a/extensions/dicom-tag-browser/package.json +++ b/extensions/dicom-tag-browser/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/extension-dicom-tag-browser", - "version": "0.2.12", + "version": "0.2.13", "description": "OHIF extension for checking DICOM headers.", "author": "OHIF", "license": "MIT", diff --git a/extensions/vtk/CHANGELOG.md b/extensions/vtk/CHANGELOG.md index e4176515700..b4f572b5321 100644 --- a/extensions/vtk/CHANGELOG.md +++ b/extensions/vtk/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.12.5](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.12.4...@ohif/extension-vtk@1.12.5) (2021-10-26) + +**Note:** Version bump only for package @ohif/extension-vtk + + + + + ## [1.12.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.12.3...@ohif/extension-vtk@1.12.4) (2021-10-15) **Note:** Version bump only for package @ohif/extension-vtk diff --git a/extensions/vtk/package.json b/extensions/vtk/package.json index aa0d098d645..d6c1b3455d8 100644 --- a/extensions/vtk/package.json +++ b/extensions/vtk/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/extension-vtk", - "version": "1.12.4", + "version": "1.12.5", "description": "OHIF extension for VTK.js", "author": "OHIF", "license": "MIT", @@ -53,8 +53,8 @@ "react-vtkjs-viewport": "^0.14.4" }, "devDependencies": { - "@ohif/core": "^2.16.0", - "@ohif/ui": "^1.10.3", + "@ohif/core": "^2.16.1", + "@ohif/ui": "^1.10.4", "cornerstone-tools": "^6.0.0", "cornerstone-wado-image-loader": "^4.0.3", "dicom-parser": "^1.8.9", diff --git a/platform/core/CHANGELOG.md b/platform/core/CHANGELOG.md index 73a8c2d043d..126653a00d9 100644 --- a/platform/core/CHANGELOG.md +++ b/platform/core/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.16.1](https://github.com/OHIF/Viewers/compare/@ohif/core@2.16.0...@ohif/core@2.16.1) (2021-10-26) + +**Note:** Version bump only for package @ohif/core + + + + + # [2.16.0](https://github.com/OHIF/Viewers/compare/@ohif/core@2.15.1...@ohif/core@2.16.0) (2021-10-04) diff --git a/platform/core/package.json b/platform/core/package.json index 087678cf282..e585d8be104 100644 --- a/platform/core/package.json +++ b/platform/core/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/core", - "version": "2.16.0", + "version": "2.16.1", "description": "Generic business logic for web-based medical imaging applications", "author": "OHIF Core Team", "license": "MIT", diff --git a/platform/ui/CHANGELOG.md b/platform/ui/CHANGELOG.md index bda33634b0a..9b25d58b8d8 100644 --- a/platform/ui/CHANGELOG.md +++ b/platform/ui/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.10.4](https://github.com/OHIF/Viewers/compare/@ohif/ui@1.10.3...@ohif/ui@1.10.4) (2021-10-26) + +**Note:** Version bump only for package @ohif/ui + + + + + ## [1.10.3](https://github.com/OHIF/Viewers/compare/@ohif/ui@1.10.2...@ohif/ui@1.10.3) (2021-10-15) **Note:** Version bump only for package @ohif/ui diff --git a/platform/ui/package.json b/platform/ui/package.json index ebd9ff3008c..a9852d6746e 100644 --- a/platform/ui/package.json +++ b/platform/ui/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/ui", - "version": "1.10.3", + "version": "1.10.4", "description": "A set of React components for Medical Imaging Viewers", "author": "OHIF Contributors", "license": "MIT", diff --git a/platform/viewer/CHANGELOG.md b/platform/viewer/CHANGELOG.md index 50258bb3972..0a722dee197 100644 --- a/platform/viewer/CHANGELOG.md +++ b/platform/viewer/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.12.4](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.12.3...@ohif/viewer@4.12.4) (2021-10-26) + +**Note:** Version bump only for package @ohif/viewer + + + + + ## [4.12.3](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.12.2...@ohif/viewer@4.12.3) (2021-10-25) **Note:** Version bump only for package @ohif/viewer diff --git a/platform/viewer/package.json b/platform/viewer/package.json index 7271b526234..89e5e73fdce 100644 --- a/platform/viewer/package.json +++ b/platform/viewer/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/viewer", - "version": "4.12.3", + "version": "4.12.4", "description": "OHIF Viewer", "author": "OHIF Contributors", "license": "MIT", @@ -47,18 +47,18 @@ }, "dependencies": { "@babel/runtime": "^7.5.5", - "@ohif/core": "^2.16.0", - "@ohif/extension-cornerstone": "^2.12.1", + "@ohif/core": "^2.16.1", + "@ohif/extension-cornerstone": "^2.12.2", "@ohif/extension-debugging": "^0.3.0", - "@ohif/extension-dicom-html": "^1.3.12", + "@ohif/extension-dicom-html": "^1.3.13", "@ohif/extension-dicom-microscopy": "^0.52.0", "@ohif/extension-dicom-pdf": "^1.1.0", - "@ohif/extension-dicom-rt": "^0.7.2", - "@ohif/extension-dicom-segmentation": "^0.7.2", + "@ohif/extension-dicom-rt": "^0.7.3", + "@ohif/extension-dicom-segmentation": "^0.7.3", "@ohif/extension-lesion-tracker": "^0.2.1", - "@ohif/extension-vtk": "^1.12.4", + "@ohif/extension-vtk": "^1.12.5", "@ohif/i18n": "^0.53.0", - "@ohif/ui": "^1.10.3", + "@ohif/ui": "^1.10.4", "@tanem/react-nprogress": "^1.1.25", "classnames": "^2.2.6", "core-js": "^3.2.1", From a07d81468c78f7bc04cce1e157717423803ba1e2 Mon Sep 17 00:00:00 2001 From: Bill Wallace Date: Tue, 26 Oct 2021 08:40:02 -0400 Subject: [PATCH 09/18] merge(OHIF):Merge OHIF master 2021-10-26 into fu-berlin --- package.json | 3 +- .../src/contextProviders/SnackbarProvider.js | 3 ++ yarn.lock | 34 ++++++++++++++++++- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 83c7c530059..3718e4899c3 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,8 @@ "dependencies": { "@babel/runtime": "^7.5.5", "core-js": "^3.2.1", - "dcmjs": "0.18.9", + "cornerstone-tools": "^6.0.5", + "dcmjs": "^0.18.11", "ol": "6.7.0" }, "devDependencies": { diff --git a/platform/ui/src/contextProviders/SnackbarProvider.js b/platform/ui/src/contextProviders/SnackbarProvider.js index d036e525338..840833af9e3 100644 --- a/platform/ui/src/contextProviders/SnackbarProvider.js +++ b/platform/ui/src/contextProviders/SnackbarProvider.js @@ -6,10 +6,13 @@ import React, { useEffect, } from 'react'; import PropTypes from 'prop-types'; +import { classes } from '@ohif/core'; import SnackbarContainer from '../components/snackbar/SnackbarContainer'; import SnackbarTypes from '../components/snackbar/SnackbarTypes'; +const { LogManager } = classes; + const SnackbarContext = createContext(null); export const useSnackbarContext = () => useContext(SnackbarContext); diff --git a/yarn.lock b/yarn.lock index b1e1ea925a6..6f968b715b8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6107,6 +6107,14 @@ cornerstone-tools@^6.0.0: "@babel/runtime" "7.1.2" cornerstone-math "0.1.9" +cornerstone-tools@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cornerstone-tools/-/cornerstone-tools-6.0.5.tgz#a96914f180ff6ec838152e3da30499433ee938bb" + integrity sha512-wa7tyjS8CcXXp+f5TYVXORZJT7ubgwmCoOSH0eWBqsSDGCLjrWFxfUN+j7+S1LH2+aANltTulZz5444JZRhfVg== + dependencies: + "@babel/runtime" "7.1.2" + cornerstone-math "0.1.9" + cornerstone-wado-image-loader@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/cornerstone-wado-image-loader/-/cornerstone-wado-image-loader-4.0.3.tgz#4848a238af9b10742af6d08e204527acf5260c25" @@ -6707,7 +6715,31 @@ dateformat@^3.0.0: resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== -dcmjs@0.18.9, dcmjs@^0.18.2: +dcmjs@0.18.10: + version "0.18.10" + resolved "https://registry.yarnpkg.com/dcmjs/-/dcmjs-0.18.10.tgz#9e293a20dc359c7eba6c81b6afaf5a52fa841288" + integrity sha512-GLW1KJmzs+1ye8WA29wDy+cOHa4dYv2Q5XPQuX33X4bK5AqzS+56IzuCH+WkQXnvALZZDBFgbPztOVdUwnN4uw== + dependencies: + "@babel/polyfill" "^7.8.3" + "@babel/runtime" "^7.8.4" + gl-matrix "^3.1.0" + lodash.clonedeep "^4.5.0" + loglevelnext "^3.0.1" + ndarray "^1.0.19" + +dcmjs@^0.18.11: + version "0.18.11" + resolved "https://registry.yarnpkg.com/dcmjs/-/dcmjs-0.18.11.tgz#724cab26148503017d97bbcbb8fe9685dfae69dc" + integrity sha512-7C+tKWIzeo2ZzL1Fss+3HuztWyhZYWhQGXV5hrK7yi4s8ctIN0lCeTUNYPdRS1DyE2GEAI7gb9fDcQU9Wh1rgg== + dependencies: + "@babel/polyfill" "^7.8.3" + "@babel/runtime" "^7.8.4" + gl-matrix "^3.1.0" + lodash.clonedeep "^4.5.0" + loglevelnext "^3.0.1" + ndarray "^1.0.19" + +dcmjs@^0.18.2: version "0.18.9" resolved "https://registry.yarnpkg.com/dcmjs/-/dcmjs-0.18.9.tgz#0e18fcff975aaae8ca01a96e781fa75c29ec97f3" integrity sha512-aTu4fUo3TSgohJC+U509qdXL1per09XvlYdQva0BGtIZMr/iR5n8h/ojpcDTRJoVtSuaj331KJj1yCj8FMMK4Q== From ea6b04b4def5e9c158ed54b1a1b880b815272b0a Mon Sep 17 00:00:00 2001 From: Bill Wallace Date: Mon, 25 Oct 2021 11:15:08 -0400 Subject: [PATCH 10/18] feat(OHIF): Add a configurable labelling tree --- extensions/cornerstone/src/commandsModule.js | 13 +- .../src/classes/metadata/StudyMetadata.js | 22 +++ .../measurements/classes/MeasurementApi.js | 1 + .../core/src/utils/studyMetadataManager.js | 9 ++ .../src/components/selectTree/InputRadio.js | 1 + .../src/components/selectTree/SelectTree.js | 23 ++- .../src/components/selectTree/SelectTree.styl | 4 + .../components/simpleDialog/SimpleDialog.styl | 2 +- .../appExtensions/MeasurementsPanel/index.js | 35 +--- .../appExtensions/MeasurementsPanel/init.js | 58 ++----- .../MeasurementsPanel/showLabellingDialog.js | 66 ++++++++ .../EditDescriptionDialog.js | 1 + .../src/components/Labelling/LabellingFlow.js | 149 +++++++++++++++--- .../components/Labelling/OHIFLabellingData.js | 76 ++++----- .../connectedComponents/ToolContextMenu.js | 37 +++-- 15 files changed, 332 insertions(+), 165 deletions(-) create mode 100644 platform/viewer/src/appExtensions/MeasurementsPanel/showLabellingDialog.js diff --git a/extensions/cornerstone/src/commandsModule.js b/extensions/cornerstone/src/commandsModule.js index f9c097a02bf..a8d7d7fd9ad 100644 --- a/extensions/cornerstone/src/commandsModule.js +++ b/extensions/cornerstone/src/commandsModule.js @@ -180,6 +180,8 @@ const commandsModule = ({ servicesManager }) => { measurementNumber, location, description, + finding, + findingSites, }) { // Update all measurements by measurement number const measurementApi = OHIF.measurements.MeasurementApi.Instance; @@ -190,6 +192,8 @@ const commandsModule = ({ servicesManager }) => { measurements.forEach(measurement => { measurement.location = location; measurement.description = description; + measurement.finding = finding; + measurement.findingSites = findingSites; measurementApi.updateMeasurement(measurement.toolType, measurement); }); @@ -276,14 +280,7 @@ const commandsModule = ({ servicesManager }) => { activeViewportIndex, refreshViewports = true, }) => { - const study = studyMetadataManager.get(StudyInstanceUID); - - const displaySet = study.findDisplaySet(ds => { - return ( - ds.images && - ds.images.find(i => i.getSOPInstanceUID() === SOPInstanceUID) - ); - }); + const { displaySet } = studyMetadataManager.getInstance(StudyInstanceUID, SOPInstanceUID, frameIndex); if (!displaySet) { return; diff --git a/platform/core/src/classes/metadata/StudyMetadata.js b/platform/core/src/classes/metadata/StudyMetadata.js index ee1e8f23654..5870110138c 100644 --- a/platform/core/src/classes/metadata/StudyMetadata.js +++ b/platform/core/src/classes/metadata/StudyMetadata.js @@ -657,6 +657,28 @@ class StudyMetadata extends Metadata { }, 0); } + /** Finds a given instance object + * @returns the display set, and the instance metadata + */ + getInstance(sopInstanceUID, frameIndex) { + if (!sopInstanceUID) return; + let image; + const displaySet = this.findDisplaySet(ds => { + return ( + ds.images && + ds.images.find(i => { + if (i.getSOPInstanceUID() === sopInstanceUID) { + image = i; + // TODO - check frameIndex + return true; + } + }) + ) + }); + if (!image) return; + return { study: this, displaySet, image, metadata: image.getData().metadata }; + } + /** * Invokes the supplied callback for each series in the current study passing * two arguments: series (a SeriesMetadata instance) and index (the integer diff --git a/platform/core/src/measurements/classes/MeasurementApi.js b/platform/core/src/measurements/classes/MeasurementApi.js index 51dfe72d0bf..53e4c8a705c 100644 --- a/platform/core/src/measurements/classes/MeasurementApi.js +++ b/platform/core/src/measurements/classes/MeasurementApi.js @@ -859,6 +859,7 @@ export default class MeasurementApi { const toolIndex = collection.findIndex( tool => tool._id === measurementData._id ); + if (toolIndex < 0) { return; } diff --git a/platform/core/src/utils/studyMetadataManager.js b/platform/core/src/utils/studyMetadataManager.js index 79da423263e..fadc61cb970 100644 --- a/platform/core/src/utils/studyMetadataManager.js +++ b/platform/core/src/utils/studyMetadataManager.js @@ -10,6 +10,14 @@ function get(studyInstanceUID) { return studyMetadataList.findBy({ studyInstanceUID }); } +/** Given a study instance UID and a sop UID, finds the metadata */ +function getInstance(studyInstanceUID, sopInstanceUID) { + if (!studyInstanceUID || !sopInstanceUID) return; + const studyMetadata = get(studyInstanceUID); + if (!studyMetadata) return; + return studyMetadata.getInstance(sopInstanceUID); +} + function all(options) { return studyMetadataList.all(options); } @@ -25,6 +33,7 @@ function purge() { export default { add, get, + getInstance, all, remove, purge, diff --git a/platform/ui/src/components/selectTree/InputRadio.js b/platform/ui/src/components/selectTree/InputRadio.js index e4de02a06d9..37cb8a15877 100644 --- a/platform/ui/src/components/selectTree/InputRadio.js +++ b/platform/ui/src/components/selectTree/InputRadio.js @@ -19,6 +19,7 @@ export default class InputRadio extends Component { className={'wrapperLabel radioLabel ' + labelClass} htmlFor={this.props.id} > + {this.props.children} item && !Array.isArray(item.items); + isLeafSelected = item => { + const ret = item && !Array.isArray(item.items); + return ret; + }; getLabelClass = item => { let labelClass = 'treeLeaf'; @@ -129,7 +132,13 @@ export class SelectTree extends Component { label={item.label} labelClass={this.getLabelClass(item)} onSelected={this.onSelected} - /> + > + {!this.isLeafSelected(item) && ( this.onSelected(evt, item, true)} + />)} + ); }); } @@ -169,19 +178,19 @@ export class SelectTree extends Component { }); }; - onSelected = (event, item) => { - if (this.isLeafSelected(item)) { + onSelected = (event, item, expand) => { + if (this.isLeafSelected(item) || !expand) { this.setState({ searchTerm: null, currentNode: null, value: null, }); + return this.props.onSelected(event, item); } else { this.setState({ currentNode: item, }); } - return this.props.onSelected(event, item); }; onBreadcrumbSelected = () => { diff --git a/platform/ui/src/components/selectTree/SelectTree.styl b/platform/ui/src/components/selectTree/SelectTree.styl index adb1ddba56a..49c428204c1 100644 --- a/platform/ui/src/components/selectTree/SelectTree.styl +++ b/platform/ui/src/components/selectTree/SelectTree.styl @@ -1,5 +1,8 @@ @import './../../design/styles/common/global.styl' +.expandIcon + margin-right: 5px + .selectTreeRoot text-align: initial; width: 320px; @@ -13,6 +16,7 @@ border: 1px solid #c4c4c4; border-radius: 5px; background-color: #ffffff; + color: black; display: flex; flex-direction: column; diff --git a/platform/ui/src/components/simpleDialog/SimpleDialog.styl b/platform/ui/src/components/simpleDialog/SimpleDialog.styl index 5df1de18a9e..21c19ec8d6b 100644 --- a/platform/ui/src/components/simpleDialog/SimpleDialog.styl +++ b/platform/ui/src/components/simpleDialog/SimpleDialog.styl @@ -103,8 +103,8 @@ color: var(--text-primary-color); .footer - padding: 15px; text-align: right; + margin: 0; .btn margin-left: 5px; diff --git a/platform/viewer/src/appExtensions/MeasurementsPanel/index.js b/platform/viewer/src/appExtensions/MeasurementsPanel/index.js index 93de3d7e956..02208e842a4 100644 --- a/platform/viewer/src/appExtensions/MeasurementsPanel/index.js +++ b/platform/viewer/src/appExtensions/MeasurementsPanel/index.js @@ -1,8 +1,7 @@ import React from 'react'; import ConnectedMeasurementTable from './ConnectedMeasurementTable.js'; import init from './init.js'; - -import LabellingFlow from '../../components/Labelling/LabellingFlow'; +import showLabellingDialogUnbound from './showLabellingDialog.js'; export default { /** @@ -20,37 +19,7 @@ export default { getPanelModule({ servicesManager, commandsManager }) { const { UINotificationService, UIDialogService } = servicesManager.services; - const showLabellingDialog = (props, measurementData) => { - if (!UIDialogService) { - console.warn('Unable to show dialog; no UI Dialog Service available.'); - return; - } - - UIDialogService.dismiss({ id: 'labelling' }); - UIDialogService.create({ - id: 'labelling', - centralize: true, - isDraggable: false, - showOverlay: true, - content: LabellingFlow, - contentProps: { - measurementData, - labellingDoneCallback: () => - UIDialogService.dismiss({ id: 'labelling' }), - updateLabelling: ({ location, description, response }) => { - measurementData.location = location || measurementData.location; - measurementData.description = description || ''; - measurementData.response = response || measurementData.response; - - commandsManager.runCommand( - 'updateTableWithNewMeasurementData', - measurementData - ); - }, - ...props, - }, - }); - }; + const showLabellingDialog = showLabellingDialogUnbound.bind(null, commandsManager, UIDialogService, {}); const ExtendedConnectedMeasurementTable = () => ( { return MEASUREMENT_ACTION_MAP[action](event); }; const onMeasurementAdded = onMeasurementsChanged.bind(this, 'added'); const onMeasurementRemoved = onMeasurementsChanged.bind(this, 'removed'); const onMeasurementModified = onMeasurementsChanged.bind(this, 'modified'); + const onMeasurementCompleted = onMeasurementsChanged.bind(this, 'completed'); const onLabelmapModified = onMeasurementsChanged.bind( this, 'labelmapModified' @@ -54,50 +55,11 @@ export default function init({ y: (event && event.currentPoints.client.y) || 0, }); - const _updateLabellingHandler = (labellingData, measurementData) => { - const { location, description, response } = labellingData; - - if (location) { - measurementData.location = location; - } - - measurementData.description = description || ''; - - if (response) { - measurementData.response = response; - } - - commandsManager.runCommand( - 'updateTableWithNewMeasurementData', - measurementData - ); - }; - - const showLabellingDialog = (props, contentProps, measurementData) => { - if (!UIDialogService) { - console.warn('Unable to show dialog; no UI Dialog Service available.'); - return; - } - - UIDialogService.create({ - id: 'labelling', - isDraggable: false, - showOverlay: true, - centralize: true, - content: LabellingFlow, - contentProps: { - measurementData, - labellingDoneCallback: () => - UIDialogService.dismiss({ id: 'labelling' }), - updateLabelling: labellingData => - _updateLabellingHandler(labellingData, measurementData), - ...contentProps, - }, - ...props, - }); - }; + const showLabellingDialog = showLabellingDialogUnbound.bind(null, commandsManager, UIDialogService); const onRightClick = event => { + console.log("onRightClick"); + if (!UIDialogService) { console.warn('Unable to show dialog; no UI Dialog Service available.'); return; @@ -121,16 +83,16 @@ export default function init({ }); }, onClose: () => UIDialogService.dismiss({ id: 'context-menu' }), - onSetLabel: (eventData, measurementData) => { + onSetLabel: (eventData, measurementData, studyInfo) => { showLabellingDialog( - { centralize: true, isDraggable: false }, + { centralize: true, isDraggable: false, studyInfo, eventData }, { skipAddLabelButton: true, editLocation: true }, measurementData ); }, - onSetDescription: (eventData, measurementData) => { + onSetDescription: (eventData, measurementData, studyInfo) => { showLabellingDialog( - { defaultPosition: _getDefaultPosition(eventData) }, + { defaultPosition: _getDefaultPosition(eventData), studyInfo, eventData }, { editDescriptionOnDialog: true }, measurementData ); @@ -204,7 +166,7 @@ export default function init({ ); element.addEventListener( csTools.EVENTS.MEASUREMENT_COMPLETED, - onMeasurementModified + onMeasurementCompleted ); element.addEventListener( csTools.EVENTS.LABELMAP_MODIFIED, diff --git a/platform/viewer/src/appExtensions/MeasurementsPanel/showLabellingDialog.js b/platform/viewer/src/appExtensions/MeasurementsPanel/showLabellingDialog.js new file mode 100644 index 00000000000..494204b79ab --- /dev/null +++ b/platform/viewer/src/appExtensions/MeasurementsPanel/showLabellingDialog.js @@ -0,0 +1,66 @@ +import LabellingFlow from '../../components/Labelling/LabellingFlow'; + +const asArray = val => Array.isArray(val) && val || val && [val]; + +const _updateLabellingHandler = (commandsManager, labellingData, measurementData) => { + const { location, locationLabel, description, response, } = labellingData; + measurementData.findingSites = asArray(labellingData.findingSite) || + location && [{ + CodeValue: location, + CodingSchemeDesignator: 'OHIF', + CodeMeaning: !description && locationLabel || location, + }] || + measurementData.findingSites; + + measurementData.finding = labellingData.finding || + description && { + CodeValue: description, + CodingSchemeDesignator: 'OHIF', + CodeMeaning: description, + } || + measurementData.finding; + + measurementData.location = location || + measurementData.findingSites && measurementData.findingSites[0].CodeValue || + measurementData.location; + + measurementData.description = description || + measurementData.finding && measurementData.finding.CodeValue || + measurementData.description; + + if (response) { + measurementData.response = response; + } + + commandsManager.runCommand( + 'updateTableWithNewMeasurementData', + measurementData + ); +}; + +const showLabellingDialog = (commandsManager, UIDialogService, props, contentProps, measurementData) => { + if (!UIDialogService) { + console.warn('Unable to show dialog; no UI Dialog Service available.'); + return; + } + + UIDialogService.create({ + id: 'labelling', + isDraggable: false, + showOverlay: true, + centralize: true, + content: LabellingFlow, + contentProps: { + measurementData, + ...props.studyInfo, + labellingDoneCallback: () => + UIDialogService.dismiss({ id: 'labelling' }), + updateLabelling: labellingData => + _updateLabellingHandler(commandsManager, labellingData, measurementData), + ...contentProps, + }, + ...props, + }); +}; + +export default showLabellingDialog; diff --git a/platform/viewer/src/components/EditDescriptionDialog/EditDescriptionDialog.js b/platform/viewer/src/components/EditDescriptionDialog/EditDescriptionDialog.js index 9bea7235913..702ec1ff786 100644 --- a/platform/viewer/src/components/EditDescriptionDialog/EditDescriptionDialog.js +++ b/platform/viewer/src/components/EditDescriptionDialog/EditDescriptionDialog.js @@ -45,6 +45,7 @@ export default class EditDescriptionDialog extends Component { autoFocus onChange={this.handleChange} /> + {this.props.children} ); } diff --git a/platform/viewer/src/components/Labelling/LabellingFlow.js b/platform/viewer/src/components/Labelling/LabellingFlow.js index c2749431e44..a309134d975 100644 --- a/platform/viewer/src/components/Labelling/LabellingFlow.js +++ b/platform/viewer/src/components/Labelling/LabellingFlow.js @@ -4,19 +4,96 @@ import PropTypes from 'prop-types'; import cloneDeep from 'lodash.clonedeep'; import LabellingTransition from './LabellingTransition.js'; -import OHIFLabellingData from './OHIFLabellingData.js'; +import { ConfigPoint, safeFunction } from 'config-point'; +import './OHIFLabellingData'; import EditDescriptionDialog from './../EditDescriptionDialog/EditDescriptionDialog.js'; import './LabellingFlow.css'; -const LabellingFlow = ({ - measurementData, - editLocation, - editDescription, - skipAddLabelButton, - updateLabelling, - labellingDoneCallback, - editDescriptionOnDialog, -}) => { +const toItems = (items, parent = {}) => { + if (!items) return; + if (!Array.isArray(items)) { + throw Error(`Items ${items} isn't an array`); + } + return items.filter(item => item).map(item => { + const { findingSite, value = '' } = parent; + const prefix = value && `${value} >` || ''; + if (typeof item === 'string') { + return { label: item, value: `${prefix}${item}` }; + } + const ret = { ...item }; + if (!item.value) { + if (findingSite && !item.findingSite) { + ret.findingSite = findingSite; + } + ret.value = + ret.findingSite && ret.findingSite.CodeMeaning || + item.label && `${prefix}${item.label}` || + value; + } + if (!item.label) ret.label = item.description || item.value; + + if (item.select) { + ret.selectFunc = safeFunction(item.select); + } + if (item.items) { + ret.items = toItems(item.items, ret); + } + return ret; + }); +}; + +/** + * Allow configuring GUISettings.measurements.labellingData to point to a + * custom ConfigPoint theme value of the given name. The default here + * points to 'BodyPartLabellingData' defined in OHIFLabellingData.js + */ +const { GUISettings } = ConfigPoint.register({ + GUISettings: { + measurements: { + labellingData: 'BodyPartLabellingData', + }, + }, +}); + +/** Finds the node containing the specified value, as a "tree" node, that is, + * not the child elements, but the parent value containing it if it isn't a child element itself. + */ +const findNode = (node, location, props) => { + if (!node) return; + const { items } = node; + if (!items) return; + for (const item of items) { + if (item.selectFunc) { + try { + if (item.selectFunc(props)) { + + return item.items && item || node; + } + } catch (e) { + console.log('Calling selectFunc', item.select, 'on', props, 'failed'); + } + } else if (item.value === location) { + return item.items && item || node; + } + const subItem = findNode(item, location, props); + if (subItem) { + return subItem; + } + } +}; + +const LabellingFlow = (props) => { + const { + measurementData, + editLocation, + editDescription, + skipAddLabelButton, + updateLabelling, + labellingDoneCallback, + editDescriptionOnDialog, + configPoint = GUISettings, + } = props; + const initialLocation = measurementData.location; const [fadeOutTimer, setFadeOutTimer] = useState(); const [showComponent, setShowComponent] = useState(true); const descriptionInput = useRef(); @@ -26,6 +103,9 @@ const LabellingFlow = ({ editDescription, skipAddLabelButton, }); + const labellingItems = ConfigPoint.getConfig(configPoint.measurements.labellingData).items; + const descriptionPoint = ConfigPoint.getConfig(configPoint.measurements.descriptionData); + const descriptionItems = descriptionPoint && descriptionPoint.items || undefined; useEffect(() => { const newMeasurementData = cloneDeep(measurementData); @@ -87,10 +167,20 @@ const LabellingFlow = ({ })); }; - const selectTreeSelectCallback = (event, itemSelected) => { - const location = itemSelected.value; - const locationLabel = itemSelected.label; - updateLabelling({ location }); + + const selectDescriptionTreeSelectCallback = (event, itemSelected) => { + const description = itemSelected.value; + const descriptionLabel = itemSelected.label; + descriptionDialogUpdate(description); + }; + + const selectTreeSelectCallback = (event, item) => { + const location = item.value; + const locationLabel = item.label; + const description = item.description; + const { findingSite, finding } = item; + + updateLabelling({ location, description, finding, findingSite }); setState(state => ({ ...state, @@ -99,6 +189,9 @@ const LabellingFlow = ({ ...state.measurementData, location, locationLabel, + description, + finding, + findingSite, }, })); }; @@ -115,8 +208,10 @@ const LabellingFlow = ({ * Waits for 1 sec to dismiss the labelling component. * */ - const fadeOutAndLeave = () => + const fadeOutAndLeave = () => { + console.log('Fade out and') setFadeOutTimer(setTimeout(fadeOutAndLeaveFast, 1000)); + }; const fadeOutAndLeaveFast = () => setShowComponent(false); @@ -134,7 +229,7 @@ const LabellingFlow = ({ const labellingStateFragment = () => { const { skipAddLabelButton, editLocation, measurementData } = state; - const { description, locationLabel, location } = measurementData; + const { description, location } = measurementData; if (!skipAddLabelButton) { return ( @@ -148,10 +243,14 @@ const LabellingFlow = ({ ); } else { if (editLocation) { + const computedItems = toItems(labellingItems); + const currentNode = findNode({ label: 'Root', value: '', items: computedItems }, initialLocation, props); + return ( @@ -163,7 +262,7 @@ const LabellingFlow = ({
-
{locationLabel}
+
{location}
+ > + {computedItems && ()} + ); } @@ -249,6 +358,7 @@ LabellingFlow.propTypes = { initialTopDistance: PropTypes.number, skipAddLabelButton: PropTypes.bool, editLocation: PropTypes.bool, + editGroup: PropTypes.bool, editDescription: PropTypes.bool, editDescriptionOnDialog: PropTypes.bool, }; @@ -258,6 +368,7 @@ LabellingFlow.defaultProps = { editLocation: false, editDescription: false, editDescriptionOnDialog: false, + editGroup: false, }; export default LabellingFlow; diff --git a/platform/viewer/src/components/Labelling/OHIFLabellingData.js b/platform/viewer/src/components/Labelling/OHIFLabellingData.js index f4ef49de9cc..34482d7867b 100644 --- a/platform/viewer/src/components/Labelling/OHIFLabellingData.js +++ b/platform/viewer/src/components/Labelling/OHIFLabellingData.js @@ -1,39 +1,41 @@ -const items = [ - 'Abdomen/Chest Wall', - 'Adrenal', - 'Bladder', - 'Bone', - 'Brain', - 'Breast', - 'Colon', - 'Esophagus', - 'Extremities', - 'Gallbladder', - 'Kidney', - 'Liver', - 'Lung', - 'Lymph Node', - 'Mediastinum/Hilum', - 'Muscle', - 'Neck', - 'Other Soft Tissue', - 'Ovary', - 'Pancreas', - 'Pelvis', - 'Peritoneum/Omentum', - 'Prostate', - 'Retroperitoneum', - 'Small Bowel', - 'Spleen', - 'Stomach', - 'Subcutaneous', -]; +import { ConfigPoint, SortOp } from 'config-point'; -const OHIFLabellingData = items.map(item => { - return { - label: item, - value: item, - }; -}); +export const { BodyPartLabellingData } = ConfigPoint.register( + // The original OHIF Labelling Data set + { + configName: 'BodyPartLabellingData', + configBase: { + items: [ + 'Abdomen/Chest Wall', + 'Adrenal', + 'Bladder', + 'Bone', + 'Brain', + 'Breast', + 'Colon', + 'Esophagus', + 'Extremities', + 'Gallbladder', + 'Kidney', + 'Liver', + 'Lung', + 'Lymph Node', + 'Mediastinum/Hilum', + 'Muscle', + 'Neck', + 'Other Soft Tissue', + 'Ovary', + 'Pancreas', + 'Pelvis', + 'Peritoneum/Omentum', + 'Prostate', + 'Retroperitoneum', + 'Small Bowel', + 'Spleen', + 'Stomach', + 'Subcutaneous', + ], + }, + }, -export default OHIFLabellingData; +); diff --git a/platform/viewer/src/connectedComponents/ToolContextMenu.js b/platform/viewer/src/connectedComponents/ToolContextMenu.js index b45bf3b5056..e217a495c1a 100644 --- a/platform/viewer/src/connectedComponents/ToolContextMenu.js +++ b/platform/viewer/src/connectedComponents/ToolContextMenu.js @@ -2,6 +2,9 @@ import { ContextMenu } from '@ohif/ui'; import PropTypes from 'prop-types'; import React from 'react'; import { commandsManager } from './../App.js'; +import OHIF from '@ohif/core'; + +const { studyMetadataManager } = OHIF.utils; const toolTypes = [ 'Angle', @@ -11,16 +14,19 @@ const toolTypes = [ 'EllipticalRoi', 'CircleRoi', 'RectangleRoi', + 'CobbAngle', ]; -const ToolContextMenu = ({ - onSetLabel, - onSetDescription, - isTouchEvent, - eventData, - onClose, - onDelete, -}) => { +const ToolContextMenu = (props) => { + const { + onSetLabel, + onSetDescription, + isTouchEvent, + eventData, + onClose, + onDelete, + contextMenuItems, + } = props; const defaultDropdownItems = [ { label: 'Delete measurement', @@ -31,9 +37,9 @@ const ToolContextMenu = ({ { label: 'Relabel', actionType: 'setLabel', - action: ({ nearbyToolData, eventData }) => { + action: ({ nearbyToolData, eventData, studyInfo }) => { const { tool: measurementData } = nearbyToolData; - onSetLabel(eventData, measurementData); + onSetLabel(eventData, measurementData, studyInfo); }, }, { @@ -66,8 +72,11 @@ const ToolContextMenu = ({ let dropdownItems = []; if (nearbyToolData) { + const { tool } = nearbyToolData; + const studyInfo = tool && + studyMetadataManager.getInstance(tool.StudyInstanceUID, tool.SOPInstanceUID, tool.frameIndex); defaultDropdownItems.forEach(item => { - item.params = { eventData, nearbyToolData }; + item.params = { eventData, nearbyToolData, studyInfo }; if (item.actionType === 'setDescription') { item.label = `${ @@ -75,6 +84,10 @@ const ToolContextMenu = ({ } Description`; } + dropdownItems.push(item); + }); + } else if (contextMenuItems) { + contextMenuItems.forEach(item => { dropdownItems.push(item); }); } @@ -83,7 +96,7 @@ const ToolContextMenu = ({ }; const onClickHandler = ({ action, params }) => { - action(params); + if (action) action(params); if (onClose) { onClose(); } From 2dce41b8bd44f2221d94517b432947202b29165e Mon Sep 17 00:00:00 2001 From: Bill Wallace Date: Mon, 25 Oct 2021 15:27:06 -0400 Subject: [PATCH 11/18] fix(OHIF):Log level changes and version imports for PR --- platform/viewer/src/appExtensions/MeasurementsPanel/init.js | 2 -- platform/viewer/src/components/Labelling/LabellingFlow.js | 1 - 2 files changed, 3 deletions(-) diff --git a/platform/viewer/src/appExtensions/MeasurementsPanel/init.js b/platform/viewer/src/appExtensions/MeasurementsPanel/init.js index 48faf2f861f..3d1ebf6d7d1 100644 --- a/platform/viewer/src/appExtensions/MeasurementsPanel/init.js +++ b/platform/viewer/src/appExtensions/MeasurementsPanel/init.js @@ -58,8 +58,6 @@ export default function init({ const showLabellingDialog = showLabellingDialogUnbound.bind(null, commandsManager, UIDialogService); const onRightClick = event => { - console.log("onRightClick"); - if (!UIDialogService) { console.warn('Unable to show dialog; no UI Dialog Service available.'); return; diff --git a/platform/viewer/src/components/Labelling/LabellingFlow.js b/platform/viewer/src/components/Labelling/LabellingFlow.js index a309134d975..4288a257e2b 100644 --- a/platform/viewer/src/components/Labelling/LabellingFlow.js +++ b/platform/viewer/src/components/Labelling/LabellingFlow.js @@ -209,7 +209,6 @@ const LabellingFlow = (props) => { * */ const fadeOutAndLeave = () => { - console.log('Fade out and') setFadeOutTimer(setTimeout(fadeOutAndLeaveFast, 1000)); }; From 3ebbc49c9eb818a6755ad73e8a15b2c57887bf4e Mon Sep 17 00:00:00 2001 From: Bill Wallace Date: Tue, 26 Oct 2021 07:58:15 -0400 Subject: [PATCH 12/18] fix(OHIFv2): Updated the cornerstone-tools version --- extensions/calibration-tool/package.json | 2 +- extensions/cobb-angle-tool/package.json | 2 +- extensions/cornerstone/package.json | 2 +- extensions/dicom-rt/package.json | 4 ++-- extensions/dicom-segmentation/package.json | 4 ++-- package.json | 4 ++-- platform/core/package.json | 2 +- platform/core/src/utils/dicomLoaderService.js | 4 ++++ platform/viewer/package.json | 4 ++-- yarn.lock | 23 +++++++++++-------- 10 files changed, 30 insertions(+), 21 deletions(-) diff --git a/extensions/calibration-tool/package.json b/extensions/calibration-tool/package.json index b9bdd0123ef..e423bd70d35 100644 --- a/extensions/calibration-tool/package.json +++ b/extensions/calibration-tool/package.json @@ -31,7 +31,7 @@ "peerDependencies": { "@ohif/core": "^0.50.0", "cornerstone-core": "^2.2.8", - "cornerstone-tools": "4.12.5", + "cornerstone-tools": "6.0.5", "dcmjs": "0.18.3", "prop-types": "^15.6.2", "react": "^16.8.6", diff --git a/extensions/cobb-angle-tool/package.json b/extensions/cobb-angle-tool/package.json index 310f967e3b1..0f90b8a48b2 100644 --- a/extensions/cobb-angle-tool/package.json +++ b/extensions/cobb-angle-tool/package.json @@ -31,7 +31,7 @@ "peerDependencies": { "@ohif/core": "^0.50.0", "cornerstone-core": "^2.2.8", - "cornerstone-tools": "4.12.5", + "cornerstone-tools": "6.0.5", "prop-types": "^15.6.2" }, "dependencies": { diff --git a/extensions/cornerstone/package.json b/extensions/cornerstone/package.json index 4b4406479cc..7ba29b57e6d 100644 --- a/extensions/cornerstone/package.json +++ b/extensions/cornerstone/package.json @@ -34,7 +34,7 @@ "@ohif/ui": "^0.50.0", "cornerstone-core": "^2.5.0", "cornerstone-math": "^0.1.9", - "cornerstone-tools": "^6.0.0", + "cornerstone-tools": "^6.0.5", "cornerstone-wado-image-loader": "^4.0.3", "dcmjs": "0.18.10", "dicom-parser": "^1.8.9", diff --git a/extensions/dicom-rt/package.json b/extensions/dicom-rt/package.json index 5c61eb14f85..aa9985e3d0e 100644 --- a/extensions/dicom-rt/package.json +++ b/extensions/dicom-rt/package.json @@ -30,8 +30,8 @@ "peerDependencies": { "@ohif/core": "^0.50.0", "cornerstone-core": "^2.5.0", - "cornerstone-tools": "^6.0.0", - "dcmjs": "0.18.10", + "cornerstone-tools": "^6.0.5", + "dcmjs": "0.19.0", "gl-matrix": "^3.3.0", "prop-types": "^15.6.2", "react": "^16.8.6", diff --git a/extensions/dicom-segmentation/package.json b/extensions/dicom-segmentation/package.json index adbab36e8bd..628a29f8c5f 100644 --- a/extensions/dicom-segmentation/package.json +++ b/extensions/dicom-segmentation/package.json @@ -30,8 +30,8 @@ "peerDependencies": { "@ohif/core": "^0.50.0", "cornerstone-core": "^2.5.0", - "cornerstone-tools": "^6.0.0", - "dcmjs": "0.18.10", + "cornerstone-tools": "^6.0.5", + "dcmjs": "0.19.0", "prop-types": "^15.6.2", "react": "^16.8.6", "react-dom": "^16.8.6" diff --git a/package.json b/package.json index 3718e4899c3..94abbc452b3 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,8 @@ "dependencies": { "@babel/runtime": "^7.5.5", "core-js": "^3.2.1", - "cornerstone-tools": "^6.0.5", - "dcmjs": "^0.18.11", + "cornerstone-tools": "6.0.5", + "dcmjs": "0.18.9", "ol": "6.7.0" }, "devDependencies": { diff --git a/platform/core/package.json b/platform/core/package.json index e585d8be104..8537bc7ab88 100644 --- a/platform/core/package.json +++ b/platform/core/package.json @@ -32,7 +32,7 @@ }, "peerDependencies": { "cornerstone-core": "^2.5.0", - "cornerstone-tools": "^6.0.0", + "cornerstone-tools": "^6.0.5", "cornerstone-wado-image-loader": "^4.0.3", "dicom-parser": "^1.8.9" }, diff --git a/platform/core/src/utils/dicomLoaderService.js b/platform/core/src/utils/dicomLoaderService.js index b354c61fffa..823ae64b2f4 100644 --- a/platform/core/src/utils/dicomLoaderService.js +++ b/platform/core/src/utils/dicomLoaderService.js @@ -50,6 +50,10 @@ const fetchIt = (url, headers = DICOMWeb.getAuthorizationHeader()) => { }; const cornerstoneRetriever = imageId => { + if (!imageId) { + throw new Error(`cornerstoneRetriever imageId must not be undefined`); + } + return cornerstone.loadAndCacheImage(imageId).then(image => { return image && image.data && image.data.byteArray.buffer; }); diff --git a/platform/viewer/package.json b/platform/viewer/package.json index 27ad83bdcc3..1a11be2d18d 100644 --- a/platform/viewer/package.json +++ b/platform/viewer/package.json @@ -63,9 +63,9 @@ "classnames": "^2.2.6", "config-point": "^0.3.0", "core-js": "^3.2.1", - "cornerstone-core": "^2.5.0", + "cornerstone-core": "2.6.0", "cornerstone-math": "^0.1.9", - "cornerstone-tools": "^6.0.0", + "cornerstone-tools": "6.0.5", "cornerstone-wado-image-loader": "^4.0.3", "dcmjs": "0.18.10", "dicom-parser": "^1.8.9", diff --git a/yarn.lock b/yarn.lock index 6f968b715b8..c80f65ab21a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6089,20 +6089,20 @@ core-util-is@1.0.2, core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= -cornerstone-core@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/cornerstone-core/-/cornerstone-core-2.5.0.tgz#1051ffc34420ad7484e61d2f3bdbc41a5ebc1956" - integrity sha512-mJzvRJh8J7d5FJutjaL9cT8ZNnmj6l5PHROsyktZq1ojh4vkXfHECQ2izIQu8nmtJ9A6SyQRj4v5Uxn7hijzKw== +cornerstone-core@2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/cornerstone-core/-/cornerstone-core-2.6.0.tgz#6f7d97fe98ed462254d55557ffa13568592c211c" + integrity sha512-3sMy4Q2UZ9H4f2rYRAd3s4cntDutwSZQ3QlcYgsahoUxInb68MdmeLOKe8yyguwRT9LJ4CbgvOr2WsS8dOba4g== cornerstone-math@0.1.9, cornerstone-math@^0.1.9: version "0.1.9" resolved "https://registry.yarnpkg.com/cornerstone-math/-/cornerstone-math-0.1.9.tgz#7ce5509e8b9f465b01f7c548470725e7569859fc" integrity sha512-NxdooV73asEQgav1S+0e+a4K+W3CXJdLXyFkVN24qqCtmIpzZzwtw3F9KWPCekzSAJmbhtQ3HicOQj3d4vRtuw== -cornerstone-tools@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cornerstone-tools/-/cornerstone-tools-6.0.0.tgz#6840658f4508e60cd206b17d6e56160367f616f1" - integrity sha512-VU4MrsO2NcQK6CUxuYFdiNvdWjF/NV/fs8jCePazYCoFDDKIYcUM9UmoYXAapFE2mon65p4u9wUAvuIuLeBQwA== +cornerstone-tools@6.0.5, cornerstone-tools@^6.0.0: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cornerstone-tools/-/cornerstone-tools-6.0.5.tgz#a96914f180ff6ec838152e3da30499433ee938bb" + integrity sha512-wa7tyjS8CcXXp+f5TYVXORZJT7ubgwmCoOSH0eWBqsSDGCLjrWFxfUN+j7+S1LH2+aANltTulZz5444JZRhfVg== dependencies: "@babel/runtime" "7.1.2" cornerstone-math "0.1.9" @@ -16858,11 +16858,16 @@ regenerator-runtime@^0.11.0, regenerator-runtime@^0.11.1: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== -regenerator-runtime@^0.13.1, regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.4: +regenerator-runtime@^0.13.1, regenerator-runtime@^0.13.4: version "0.13.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697" integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA== +regenerator-runtime@^0.13.2: + version "0.13.9" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" + integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== + regenerator-transform@^0.13.3: version "0.13.4" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.13.4.tgz#18f6763cf1382c69c36df76c6ce122cc694284fb" From d1c4ddc431c7ea24d7fd34ff678bb7a671c3ad98 Mon Sep 17 00:00:00 2001 From: Bill Wallace Date: Wed, 27 Oct 2021 17:01:57 -0400 Subject: [PATCH 13/18] fix(OHIFv2):Fix the video display and select tree selection --- .../dicom-video/src/DICOMVideoViewport.css | 8 ++++- .../dicom-video/src/DICOMVideoViewport.js | 2 ++ package.json | 4 +-- .../src/components/selectTree/SelectTree.js | 2 +- platform/viewer/public/config/fuberlin.js | 1 + .../src/components/Labelling/LabellingFlow.js | 9 +++++- yarn.lock | 32 +++---------------- 7 files changed, 25 insertions(+), 33 deletions(-) diff --git a/extensions/dicom-video/src/DICOMVideoViewport.css b/extensions/dicom-video/src/DICOMVideoViewport.css index 89394e8396e..64c23e4d45b 100644 --- a/extensions/dicom-video/src/DICOMVideoViewport.css +++ b/extensions/dicom-video/src/DICOMVideoViewport.css @@ -1,9 +1,9 @@ .DICOMVideoViewport { - display: flex; justify-content: center; align-items: center; height: 100%; width: 100%; + color: white; } .DICOMVideoViewport .error { @@ -14,6 +14,12 @@ font-size: 18px; } +.src { + width: 100%; + height:15%; + display:block; +} + .DICOMVideoViewport video { height: 100%; width: 100%; diff --git a/extensions/dicom-video/src/DICOMVideoViewport.js b/extensions/dicom-video/src/DICOMVideoViewport.js index c2487483918..61e0a54ac9f 100644 --- a/extensions/dicom-video/src/DICOMVideoViewport.js +++ b/extensions/dicom-video/src/DICOMVideoViewport.js @@ -110,6 +110,8 @@ const DICOMVideoViewport = ({ {state.isLoading && } {!state.isLoading && !state.errorMessage && (
) : length !== undefined ? ( -
{length} μm
+
+ {shortAxisLength + ? `${length} μm x${shortAxisLength} μm` + : `${length} μm`} +
) : null}
{rowActions}
From 8b63e2a5d685192b3820f49b82e79f1d7b5b45a0 Mon Sep 17 00:00:00 2001 From: igoroctaviano Date: Mon, 18 Oct 2021 19:45:36 -0300 Subject: [PATCH 17/18] Add spacing to measurement panel label --- .../src/components/MicroscopyPanel/MicroscopyPanel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/dicom-microscopy/src/components/MicroscopyPanel/MicroscopyPanel.js b/extensions/dicom-microscopy/src/components/MicroscopyPanel/MicroscopyPanel.js index 102a936f053..39533233389 100644 --- a/extensions/dicom-microscopy/src/components/MicroscopyPanel/MicroscopyPanel.js +++ b/extensions/dicom-microscopy/src/components/MicroscopyPanel/MicroscopyPanel.js @@ -409,7 +409,7 @@ class MicroscopyPanel extends Component { ) : length !== undefined ? (
{shortAxisLength - ? `${length} μm x${shortAxisLength} μm` + ? `${length} μm x ${shortAxisLength} μm` : `${length} μm`}
) : null} From e9e8f84838652bae38f15c073a33bd531d07159e Mon Sep 17 00:00:00 2001 From: igoroctaviano Date: Wed, 27 Oct 2021 17:59:03 -0300 Subject: [PATCH 18/18] Add sr for bidirectional --- .../src/components/MicroscopyPanel/MicroscopyPanel.js | 7 +++---- extensions/dicom-microscopy/src/utils/dcmCodeValues.js | 2 ++ extensions/dicom-microscopy/src/utils/loadSR.js | 9 ++++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/extensions/dicom-microscopy/src/components/MicroscopyPanel/MicroscopyPanel.js b/extensions/dicom-microscopy/src/components/MicroscopyPanel/MicroscopyPanel.js index 39533233389..d7c0c3b5bf2 100644 --- a/extensions/dicom-microscopy/src/components/MicroscopyPanel/MicroscopyPanel.js +++ b/extensions/dicom-microscopy/src/components/MicroscopyPanel/MicroscopyPanel.js @@ -9,9 +9,7 @@ import { withTranslation, } from '@ohif/ui'; import DEVICE_OBSERVER_UID from '../../utils/DEVICE_OBSERVER_UID'; -import microscopyManager, { - EVENTS as MicroscopyEvents, -} from '../../tools/microscopyManager'; +import { EVENTS as MicroscopyEvents } from '../../tools/microscopyManager'; import { utils, DICOMWeb, errorHandler } from '@ohif/core'; import { api } from 'dicomweb-client'; import dcmjs from 'dcmjs'; @@ -368,7 +366,8 @@ class MicroscopyPanel extends Component { const label = roiAnnotation.getDetailedLabel(); const area = roiAnnotation.getArea(); const length = roiAnnotation.getLength(); - const shortAxisLength = roiAnnotation.roiGraphic.properties.shortAxisLength; + const shortAxisLength = + roiAnnotation.roiGraphic.properties.shortAxisLength; const isSelected = this.state.selectedAnnotation === roiAnnotation; const onRelabel = () => microscopyManager.triggerRelabel(roiAnnotation); diff --git a/extensions/dicom-microscopy/src/utils/dcmCodeValues.js b/extensions/dicom-microscopy/src/utils/dcmCodeValues.js index 45b9ba996f7..10c2c363a73 100644 --- a/extensions/dicom-microscopy/src/utils/dcmCodeValues.js +++ b/extensions/dicom-microscopy/src/utils/dcmCodeValues.js @@ -6,6 +6,8 @@ const DCM_CODE_VALUES = { TRACKING_UNIQUE_IDENTIFIER: '112039', LENGTH: '410668003', AREA: '42798000', + SHORT_AXIS: 'G-A186', + LONG_AXIS: 'G-A185', }; export default DCM_CODE_VALUES; diff --git a/extensions/dicom-microscopy/src/utils/loadSR.js b/extensions/dicom-microscopy/src/utils/loadSR.js index 15ce0dba3ab..7f5d001964c 100644 --- a/extensions/dicom-microscopy/src/utils/loadSR.js +++ b/extensions/dicom-microscopy/src/utils/loadSR.js @@ -116,9 +116,12 @@ async function _getROIsFromToolState(naturalizedDataset, FrameOfReferenceUID) { } let measurements = toArray(measurementGroup.ContentSequence).filter(ci => - [DCM_CODE_VALUES.LENGTH, DCM_CODE_VALUES.AREA].includes( - ci.ConceptNameCodeSequence.CodeValue - ) + [ + DCM_CODE_VALUES.LENGTH, + DCM_CODE_VALUES.AREA, + DCM_CODE_VALUES.SHORT_AXIS, + DCM_CODE_VALUES.LONG_AXIS, + ].includes(ci.ConceptNameCodeSequence.CodeValue) ); let evaluations = toArray(measurementGroup.ContentSequence).filter(ci =>