feat: Remove Eraser
feat: Remove Eraser
This commit is contained in:
commit
bb7cce4716
@ -18,7 +18,7 @@ function fallbackMetaDataProvider(type, imageId) {
|
||||
const wadoRoot = window.store.getState().servers.servers[0].wadoRoot;
|
||||
const wadoRsImageId = `wadors:${wadoRoot}/studies/${qs.studyUID}/series/${
|
||||
qs.seriesUID
|
||||
}/instances/${qs.objectUID}/frames/${qs.frame || 1}`;
|
||||
}/instances/${qs.objectUID}/frames/${qs.frame || 1}`;
|
||||
|
||||
return cornerstone.metaData.get(type, wadoRsImageId);
|
||||
}
|
||||
@ -81,7 +81,6 @@ export default function init({ servicesManager, configuration }) {
|
||||
touch: [csTools.PanMultiTouchTool, csTools.ZoomTouchPinchTool],
|
||||
annotations: [
|
||||
csTools.ArrowAnnotateTool,
|
||||
csTools.EraserTool,
|
||||
csTools.BidirectionalTool,
|
||||
csTools.LengthTool,
|
||||
csTools.AngleTool,
|
||||
@ -189,7 +188,9 @@ export default function init({ servicesManager, configuration }) {
|
||||
|
||||
const _initMeasurementService = measurementService => {
|
||||
/* Initialization */
|
||||
const { toAnnotation, toMeasurement } = measurementServiceMappingsFactory(measurementService);
|
||||
const { toAnnotation, toMeasurement } = measurementServiceMappingsFactory(
|
||||
measurementService
|
||||
);
|
||||
const csToolsVer4MeasurementSource = measurementService.createSource(
|
||||
'CornerstoneTools',
|
||||
'4'
|
||||
@ -214,7 +215,9 @@ const _initMeasurementService = measurementService => {
|
||||
};
|
||||
|
||||
const _connectToolsToMeasurementService = measurementService => {
|
||||
const csToolsVer4MeasurementSource = _initMeasurementService(measurementService);
|
||||
const csToolsVer4MeasurementSource = _initMeasurementService(
|
||||
measurementService
|
||||
);
|
||||
const {
|
||||
id: sourceId,
|
||||
addOrUpdate,
|
||||
@ -242,7 +245,8 @@ const _connectToolsToMeasurementService = measurementService => {
|
||||
);
|
||||
console.log('Mapped annotation:', annotation);
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
measurementService.subscribe(
|
||||
MEASUREMENT_UPDATED,
|
||||
|
||||
@ -215,15 +215,6 @@ const definitions = [
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'Bidirectional' },
|
||||
},
|
||||
{
|
||||
id: 'Eraser',
|
||||
label: 'Eraser',
|
||||
icon: 'eraser',
|
||||
//
|
||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'Eraser' },
|
||||
},
|
||||
{
|
||||
id: 'Download',
|
||||
label: 'Download',
|
||||
@ -245,7 +236,7 @@ const definitions = [
|
||||
type: TOOLBAR_BUTTON_TYPES.COMMAND,
|
||||
commandName: 'setCornerstoneLayout',
|
||||
context: 'ACTIVE_VIEWPORT::VTK',
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
|
||||
@ -30,11 +30,11 @@ import edit from './icons/edit.svg';
|
||||
import ellipseCircle from './icons/ellipse-circle.svg';
|
||||
import ellipseH from './icons/ellipse-h.svg';
|
||||
import ellipseV from './icons/ellipse-v.svg';
|
||||
import eraser from './icons/eraser.svg';
|
||||
import exclamationCircle from './icons/exclamation-circle.svg';
|
||||
import exclamationTriangle from './icons/exclamation-triangle.svg';
|
||||
import fastBackward from './icons/fast-backward.svg';
|
||||
import fastForward from './icons/fast-forward.svg';
|
||||
import stop from './icons/stop.svg';
|
||||
import info from './icons/info.svg';
|
||||
import inlineEdit from './icons/inline-edit.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 stepBackward from './icons/step-backward.svg';
|
||||
import stepForward from './icons/step-forward.svg';
|
||||
import stop from './icons/stop.svg';
|
||||
import sun from './icons/sun.svg';
|
||||
import th from './icons/th.svg';
|
||||
import thLarge from './icons/th-large.svg';
|
||||
@ -114,7 +113,6 @@ const ICONS = {
|
||||
'create-comment': createComment,
|
||||
'create-screen-capture': createScreenCapture,
|
||||
edit,
|
||||
eraser,
|
||||
'fast-backward': fastBackward,
|
||||
'fast-forward': fastForward,
|
||||
'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', () => {
|
||||
// Click on More button
|
||||
cy.get('@moreBtn').click();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user