feat(SM): remove SM measurements from measurement panel (#4022)
This commit is contained in:
1 parent
77693ddef4
commit
df49a653be
21 files changed
+106
-85
No files matched your search
@@ -1,11 +1,10 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { ServicesManager, ExtensionManager, CommandsManager, DicomMetadataStore } from '@ohif/core';
|
||||
import { MeasurementTable, Icon, ButtonGroup, Button } from '@ohif/ui';
|
||||
import { MeasurementTable } from '@ohif/ui';
|
||||
import { withTranslation, WithTranslation } from 'react-i18next';
|
||||
import { EVENTS as MicroscopyEvents } from '../../services/MicroscopyService';
|
||||
import dcmjs from 'dcmjs';
|
||||
import styles from '../../utils/styles';
|
||||
import callInputDialog from '../../utils/callInputDialog';
|
||||
import constructSR from '../../utils/constructSR';
|
||||
import { saveByteArray } from '../../utils/saveByteArray';
|
||||
@@ -286,6 +285,11 @@ function MicroscopyPanel(props: IMicroscopyPanelProps) {
|
||||
props.commandsManager.runCommand('setLabel', { uid }, 'MICROSCOPY');
|
||||
};
|
||||
|
||||
const onMeasurementDeleteHandler = ({ uid, isActive }: { uid: string; isActive: boolean }) => {
|
||||
const roiAnnotation = microscopyService.getAnnotation(uid);
|
||||
microscopyService.removeAnnotation(roiAnnotation);
|
||||
};
|
||||
|
||||
// Convert ROI annotations managed by microscopyService into our
|
||||
// own format for display
|
||||
const data = roiAnnotations.map((roiAnnotation, index) => {
|
||||
@@ -322,8 +326,6 @@ function MicroscopyPanel(props: IMicroscopyPanelProps) {
|
||||
};
|
||||
});
|
||||
|
||||
const disabled = data.length === 0;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
@@ -336,6 +338,7 @@ function MicroscopyPanel(props: IMicroscopyPanelProps) {
|
||||
data={data}
|
||||
onClick={onMeasurementItemClickHandler}
|
||||
onEdit={onMeasurementItemEditHandler}
|
||||
onDelete={onMeasurementDeleteHandler}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in new issue
Block a user