fix: Cobb angle not working in basic-test mode and open contour (#4280)

This commit is contained in:
Bill Wallace 2024-07-05 12:43:18 -04:00 committed by GitHub
parent a2084f319b
commit 6fd3c7e293
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 998 additions and 799 deletions

View File

@ -46,9 +46,9 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/adapters": "^1.78.1",
"@cornerstonejs/core": "^1.78.1",
"@kitware/vtk.js": "*",
"@cornerstonejs/adapters": "^1.81.6",
"@cornerstonejs/core": "^1.81.6",
"@kitware/vtk.js": "30.4.1",
"react-color": "^2.19.3"
}
}

View File

@ -46,9 +46,9 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/adapters": "^1.78.1",
"@cornerstonejs/core": "^1.78.1",
"@cornerstonejs/tools": "^1.78.1",
"@cornerstonejs/adapters": "^1.81.6",
"@cornerstonejs/core": "^1.81.6",
"@cornerstonejs/tools": "^1.81.6",
"classnames": "^2.3.2"
}
}

View File

@ -42,9 +42,9 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/core": "^1.78.1",
"@cornerstonejs/streaming-image-volume-loader": "^1.78.1",
"@cornerstonejs/tools": "^1.78.1",
"@cornerstonejs/core": "^1.81.6",
"@cornerstonejs/streaming-image-volume-loader": "^1.81.6",
"@cornerstonejs/tools": "^1.81.6",
"classnames": "^2.3.2"
}
}

View File

@ -38,7 +38,7 @@
"@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2",
"@cornerstonejs/codec-openjpeg": "^1.2.2",
"@cornerstonejs/codec-openjph": "^2.4.2",
"@cornerstonejs/dicom-image-loader": "^1.78.1",
"@cornerstonejs/dicom-image-loader": "^1.81.6",
"@icr/polyseg-wasm": "^0.4.0",
"@ohif/core": "3.9.0-beta.58",
"@ohif/ui": "3.9.0-beta.58",
@ -55,12 +55,12 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/adapters": "^1.78.1",
"@cornerstonejs/core": "^1.78.1",
"@cornerstonejs/streaming-image-volume-loader": "^1.78.1",
"@cornerstonejs/tools": "^1.78.1",
"@cornerstonejs/adapters": "^1.81.6",
"@cornerstonejs/core": "^1.81.6",
"@cornerstonejs/streaming-image-volume-loader": "^1.81.6",
"@cornerstonejs/tools": "^1.81.6",
"@icr/polyseg-wasm": "^0.4.0",
"@kitware/vtk.js": "*",
"@kitware/vtk.js": "30.4.1",
"html2canvas": "^1.4.1",
"lodash.debounce": "^4.0.8",
"lodash.merge": "^4.6.2",

View File

@ -146,6 +146,13 @@ function getCustomizationModule() {
],
},
PlanarFreehandROI: {
displayTextOpen: [
{
displayName: 'Length',
value: 'length',
type: 'value',
},
],
displayText: [
{
displayName: 'Mean',

View File

@ -1,6 +1,5 @@
import SUPPORTED_TOOLS from './constants/supportedTools';
import getSOPInstanceAttributes from './utils/getSOPInstanceAttributes';
import { getDisplayUnit } from './utils';
import { utils } from '@ohif/core';
/**
@ -125,10 +124,13 @@ function getColumnValueReport(annotation, customizationService) {
*/
function getDisplayText(annotation, displaySet, customizationService, displaySetService) {
const { PlanarFreehandROI } = customizationService.get('cornerstone.measurements');
const { displayText } = PlanarFreehandROI;
const { displayText: displayTextClosed, displayTextOpen } = PlanarFreehandROI;
const { metadata, data } = annotation;
const isClosed = data.contour?.closed;
const displayText = isClosed ? displayTextClosed : displayTextOpen;
const { SOPInstanceUID, frameNumber } = getSOPInstanceAttributes(
metadata.referencedImageId,
displaySetService,
@ -168,7 +170,7 @@ function getDisplayText(annotation, displaySet, customizationService, displaySet
return utils.roundNumber(value, 2);
});
}
return isNaN(values) ? values : utils.roundNumber(values, 2);
return isNaN(values) ? [values] : [utils.roundNumber(values, 2)];
};
const findUnitForValue = (displayTextItems, value) =>
@ -176,7 +178,7 @@ function getDisplayText(annotation, displaySet, customizationService, displaySet
?.value;
const formatDisplayText = (displayName, result, unit) =>
`${displayName}: ${Array.isArray(result) ? roundValues(result).join(', ') : roundValues(result)} ${unit}`;
`${displayName}: ${roundValues(result).join(', ')} ${unit}`;
displayText.forEach(({ displayName, value, type }) => {
if (type === 'value') {

View File

@ -32,8 +32,8 @@
"start": "yarn run dev"
},
"peerDependencies": {
"@cornerstonejs/core": "^1.78.1",
"@cornerstonejs/tools": "^1.78.1",
"@cornerstonejs/core": "^1.81.6",
"@cornerstonejs/tools": "^1.81.6",
"@ohif/core": "3.9.0-beta.58",
"@ohif/extension-cornerstone-dicom-sr": "3.9.0-beta.58",
"@ohif/ui": "3.9.0-beta.58",

View File

@ -60,6 +60,7 @@ function initDefaultToolGroup(extensionManager, toolGroupService, commandsManage
{ toolName: toolNames.RectangleROI },
{ toolName: toolNames.StackScroll },
{ toolName: toolNames.Angle },
{ toolName: toolNames.CobbAngle },
{ toolName: toolNames.Magnify },
{ toolName: toolNames.SegmentationDisplay },
{ toolName: toolNames.WindowLevelRegion },

View File

@ -12,7 +12,7 @@ describe('OHIF MPR', () => {
it('should go MPR for reconstructible displaySets and come back', () => {
cy.wait(250);
cy.get(':nth-child(3) > [data-cy="study-browser-thumbnail"]').dblclick();
cy.get('[data-cy="study-browser-thumbnail"][data-series="4"]').dblclick();
cy.wait(250);
cy.get('[data-cy="MPR"]').click();
@ -27,7 +27,7 @@ describe('OHIF MPR', () => {
it('should render correctly the MPR', () => {
cy.wait(250);
cy.get(':nth-child(3) > [data-cy="study-browser-thumbnail"]').dblclick();
cy.get('[data-cy="study-browser-thumbnail"][data-series="4"]').dblclick();
cy.wait(250);
cy.get('[data-cy="MPR"]').click();
@ -61,7 +61,7 @@ describe('OHIF MPR', () => {
});
it('should correctly render Crosshairs for MPR', () => {
cy.get(':nth-child(3) > [data-cy="study-browser-thumbnail"]').dblclick();
cy.get('[data-cy="study-browser-thumbnail"][data-series="4"]').dblclick();
cy.get('[data-cy="MPR"]').click();
cy.get('[data-cy="Crosshairs"]').click();
@ -93,7 +93,7 @@ describe('OHIF MPR', () => {
});
it('should activate window level when the active Crosshairs tool for MPR is clicked', () => {
cy.get(':nth-child(3) > [data-cy="study-browser-thumbnail"]').dblclick();
cy.get('[data-cy="study-browser-thumbnail"][data-series="4"]').dblclick();
cy.get('[data-cy="MPR"]').click();
cy.get('[data-cy="Crosshairs"]').click();

View File

@ -37,7 +37,7 @@
"@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2",
"@cornerstonejs/codec-openjpeg": "^1.2.3",
"@cornerstonejs/codec-openjph": "^2.4.5",
"@cornerstonejs/dicom-image-loader": "^1.78.1",
"@cornerstonejs/dicom-image-loader": "^1.81.6",
"@ohif/ui": "3.9.0-beta.58",
"cornerstone-math": "0.1.9",
"dicom-parser": "^1.8.21"

View File

@ -57,6 +57,7 @@ const Thumbnail = ({
)}
id={`thumbnail-${displaySetInstanceUID}`}
data-cy={`study-browser-thumbnail`}
data-series={seriesNumber}
onClick={onClick}
onDoubleClick={onDoubleClick}
onTouchEnd={handleTouchEnd}
@ -95,10 +96,8 @@ const Thumbnail = ({
/>
{` ${numInstances}`}
</div>
<div className="flex mr-2 last:mr-0">
{loadingProgress && loadingProgress < 1 && (
<>{Math.round(loadingProgress * 100)}%</>
)}
<div className="mr-2 flex last:mr-0">
{loadingProgress && loadingProgress < 1 && <>{Math.round(loadingProgress * 100)}%</>}
{loadingProgress && loadingProgress === 1 && (
<Icon
name={'database'}

1728
yarn.lock

File diff suppressed because it is too large Load Diff