fix(segmentation): failing to render SEG because it was on default tool group (#3222)

* fix: Segmentation service fixes for secondary volumes

* Remove toolgroupID in promptSeg
This commit is contained in:
Bill Wallace authored and GitHub committed 2023-03-10 13:57:23 -05:00
1 parent 3f20b41c17
commit b7fff77e17
18 files changed
+97 -117

No files matched your search

@@ -234,19 +234,16 @@ export default class CustomizationService extends PubSubService {
}
/**
* A single reference is either an an array, or a single customization value,
* whose id is the id in the object, or the parent id.
* This allows for general use to register customizationModule entries.
* A single reference is either an string to be loaded from a module,
* or a customization itself.
*/
addReference(
value?: Obj | Obj[] | string,
isGlobal = true,
id?: string
): void {
addReference(value?: Obj | string, isGlobal = true, id?: string): void {
if (!value) return;
if (typeof value === 'string') {
const extensionValue = this.findExtensionValue(value);
this.addReferences(extensionValue);
// The child of a reference is only a set of references when an array,
// so call the addReference direct. It could be a secondary reference perhaps
this.addReference(extensionValue);
} else if (Array.isArray(value)) {
this.addReferences(value, isGlobal);
} else {
@@ -258,10 +255,10 @@ export default class CustomizationService extends PubSubService {
}
}
/** References are:
* list of customizations, added in order
* object containing a customization id and value
* This format allows for the original whitelist format.
/**
* Customizations can be specified as an array of strings or customizations,
* or as an object whose key is the reference id, and the value is the string
* or customization.
*/
addReferences(references?: Obj | Obj[], isGlobal = true): void {
if (!references) return;
@@ -7,7 +7,7 @@
* @property {boolean} [viewportIndex=false] Modal is dismissible via the esc key.
*/
const name = 'UIViewportDialogService';
const name = 'uiViewportDialogService';
const publicAPI = {
name,
@@ -77,6 +77,7 @@ function setServiceImplementation({
export default {
REGISTRATION: {
name,
altName: 'UIViewportDialogService',
create: ({ configuration = {} }) => {
return publicAPI;
},
+1
View File
@@ -23,6 +23,7 @@ export default interface Services {
toolGroupService?: Record<string, unknown>;
uiNotificationService?: Record<string, unknown>;
uiModalService?: Record<string, unknown>;
uiViewportDialogService?: Record<string, unknown>;
viewportGridService?: ViewportGridService;
syncGroupService?: Record<string, unknown>;
cornerstoneCacheService?: Record<string, unknown>;
@@ -82,30 +82,29 @@ const SegmentationGroupTable = ({
activeSegmentIndex,
} = segmentation;
return (
<SegmentationGroup
id={id}
label={label}
isMinimized={isMinimized[id]}
segments={segments}
showAddSegment={showAddSegment}
segmentCount={segmentCount}
isActive={isActive}
isVisible={isVisible}
onSegmentColorClick={onSegmentColorClick}
onSegmentationClick={() => onSegmentationClick(id)}
activeSegmentIndex={activeSegmentIndex}
onToggleMinimizeSegmentation={onToggleMinimizeSegmentation}
onSegmentationEdit={onSegmentationEdit}
onSegmentationDelete={onSegmentationDelete}
onSegmentClick={onSegmentClick}
onSegmentEdit={onSegmentEdit}
onToggleSegmentVisibility={onToggleSegmentVisibility}
onToggleSegmentationVisibility={
onToggleSegmentationVisibility
}
onSegmentAdd={onSegmentAdd}
showSegmentDelete={false}
/>
<SegmentationGroup
id={id}
key={id}
label={label}
isMinimized={isMinimized[id]}
segments={segments}
showAddSegment={showAddSegment}
segmentCount={segmentCount}
isActive={isActive}
isVisible={isVisible}
onSegmentColorClick={onSegmentColorClick}
onSegmentationClick={() => onSegmentationClick(id)}
activeSegmentIndex={activeSegmentIndex}
onToggleMinimizeSegmentation={onToggleMinimizeSegmentation}
onSegmentationEdit={onSegmentationEdit}
onSegmentationDelete={onSegmentationDelete}
onSegmentClick={onSegmentClick}
onSegmentEdit={onSegmentEdit}
onToggleSegmentVisibility={onToggleSegmentVisibility}
onToggleSegmentationVisibility={onToggleSegmentationVisibility}
onSegmentAdd={onSegmentAdd}
showSegmentDelete={false}
/>
);
})}
</div>
+1 -1
View File
@@ -35,7 +35,7 @@ const setHeaders = (res, path) => {
}
if (path.indexOf('.pdf') !== -1) {
res.setHeader('Content-Type', 'application/pdf');
} else if (path.indexOf('/frames') !== -1) {
} else if (path.indexOf('frames') !== -1) {
res.setHeader('Content-Type', 'multipart/related');
} else {
res.setHeader('Content-Type', 'application/json');
@@ -85,8 +85,13 @@ describe('OHIF Cornerstone Toolbar', () => {
.trigger('mousemove', 'right', { buttons: 1, force: true })
.trigger('mouseup', { buttons: 1 });
const expectedText = 'W:1930L:479';
cy.get('@viewportInfoTopLeft').should('have.text', expectedText);
// The exact text is slightly dependent on the viewport resolution, so leave a range
cy.get('@viewportInfoTopLeft').should($txt => {
const text = $txt.text();
expect(text)
.to.include('W:193')
.include('L:479');
});
});
it('checks if Pan tool will move the image inside the viewport', () => {
@@ -14,8 +14,9 @@ describe('OHIF MPR', () => {
});
it('should go MPR for reconstructible displaySets and come back', () => {
cy.wait(1000);
cy.wait(250);
cy.get(':nth-child(3) > [data-cy="study-browser-thumbnail"]').dblclick();
cy.wait(250);
cy.get('[data-cy="MPR"]').click();
@@ -94,7 +95,7 @@ describe('OHIF MPR', () => {
});
it('should correctly render Crosshairs for MPR', () => {
cy.wait(1000);
cy.wait(250);
cy.get('[data-cy="Crosshairs"]').click();
cy.window()
@@ -111,7 +112,7 @@ describe('OHIF MPR', () => {
cy.get('[data-cy="MPR"]').click();
cy.get('[data-cy="Crosshairs"]').click();
cy.wait(1000);
cy.wait(250);
// check cornerstone to see if each has crosshairs
// we can later do visual testing to match the images with a baseline
+1
View File
@@ -5,6 +5,7 @@ window.config = {
showStudyList: true,
// below flag is for performance reasons, but it might not work for all servers
omitQuotationForMultipartRequest: true,
maxNumberOfWebWorkers: 3,
showWarningMessageForCrossOrigin: false,
showCPUFallbackMessage: false,
// filterQueryParam: false,
+1 -1
View File
@@ -9,7 +9,7 @@ window.config = {
},
],
extensions: [],
modes: [],
modes: ['@ohif/mode-test'],
showStudyList: true,
maxNumberOfWebWorkers: 4,
// below flag is for performance reasons, but it might not work for all servers