feat: Remove Eraser
feat: Remove Eraser
This commit is contained in:
commit
bb7cce4716
@ -81,7 +81,6 @@ export default function init({ servicesManager, configuration }) {
|
|||||||
touch: [csTools.PanMultiTouchTool, csTools.ZoomTouchPinchTool],
|
touch: [csTools.PanMultiTouchTool, csTools.ZoomTouchPinchTool],
|
||||||
annotations: [
|
annotations: [
|
||||||
csTools.ArrowAnnotateTool,
|
csTools.ArrowAnnotateTool,
|
||||||
csTools.EraserTool,
|
|
||||||
csTools.BidirectionalTool,
|
csTools.BidirectionalTool,
|
||||||
csTools.LengthTool,
|
csTools.LengthTool,
|
||||||
csTools.AngleTool,
|
csTools.AngleTool,
|
||||||
@ -189,7 +188,9 @@ export default function init({ servicesManager, configuration }) {
|
|||||||
|
|
||||||
const _initMeasurementService = measurementService => {
|
const _initMeasurementService = measurementService => {
|
||||||
/* Initialization */
|
/* Initialization */
|
||||||
const { toAnnotation, toMeasurement } = measurementServiceMappingsFactory(measurementService);
|
const { toAnnotation, toMeasurement } = measurementServiceMappingsFactory(
|
||||||
|
measurementService
|
||||||
|
);
|
||||||
const csToolsVer4MeasurementSource = measurementService.createSource(
|
const csToolsVer4MeasurementSource = measurementService.createSource(
|
||||||
'CornerstoneTools',
|
'CornerstoneTools',
|
||||||
'4'
|
'4'
|
||||||
@ -214,7 +215,9 @@ const _initMeasurementService = measurementService => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const _connectToolsToMeasurementService = measurementService => {
|
const _connectToolsToMeasurementService = measurementService => {
|
||||||
const csToolsVer4MeasurementSource = _initMeasurementService(measurementService);
|
const csToolsVer4MeasurementSource = _initMeasurementService(
|
||||||
|
measurementService
|
||||||
|
);
|
||||||
const {
|
const {
|
||||||
id: sourceId,
|
id: sourceId,
|
||||||
addOrUpdate,
|
addOrUpdate,
|
||||||
@ -242,7 +245,8 @@ const _connectToolsToMeasurementService = measurementService => {
|
|||||||
);
|
);
|
||||||
console.log('Mapped annotation:', annotation);
|
console.log('Mapped annotation:', annotation);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
measurementService.subscribe(
|
measurementService.subscribe(
|
||||||
MEASUREMENT_UPDATED,
|
MEASUREMENT_UPDATED,
|
||||||
|
|||||||
@ -215,15 +215,6 @@ const definitions = [
|
|||||||
commandName: 'setToolActive',
|
commandName: 'setToolActive',
|
||||||
commandOptions: { toolName: 'Bidirectional' },
|
commandOptions: { toolName: 'Bidirectional' },
|
||||||
},
|
},
|
||||||
{
|
|
||||||
id: 'Eraser',
|
|
||||||
label: 'Eraser',
|
|
||||||
icon: 'eraser',
|
|
||||||
//
|
|
||||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
|
||||||
commandName: 'setToolActive',
|
|
||||||
commandOptions: { toolName: 'Eraser' },
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: 'Download',
|
id: 'Download',
|
||||||
label: 'Download',
|
label: 'Download',
|
||||||
@ -245,7 +236,7 @@ const definitions = [
|
|||||||
type: TOOLBAR_BUTTON_TYPES.COMMAND,
|
type: TOOLBAR_BUTTON_TYPES.COMMAND,
|
||||||
commandName: 'setCornerstoneLayout',
|
commandName: 'setCornerstoneLayout',
|
||||||
context: 'ACTIVE_VIEWPORT::VTK',
|
context: 'ACTIVE_VIEWPORT::VTK',
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@ -30,11 +30,11 @@ import edit from './icons/edit.svg';
|
|||||||
import ellipseCircle from './icons/ellipse-circle.svg';
|
import ellipseCircle from './icons/ellipse-circle.svg';
|
||||||
import ellipseH from './icons/ellipse-h.svg';
|
import ellipseH from './icons/ellipse-h.svg';
|
||||||
import ellipseV from './icons/ellipse-v.svg';
|
import ellipseV from './icons/ellipse-v.svg';
|
||||||
import eraser from './icons/eraser.svg';
|
|
||||||
import exclamationCircle from './icons/exclamation-circle.svg';
|
import exclamationCircle from './icons/exclamation-circle.svg';
|
||||||
import exclamationTriangle from './icons/exclamation-triangle.svg';
|
import exclamationTriangle from './icons/exclamation-triangle.svg';
|
||||||
import fastBackward from './icons/fast-backward.svg';
|
import fastBackward from './icons/fast-backward.svg';
|
||||||
import fastForward from './icons/fast-forward.svg';
|
import fastForward from './icons/fast-forward.svg';
|
||||||
|
import stop from './icons/stop.svg';
|
||||||
import info from './icons/info.svg';
|
import info from './icons/info.svg';
|
||||||
import inlineEdit from './icons/inline-edit.svg';
|
import inlineEdit from './icons/inline-edit.svg';
|
||||||
import level from './icons/level.svg';
|
import level from './icons/level.svg';
|
||||||
@ -73,7 +73,6 @@ import squareO from './icons/square-o.svg';
|
|||||||
import star from './icons/star.svg';
|
import star from './icons/star.svg';
|
||||||
import stepBackward from './icons/step-backward.svg';
|
import stepBackward from './icons/step-backward.svg';
|
||||||
import stepForward from './icons/step-forward.svg';
|
import stepForward from './icons/step-forward.svg';
|
||||||
import stop from './icons/stop.svg';
|
|
||||||
import sun from './icons/sun.svg';
|
import sun from './icons/sun.svg';
|
||||||
import th from './icons/th.svg';
|
import th from './icons/th.svg';
|
||||||
import thLarge from './icons/th-large.svg';
|
import thLarge from './icons/th-large.svg';
|
||||||
@ -114,7 +113,6 @@ const ICONS = {
|
|||||||
'create-comment': createComment,
|
'create-comment': createComment,
|
||||||
'create-screen-capture': createScreenCapture,
|
'create-screen-capture': createScreenCapture,
|
||||||
edit,
|
edit,
|
||||||
eraser,
|
|
||||||
'fast-backward': fastBackward,
|
'fast-backward': fastBackward,
|
||||||
'fast-forward': fastForward,
|
'fast-forward': fastForward,
|
||||||
'object-group': objectGroup,
|
'object-group': objectGroup,
|
||||||
|
|||||||
@ -421,44 +421,6 @@ describe('OHIF Cornerstone Toolbar', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('checks if Eraser tool will remove the measurements added in the viewport', () => {
|
|
||||||
//Add measurements in the viewport
|
|
||||||
cy.addLengthMeasurement();
|
|
||||||
cy.addAngleMeasurement();
|
|
||||||
|
|
||||||
//Verify if measurement annotation was added into the measurements panel
|
|
||||||
cy.get('@measurementsBtn').click();
|
|
||||||
cy.get('.measurementItem')
|
|
||||||
.its('length')
|
|
||||||
.should('be.eq', 2);
|
|
||||||
cy.get('@measurementsBtn')
|
|
||||||
.click()
|
|
||||||
.wait(2000);
|
|
||||||
//cy.isNotInViewport('@measurementsPanel'); //TO DO: check this intermittent behaviour
|
|
||||||
|
|
||||||
//Click More button
|
|
||||||
cy.get('@moreBtn').click();
|
|
||||||
//Verify if overlay is displayed
|
|
||||||
cy.get('.tooltip-toolbar-overlay')
|
|
||||||
.should('be.visible')
|
|
||||||
.then(() => {
|
|
||||||
//Click Eraser button
|
|
||||||
cy.get('[data-cy="eraser"]').click({ force: true });
|
|
||||||
});
|
|
||||||
|
|
||||||
//Erase measurement #1 and Verify if it was removed from the measurements panel
|
|
||||||
const [x1, y1] = [150, 100];
|
|
||||||
cy.get('@viewport').click(x1, y1, { force: true });
|
|
||||||
cy.get('.measurementItem')
|
|
||||||
.its('length')
|
|
||||||
.should('be.eq', 1);
|
|
||||||
|
|
||||||
//Erase measurement #2 and Verify if it was removed from the measurements panel
|
|
||||||
const [x2, y2] = [180, 390];
|
|
||||||
cy.get('@viewport').click(x2, y2, { force: true });
|
|
||||||
cy.get('.measurementItem').should('not.exist');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('check if Invert tool will change the colors of the image in the viewport', () => {
|
it('check if Invert tool will change the colors of the image in the viewport', () => {
|
||||||
// Click on More button
|
// Click on More button
|
||||||
cy.get('@moreBtn').click();
|
cy.get('@moreBtn').click();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user