feat(segmentation mode): Add create, and export SEG with Brushes (#3632)

This commit is contained in:
Alireza authored and GitHub committed 2023-09-22 10:23:44 -04:00
1 parent 896866e9d0
commit 48bbd6281a
186 files changed
+6801 -2883

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ export default defineConfig({
responseTimeout: 10000,
specPattern: 'cypress/integration/**/*.spec.[jt]s',
projectId: '4oe38f',
video: false,
video: true,
reporter: 'junit',
reporterOptions: {
mochaFile: 'cypress/results/test-output.xml',
@@ -7,6 +7,7 @@ describe('OHIF Multi Study', () => {
cy.expectMinimumThumbnails(4);
cy.initCornerstoneToolsAliases();
cy.initCommonElementsAliases();
cy.waitDicomImage();
};
it('Should display 2 comparison up', () => {
@@ -1,8 +1,6 @@
describe('OHIF PDF Display', function () {
beforeEach(function () {
cy.openStudyInViewer('2.25.317377619501274872606137091638706705333');
cy.resetViewport().wait(50);
});
it('checks if series thumbnails are being displayed', function () {
@@ -1,7 +1,6 @@
describe('OHIF Video Display', function () {
beforeEach(function () {
cy.openStudyInViewer('2.25.96975534054447904995905761963464388233');
cy.resetViewport().wait(50);
});
it('checks if series thumbnails are being displayed', function () {
@@ -1,5 +1,5 @@
describe('OHIF HP', () => {
const beforeSetup = () => {
beforeEach(() => {
cy.checkStudyRouteInViewer(
'1.3.6.1.4.1.25403.345050719074.3824.20170125113417.1',
'&hangingProtocolId=@ohif/mnGrid'
@@ -7,17 +7,14 @@ describe('OHIF HP', () => {
cy.expectMinimumThumbnails(3);
cy.initCornerstoneToolsAliases();
cy.initCommonElementsAliases();
};
cy.waitDicomImage();
});
it('Should display 3 up', () => {
beforeSetup();
cy.get('[data-cy="viewport-pane"]').its('length').should('be.eq', 3);
});
it('Should navigate next/previous stage', () => {
beforeSetup();
cy.get('body').type(',');
cy.wait(250);
cy.get('[data-cy="viewport-pane"]').its('length').should('be.eq', 4);
@@ -5,7 +5,7 @@ describe('OHIF Context Menu', function () {
cy.expectMinimumThumbnails(3);
cy.initCommonElementsAliases();
cy.initCornerstoneToolsAliases();
cy.resetViewport().wait(50);
cy.waitDicomImage();
});
it('checks context menu customization', function () {
@@ -13,10 +13,10 @@ describe('OHIF Cornerstone Hotkeys', () => {
cy.expectMinimumThumbnails(3);
cy.initCornerstoneToolsAliases();
cy.initCommonElementsAliases();
cy.waitDicomImage();
});
it('checks if hotkeys "R" and "L" can rotate the image', () => {
// Hotkey R
cy.get('body').type('R');
cy.get('@viewportInfoMidLeft').should('contains.text', 'P');
cy.get('@viewportInfoMidTop').should('contains.text', 'R');
@@ -9,6 +9,7 @@ describe('OHIF Cornerstone Toolbar', () => {
//const expectedText = 'Ser: 1';
//cy.get('@viewportInfoBottomLeft').should('contains.text', expectedText);
cy.waitDicomImage();
});
it('checks if all primary buttons are being displayed', () => {
@@ -66,13 +67,12 @@ describe('OHIF Cornerstone Toolbar', () => {
// });
it('checks if Levels tool will change the window width and center of an image', () => {
//Click on button and verify if icon is active on toolbar
cy.waitDicomImage();
cy.get('@wwwcBtnPrimary')
.click()
.then($wwwcBtn => {
cy.wrap($wwwcBtn).should('have.class', 'active');
});
// Wait for the DICOM image to load
// Assign an alias to the button element
cy.get('@wwwcBtnPrimary').as('wwwcButton');
cy.get('@wwwcButton').click();
cy.get('@wwwcButton').should('have.class', 'active');
//drags the mouse inside the viewport to be able to interact with series
cy.get('@viewport')
@@ -90,13 +90,16 @@ describe('OHIF Cornerstone Toolbar', () => {
});
it('checks if Pan tool will move the image inside the viewport', () => {
//Click on button and verify if icon is active on toolbar
cy.get('@panBtn')
.click()
.then($panBtn => {
cy.wrap($panBtn).should('have.class', 'active');
});
// Assign an alias to the button element
cy.get('@panBtn').as('panButton');
// Click on the button
cy.get('@panButton').click();
// Assert that the button has the 'active' class
cy.get('@panButton').should('have.class', 'active');
// Trigger the pan actions on the viewport
cy.get('@viewport')
.trigger('mousedown', 'center', { buttons: 1 })
.trigger('mousemove', 'bottom', { buttons: 1 })
@@ -5,7 +5,6 @@ describe('OHIF Measurement Panel', function () {
cy.expectMinimumThumbnails(3);
cy.initCommonElementsAliases();
cy.initCornerstoneToolsAliases();
cy.resetViewport().wait(50);
cy.waitDicomImage();
});
@@ -5,7 +5,6 @@ describe('OHIF Study Viewer Page', function () {
cy.expectMinimumThumbnails(3);
cy.initCommonElementsAliases();
cy.initCornerstoneToolsAliases();
cy.resetViewport().wait(50);
});
it('checks if series thumbnails are being displayed', function () {
+33 -23
View File
@@ -144,18 +144,19 @@ Cypress.Commands.add('drag', { prevSubject: 'element' }, (...args) =>
* @param {number[]} secondClick - Click position [x, y]
*/
Cypress.Commands.add('addLine', (viewport, firstClick, secondClick) => {
cy.get(viewport).then($viewport => {
const [x1, y1] = firstClick;
const [x2, y2] = secondClick;
cy.get(viewport).as('viewportAlias');
const [x1, y1] = firstClick;
const [x2, y2] = secondClick;
// The wait is necessary because of double click testing
cy.wrap($viewport)
.click(x1, y1)
.wait(250)
.trigger('mousemove', { clientX: x2, clientY: y2 })
.click(x2, y2)
.wait(250);
});
// First click
cy.get('@viewportAlias').click(x1, y1, { force: true, multiple: true }).wait(250);
// Move the mouse and then click again
cy.get('@viewportAlias')
.trigger('mousemove', { clientX: x2, clientY: y2 })
.get('@viewportAlias')
.click(x2, y2, { force: true, multiple: true })
.wait(250);
});
/**
@@ -183,8 +184,10 @@ Cypress.Commands.add('addAngle', (viewport, firstClick, secondClick, thirdClick)
});
Cypress.Commands.add('expectMinimumThumbnails', (seriesToWait = 1) => {
cy.get('[data-cy="study-browser-thumbnail"]', { timeout: 50000 }).should($itemList => {
expect($itemList.length >= seriesToWait).to.be.true;
cy.get('[data-cy="study-browser-thumbnail"]', { timeout: 50000 }).as('thumbnails');
cy.get('@thumbnails').should($itemList => {
expect($itemList.length).to.be.gte(seriesToWait);
});
});
@@ -211,11 +214,13 @@ Cypress.Commands.add('waitDicomImage', (mode = '/basic-test', timeout = 50000) =
//Command to reset and clear all the changes made to the viewport
Cypress.Commands.add('resetViewport', () => {
//Click on More button
// Assign an alias to the More button
cy.get('[data-cy="MoreTools-split-button-primary"]')
.should('have.attr', 'data-tool', 'Reset')
.as('moreBtn')
.click();
.as('moreBtn');
// Use the alias to click on the More button
cy.get('@moreBtn').click();
});
Cypress.Commands.add('imageZoomIn', () => {
@@ -266,12 +271,13 @@ Cypress.Commands.add('initStudyListAliasesOnDesktop', () => {
Cypress.Commands.add(
'addLengthMeasurement',
(firstClick = [150, 100], secondClick = [130, 170]) => {
cy.get('@measurementToolsBtnPrimary')
.should('have.attr', 'data-tool', 'Length')
.click()
.then($lengthBtn => {
cy.wrap($lengthBtn).should('have.class', 'active');
});
// Assign an alias to the button element
cy.get('@measurementToolsBtnPrimary').as('lengthButton');
cy.get('@lengthButton').should('have.attr', 'data-tool', 'Length');
cy.get('@lengthButton').click();
cy.get('@lengthButton').should('have.class', 'active');
cy.addLine('.viewport-element', firstClick, secondClick);
}
@@ -463,7 +469,11 @@ Cypress.Commands.add('closePreferences', () => {
Cypress.Commands.add('selectPreferencesTab', tabAlias => {
cy.initPreferencesModalAliases();
cy.get(tabAlias).click().should('have.class', 'active');
cy.get(tabAlias).as('selectedTab');
cy.get('@selectedTab').click();
cy.get('@selectedTab').should('have.class', 'active');
initPreferencesModalFooterBtnAliases();
});
+1 -1
View File
@@ -94,7 +94,7 @@
"devDependencies": {
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@percy/cypress": "^3.1.1",
"cypress": "^12.6.0",
"cypress": "^13.2.0",
"cypress-file-upload": "^3.5.3",
"glob": "^8.0.3",
"identity-obj-proxy": "3.0.x",
+3
View File
@@ -57,6 +57,9 @@
{
"packageName": "@ohif/mode-longitudinal"
},
{
"packageName": "@ohif/mode-segmentation"
},
{
"packageName": "@ohif/mode-tmtv"
},
-1
View File
@@ -23,7 +23,6 @@ window.config = {
qidoRoot: 'https://myserver.com/dicomweb',
wadoRoot: 'https://myserver.com/dicomweb',
qidoSupportsIncludeField: false,
supportsReject: false,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
enableStudyLazyLoad: true,
+1 -5
View File
@@ -3,10 +3,7 @@ window.config = {
// whiteLabeling: {},
extensions: [],
modes: [],
customizationService: {
// Shows a custom route -access via http://localhost:3000/custom
// helloPage: '@ohif/extension-default.customizationModule.helloPage',
},
customizationService: {},
showStudyList: true,
// some windows systems have issues with more than 3 web workers
maxNumberOfWebWorkers: 3,
@@ -45,7 +42,6 @@ window.config = {
qidoRoot: 'https://d33do7qe4w26qo.cloudfront.net/dicomweb',
wadoRoot: 'https://d33do7qe4w26qo.cloudfront.net/dicomweb',
qidoSupportsIncludeField: false,
supportsReject: false,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
enableStudyLazyLoad: true,
@@ -22,7 +22,6 @@ window.config = {
qidoRoot: '/dicomweb',
wadoRoot: '/dicomweb',
qidoSupportsIncludeField: false,
supportsReject: false,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
enableStudyLazyLoad: true,
-2
View File
@@ -23,7 +23,6 @@ window.config = {
qidoRoot: '/viewer-testdata',
wadoRoot: '/viewer-testdata',
qidoSupportsIncludeField: false,
supportsReject: false,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
enableStudyLazyLoad: true,
@@ -63,7 +62,6 @@ window.config = {
qidoRoot: 'https://d33do7qe4w26qo.cloudfront.net/dicomweb',
wadoRoot: 'https://d33do7qe4w26qo.cloudfront.net/dicomweb',
qidoSupportsIncludeField: false,
supportsReject: false,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
enableStudyLazyLoad: true,
@@ -22,7 +22,6 @@ window.config = {
qidoRoot: '/dicomweb',
wadoRoot: '/dicomweb',
qidoSupportsIncludeField: false,
supportsReject: false,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
enableStudyLazyLoad: true,
-3
View File
@@ -59,7 +59,6 @@ window.config = {
qidoRoot: 'https://d33do7qe4w26qo.cloudfront.net/dicomweb',
wadoRoot: 'https://d33do7qe4w26qo.cloudfront.net/dicomweb',
qidoSupportsIncludeField: false,
supportsReject: false,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
enableStudyLazyLoad: true,
@@ -78,7 +77,6 @@ window.config = {
qidoRoot: 'https://dd32w2rfebxel.cloudfront.net/dicomweb',
wadoRoot: 'https://dd32w2rfebxel.cloudfront.net/dicomweb',
qidoSupportsIncludeField: false,
supportsReject: false,
supportsStow: false,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
@@ -99,7 +97,6 @@ window.config = {
qidoRoot: '/viewer-testdata',
wadoRoot: '/viewer-testdata',
qidoSupportsIncludeField: false,
supportsReject: false,
supportsStow: false,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
-1
View File
@@ -22,7 +22,6 @@ window.config = {
wadoRoot: 'https://d33do7qe4w26qo.cloudfront.net/dicomweb',
qidoSupportsIncludeField: false,
supportsReject: false,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
enableStudyLazyLoad: true,
+1 -1
View File
@@ -382,7 +382,7 @@ function _getViewportComponent(displaySets, viewportComponents, uiNotificationSe
console.log("Can't show displaySet", SOPClassHandlerId, displaySets[0]);
uiNotificationService.show({
title: 'Viewport Not Supported Yet',
message: `Cannot display SOPClassId of ${displaySets[0].SOPClassUID} yet`,
message: `Cannot display SOPClassUID of ${displaySets[0].SOPClassUID} yet`,
type: 'error',
});