Compare commits

...
Author SHA1 Message Date
ohif-bot 30515b8ab5 chore(release): publish [skip ci]
- @ohif/extension-dicom-segmentation@0.7.21
 - @ohif/viewer@4.12.50
2023-01-17 17:52:04 +00:00
Gitanjali 24bbf2b190 Re IDC #3077: Seg series thumbnail selection (#3078)
* fix: #3077 update seg tolerance popup and update seg thumbnail warning

* jump to first segment item image

* Shows warning message only once on onChange
2023-01-17 09:50:25 -08:00
Alireza cb9aa6a765 chore: update issue and PR templates (#3113)
* chore: update issue templates

* add template to PRs

* update for pr titles

* update

* update

* update description
2023-01-11 16:53:35 -05:00
13 changed files with 295 additions and 60 deletions

No files matched your search

+16 -9
View File
@@ -2,23 +2,21 @@
name: "\U0001F41B Bug report"
about: Create a report to help us improve
title: ''
labels: 'Community: Report :bug:, Awaiting Reproduction, Triage :white_flag:'
labels: 'Community: Report :bug:, Awaiting Reproduction'
assignees: ''
---
> **Before Creating an issue**
>
> - Are you running the latest version?
> - Are you reporting to the correct repository?
> - Did you search existing issues?
## Bug Report
<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://github.com/OHIF/Viewers/blob/master/CODE_OF_CONDUCT.md -->
<!-- 🕮 Read our guide about our process: https://v3-docs.ohif.org/development/our-process -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest version -->
### Describe the Bug
_A clear and concise description of what the bug is._
### What steps can we follow to reproduce the bug?
### Steps to Reproduce:
1. First step
2. Second step
@@ -28,6 +26,15 @@ _A clear and concise description of what the bug is._
Please use code blocks to show formatted errors or code snippets
```
### The current behavior
_A clear and concise description of what happens instead of the expected
behavior._
### The expected behavior
_A clear and concise description of what you expected to happen._
> :warning: Reports we cannot reproduce are at risk of being marked stale and
> closed. The more information you can provide, the more likely we are to look
> into and address your issue.
+14 -5
View File
@@ -2,19 +2,28 @@
name: "\U0001F680 Feature request"
about: Suggest an idea for this project
title: ''
labels: 'Community: Request :hand:, Triage :white_flag:'
labels: 'Community: Request :hand:'
assignees: ''
---
> :hand: Many people requests features. Tell us why yours is important to the
<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://github.com/OHIF/Viewers/blob/master/CODE_OF_CONDUCT.md -->
<!-- :hand: Many people requests features. Tell us why yours is important to the
> community. How does it add value? Why _this feature_?
>
> Is your request very specific to your needs? Consider
> [contributing it](https://docs.ohif.org/contributing.html) yourself! Or reach
> out to a community member that offers
> [contributing it](https://v3-docs.ohif.org/development/contributing) yourself!
> Or reach out to a community member that offers
> [consulting services](https://docs.ohif.org/help.html#paid--commercial).
-->
## Request
### Request
<!--
Please include as much detail as possible including possibly mock up screen shots, workflow or logic flow diagrams etc.
Discuss if and how the requested feature interacts with existing features
-->
**What feature or change would you like to see made?**
+86 -9
View File
@@ -1,14 +1,91 @@
### PR Checklist
- [ ] Brief description of changes
- [ ] Links to any relevant issues
- [ ] Required status checks are passing
- [ ] User cases if changes impact the user's experience
- [ ] `@mention` a maintainer to request a review
<!-- Do Not Delete This! pr_template -->
<!-- Please read our Rules of Conduct: https://github.com/OHIF/Viewers/blob/master/CODE_OF_CONDUCT.md -->
<!-- 🕮 Read our guide about our Contributing Guide here https://v3-docs.ohif.org/development/contributing -->
<!-- :hand: Thank you for starting this amazing contribution! -->
<!--
Links
-->
⚠️⚠️ Please make sure the checklist section below is complete before submitting your PR.
To complete the checklist, add an 'x' to each item: [] -> [x]
(PRs that do not have all the checkboxes marked will not be approved)
-->
### Context
<!--
Provide a clear explanation of the reasoning behind this change, such as:
- A link to the issue being addressed, using the format "Fixes #ISSUE_NUMBER"
- An image showing the issue or problem being addressed (if not already in the issue)
- Error logs or callStacks to help with the understanding of the problem (if not already in the issue)
-->
### Changes & Results
<!--
List all the changes that have been done, such as:
- Add new components
- Remove old components
- Update dependencies
What are the effects of this change?
- Before vs After
- Screenshots / GIFs / Videos
-->
### Testing
<!--
Describe how we can test your changes.
- open a URL
- visit a page
- click on a button
- etc.
-->
### Checklist
#### PR
<!--
https://semantic-release.gitbook.io/semantic-release/#how-does-it-work
Examples:
Please note the letter casing in the provided examples (upper or lower).
- feat(MeasurementService): add ...
- fix(Toolbar): fix ...
- docs(Readme): update ...
- style(Whitespace): fix ...
- refactor(ExtensionManager): ...
- test(HangingProtocol): Add test ...
- chore(git): update ...
- perf(VolumeLoader): ...
You don't need to have each commit within the Pull Request follow the rule,
but the PR title must comply with it, as it will be used as the commit message
after the commits are squashed.
-->
- [] My Pull Request title is descriptive, accurate and follows the
semantic-release format and guidelines.
#### Code
- [] My code has been well-documented (function documentation, inline comments,
etc.)
#### Public Documentation Updates
<!-- https://v3-docs.ohif.org/ -->
- [] The documentation page has been updated as necessary for any public API
additions or removals.
#### Tested Environment
- [] "OS: <!--[e.g. Windows 10, macOS 10.15.4]"-->
- [] "Node version: <!--[e.g. 16.14.0]"-->
- [] "Browser:
<!--[e.g. Chrome 83.0.4103.116, Firefox 77.0.1, Safari 13.1.1]"-->
<!-- prettier-ignore-start -->
[blog]: https://circleci.com/blog/triggering-trusted-ci-jobs-on-untrusted-forks/
+3 -9
View File
@@ -4,23 +4,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 180
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 9000
daysUntilClose: 60
# Issues with these labels will never be considered stale
exemptLabels:
- 'Story :raised_hands:'
- 'Bug: Verified :bug:'
- 'Task: CI/Tooling :robot:'
- 'Task: Docs 📖'
- 'Task: Docs :book:'
- 'Task: Refactor :hammer_and_wrench:'
- 'Task: Tests :microscope:'
- 'PR: Awaiting Review 👀'
- 'Triage :white_flag:'
- 'Extension: Discussion'
- 'Announcement 🎉'
- 'IDC:priority'
- 'IDC:candidate'
- 'IDC:collaboration'
- 'Community: Request :hand:'
- 'Community: Report :bug:'
# Label to use when marking an issue as stale
staleLabel: 'Stale :baguette_bread:'
# Comment to post when marking an issue as stale. Set to `false` to disable
@@ -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.21](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-segmentation@0.7.20...@ohif/extension-dicom-segmentation@0.7.21) (2023-01-17)
**Note:** Version bump only for package @ohif/extension-dicom-segmentation
## [0.7.20](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-segmentation@0.7.19...@ohif/extension-dicom-segmentation@0.7.20) (2023-01-10)
**Note:** Version bump only for package @ohif/extension-dicom-segmentation
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/extension-dicom-segmentation",
"version": "0.7.20",
"version": "0.7.21",
"description": "OHIF extension for viewing segmentations in the 2D MPR view",
"author": "OHIF",
"license": "MIT",
@@ -0,0 +1,100 @@
import csTools from 'cornerstone-tools';
import cs from 'cornerstone-core';
import OHIF from '@ohif/core';
import DICOMSegTempCrosshairsTool from './tools/DICOMSegTempCrosshairsTool';
import refreshViewports from './utils/refreshViewports';
const { studyMetadataManager } = OHIF.utils;
const commandsModule = ({ commandsManager }) => {
const actions = {
jumpToFirstSegment: ({ viewports }) => {
try {
const { activeViewportIndex, viewportSpecificData } = viewports;
const viewport = viewportSpecificData[activeViewportIndex];
const { StudyInstanceUID, displaySetInstanceUID } = viewport;
const studyMetadata = studyMetadataManager.get(StudyInstanceUID);
const firstImageId = studyMetadata.getFirstImageId(
displaySetInstanceUID
);
const module = csTools.getModule('segmentation');
const brushStackState = module.state.series[firstImageId];
const { labelmaps3D, activeLabelmapIndex } = brushStackState;
const { labelmaps2D } = labelmaps3D[activeLabelmapIndex];
const firstLabelMap2D = labelmaps2D.find(value => !!value);
const firstSegment = firstLabelMap2D.segmentsOnLabelmap[0];
const segmentNumber = firstSegment;
const validIndexList = [];
labelmaps2D.forEach((labelMap2D, index) => {
if (labelMap2D.segmentsOnLabelmap.includes(segmentNumber)) {
validIndexList.push(index);
}
});
const avg = array => array.reduce((a, b) => a + b) / array.length;
const average = avg(validIndexList);
const closest = validIndexList.reduce((prev, curr) => {
return Math.abs(curr - average) < Math.abs(prev - average)
? curr
: prev;
});
const enabledElements = cs.getEnabledElements();
const element = enabledElements[activeViewportIndex].element;
const toolState = csTools.getToolState(element, 'stack');
if (!toolState) return;
const imageIds = toolState.data[0].imageIds;
const imageId = imageIds[closest];
const frameIndex = imageIds.indexOf(imageId);
const SOPInstanceUID = cs.metaData.get('SOPInstanceUID', imageId);
cs.getEnabledElements().forEach(enabledElement => {
cs.updateImage(enabledElement.element);
});
DICOMSegTempCrosshairsTool.addCrosshair(
element,
imageId,
segmentNumber
);
cs.getEnabledElements().forEach(enabledElement => {
cs.updateImage(enabledElement.element);
});
const refreshViewports = false;
commandsManager.runCommand('jumpToImage', {
StudyInstanceUID,
SOPInstanceUID,
frameIndex,
activeViewportIndex,
refreshViewports,
});
} catch (error) {
console.log('Error in moving to the first segment slice');
}
},
};
const definitions = {
jumpToFirstSegment: {
commandFn: actions.jumpToFirstSegment,
storeContexts: ['viewports'],
options: {},
},
};
return {
definitions,
defaultContext: 'VIEWER',
};
};
export default commandsModule;
@@ -29,6 +29,32 @@ const SegmentationSettings = ({ configuration, onBack, onChange, servicesManager
setState(state => ({ ...state, [field]: value }));
};
const once = fn => (...args) => {
if (!fn) return;
fn(...args);
fn = null;
};
const segTolValue = document.getElementById('segToleranceValue');
if (segTolValue) {
segTolValue.onchange = once(function() {
const { UINotificationService, LoggerService } = servicesManager.services;
const error = new Error(
'Segmentation loader tolerance changed.\
This operation can potentially generate errors in the Segmentation parsing.'
);
LoggerService.error({ error, message: error.message });
UINotificationService.show({
title: 'Segmentation panel',
message: error.message,
type: 'warning',
autoClose: true,
});
});
}
const toFloat = value => parseFloat(value / 100).toFixed(2);
return (
@@ -138,32 +164,23 @@ const SegmentationSettings = ({ configuration, onBack, onChange, servicesManager
<label style={{ margin: '0 15px' }}>
Tolerance:
<input
id="segToleranceValue"
style={{ margin: '0 15px' }}
label="Tolerance"
onKeyPress={event => {
const validate = string => {
let rgx = /[^-.e0-9]+/g;
return string.match(rgx);
};
const validate = string => {
let rgx = /[^-.e0-9]+/g;
return string.match(rgx);
};
if (validate(event.key)) {
event.preventDefault();
}
}}
onChange={event => {
save('segsTolerance', event.target.value);
const { UINotificationService, LoggerService } = servicesManager.services;
const error = new Error('Segmentation loader tolerance changed. This operation can potentially generate errors in the Segmentation parsing.');
LoggerService.error({ error, message: error.message });
UINotificationService.show({
title: 'Segmentation panel',
message: error.message,
type: 'warning',
autoClose: true,
});
if (validate(event.key)) {
event.preventDefault();
}
}
}
onChange={event => {
save('segsTolerance', event.target.value);
}}
value={state.segsTolerance}
/>
</label>
@@ -6,6 +6,7 @@ import toolbarModule from './toolbarModule.js';
import getSopClassHandlerModule from './getOHIFDicomSegSopClassHandler.js';
import SegmentationPanel from './components/SegmentationPanel/SegmentationPanel.js';
import { version } from '../package.json';
import commandsModule from './commandsModule.js';
const { studyMetadataManager } = OHIF.utils;
export default {
@@ -121,6 +122,15 @@ export default {
});
};
const onSegmentationsCompletelyLoaded = () => {
commandsManager.runCommand('jumpToFirstSegment');
};
document.addEventListener(
'segseriesselected',
onSegmentationsCompletelyLoaded
);
document.addEventListener(
'extensiondicomsegmentationsegloaded',
onSegmentationsLoaded
@@ -182,5 +192,8 @@ export default {
defaultContext: ['VIEWER'],
};
},
getCommandsModule({ commandsManager, servicesManager }) {
return commandsModule({ commandsManager, servicesManager });
},
getSopClassHandlerModule,
};
+8
View File
@@ -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.50](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.12.49...@ohif/viewer@4.12.50) (2023-01-17)
**Note:** Version bump only for package @ohif/viewer
## [4.12.49](https://github.com/OHIF/Viewers/compare/@ohif/viewer@4.12.48...@ohif/viewer@4.12.49) (2023-01-10)
**Note:** Version bump only for package @ohif/viewer
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/viewer",
"version": "4.12.49",
"version": "4.12.50",
"description": "OHIF Viewer",
"author": "OHIF Contributors",
"license": "MIT",
@@ -54,7 +54,7 @@
"@ohif/extension-dicom-microscopy": "^0.52.0",
"@ohif/extension-dicom-pdf": "^1.1.2",
"@ohif/extension-dicom-rt": "^0.7.14",
"@ohif/extension-dicom-segmentation": "^0.7.20",
"@ohif/extension-dicom-segmentation": "^0.7.21",
"@ohif/extension-lesion-tracker": "^0.2.2",
"@ohif/extension-vtk": "^1.12.41",
"@ohif/i18n": "^0.53.0",
@@ -54,7 +54,9 @@ const mapDispatchToProps = (dispatch, ownProps) => {
detail: { activatedLabelmapIndex: activatedLabelmapIndex },
}
);
const segThumbnailSelected = new CustomEvent('segseriesselected');
document.dispatchEvent(selectionFired);
document.dispatchEvent(segThumbnailSelected);
});
} else if (Modality !== 'SR') {
displaySet = displaySet.getSourceDisplaySet(ownProps.studyMetadata);
@@ -505,14 +505,14 @@ const _checkForDerivedDisplaySets = async function(displaySet, study) {
* @returns {[string]} an array of strings containing the warnings
*/
const _checkForSeriesInconsistencesWarnings = async function(displaySet) {
if (displaySet.inconsistencyWarnings) {
// warnings already checked and cached in displaySet
return displaySet.inconsistencyWarnings;
}
const inconsistencyWarnings = [];
if (displaySet.Modality !== 'SEG') {
// warnings already checked and cached in displaySet
if (displaySet.inconsistencyWarnings) {
return displaySet.inconsistencyWarnings;
}
if (
displaySet.reconstructionIssues &&
displaySet.reconstructionIssues.length !== 0