fix(measurement and microscopy): various small fixes for measurement and microscopy side panel (#3696)

This commit is contained in:
Joe Boccanfuso authored and GitHub committed 2023-10-04 14:11:09 -04:00
1 parent 646bef1d93
commit c1d5ee7e3f
20 files changed
+77 -84

No files matched your search

@@ -1,4 +1,5 @@
import SUPPORTED_TOOLS from './constants/supportedTools';
import { getDisplayUnit } from './utils';
import getSOPInstanceAttributes from './utils/getSOPInstanceAttributes';
import { utils } from '@ohif/core';
@@ -25,11 +26,7 @@ const RectangleROI = {
throw new Error('Tool not supported');
}
const {
SOPInstanceUID,
SeriesInstanceUID,
StudyInstanceUID,
} = getSOPInstanceAttributes(
const { SOPInstanceUID, SeriesInstanceUID, StudyInstanceUID } = getSOPInstanceAttributes(
referencedImageId,
CornerstoneViewportService,
viewportId
@@ -92,11 +89,8 @@ function getMappedAnnotations(annotation, DisplaySetService) {
throw new Error('Non-acquisition plane measurement mapping not supported');
}
const {
SOPInstanceUID,
SeriesInstanceUID,
frameNumber,
} = getSOPInstanceAttributes(referencedImageId);
const { SOPInstanceUID, SeriesInstanceUID, frameNumber } =
getSOPInstanceAttributes(referencedImageId);
const displaySet = DisplaySetService.getDisplaySetForSOPInstanceUID(
SOPInstanceUID,
@@ -190,7 +184,7 @@ function getDisplayText(mappedAnnotations, displaySet) {
// Area sometimes becomes undefined if `preventHandleOutsideImage` is off.
const roundedArea = utils.roundNumber(area || 0, 2);
displayText.push(`${roundedArea} ${areaUnit}`);
displayText.push(`${roundedArea} ${getDisplayUnit(areaUnit)}`);
// Todo: we need a better UI for displaying all these information
mappedAnnotations.forEach(mappedAnnotation => {
@@ -199,7 +193,7 @@ function getDisplayText(mappedAnnotations, displaySet) {
let maxStr = '';
if (max) {
const roundedMax = utils.roundNumber(max, 2);
maxStr = `Max: ${roundedMax} <small>${unit}</small> `;
maxStr = `Max: ${roundedMax} <small>${getDisplayUnit(unit)}</small> `;
}
const str = `${maxStr}(S:${SeriesNumber}${instanceText}${frameText})`;