fix(image-orientation): Prevent incorrect orientation marker display for single-slice US images (#4275)
This commit is contained in:
parent
6fd3c7e293
commit
6d11048ca5
@ -64,7 +64,7 @@ function ViewportOrientationMarkers({
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
let rowCosines, columnCosines;
|
let rowCosines, columnCosines, isDefaultValueSetForRowCosine, isDefaultValueSetForColumnCosine;
|
||||||
if (viewportData.viewportType === 'stack') {
|
if (viewportData.viewportType === 'stack') {
|
||||||
const imageIndex = imageSliceData.imageIndex;
|
const imageIndex = imageSliceData.imageIndex;
|
||||||
const imageId = viewportData.data[0].imageIds?.[imageIndex];
|
const imageId = viewportData.data[0].imageIds?.[imageIndex];
|
||||||
@ -74,7 +74,7 @@ function ViewportOrientationMarkers({
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
({ rowCosines, columnCosines } = metaData.get('imagePlaneModule', imageId) || {});
|
({ rowCosines, columnCosines, isDefaultValueSetForColumnCosine, isDefaultValueSetForColumnCosine } = metaData.get('imagePlaneModule', imageId) || {});
|
||||||
} else {
|
} else {
|
||||||
if (!element || !getEnabledElement(element)) {
|
if (!element || !getEnabledElement(element)) {
|
||||||
return '';
|
return '';
|
||||||
@ -90,7 +90,7 @@ function ViewportOrientationMarkers({
|
|||||||
rowCosines = viewRight;
|
rowCosines = viewRight;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rowCosines || !columnCosines || rotation === undefined) {
|
if (!rowCosines || !columnCosines || rotation === undefined || isDefaultValueSetForRowCosine || isDefaultValueSetForColumnCosine) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,9 @@ describe('CS3D Image Consistency and Quality', () => {
|
|||||||
`&seriesInstanceUID=${seriesUID}&hangingProtocolId=@ohif/hpScale`
|
`&seriesInstanceUID=${seriesUID}&hangingProtocolId=@ohif/hpScale`
|
||||||
);
|
);
|
||||||
cy.initCornerstoneToolsAliases();
|
cy.initCornerstoneToolsAliases();
|
||||||
cy.initCommonElementsAliases();
|
|
||||||
|
const skipMarkers = true;
|
||||||
|
cy.initCommonElementsAliases(skipMarkers);
|
||||||
};
|
};
|
||||||
|
|
||||||
it('TG18 Resolution Test Displayed 1:1', () => {
|
it('TG18 Resolution Test Displayed 1:1', () => {
|
||||||
@ -53,6 +55,8 @@ describe('CS3D Image Consistency and Quality', () => {
|
|||||||
'2.16.124.113543.6004.101.103.20021117.061159.1',
|
'2.16.124.113543.6004.101.103.20021117.061159.1',
|
||||||
'2.16.124.113543.6004.101.103.20021117.061159.1.004'
|
'2.16.124.113543.6004.101.103.20021117.061159.1.004'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
cy.wait(2000);
|
||||||
testPixel(1018, 1028, 255);
|
testPixel(1018, 1028, 255);
|
||||||
// Horizontal and vertical delta from this should not be contaminated
|
// Horizontal and vertical delta from this should not be contaminated
|
||||||
// by values from center
|
// by values from center
|
||||||
@ -66,6 +70,8 @@ describe('CS3D Image Consistency and Quality', () => {
|
|||||||
it.skip('8 bit image displayable', () => {
|
it.skip('8 bit image displayable', () => {
|
||||||
setupStudySeries('1.3.46.670589.17.1.7.1.1.7', '1.3.46.670589.17.1.7.2.1.7');
|
setupStudySeries('1.3.46.670589.17.1.7.1.1.7', '1.3.46.670589.17.1.7.2.1.7');
|
||||||
|
|
||||||
|
cy.wait(1000);
|
||||||
|
|
||||||
// Compare with dcm2jpg generated values or by manually computing WL values
|
// Compare with dcm2jpg generated values or by manually computing WL values
|
||||||
testPixel(258, 257, 171);
|
testPixel(258, 257, 171);
|
||||||
testPixel(259, 257, 166);
|
testPixel(259, 257, 166);
|
||||||
@ -77,6 +83,8 @@ describe('CS3D Image Consistency and Quality', () => {
|
|||||||
'1.3.6.1.4.1.25403.345050719074.3824.20170125113608.5'
|
'1.3.6.1.4.1.25403.345050719074.3824.20170125113608.5'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
cy.wait(1000);
|
||||||
|
|
||||||
// Compare with dcm2jpg generated values or by manually computing WL values
|
// Compare with dcm2jpg generated values or by manually computing WL values
|
||||||
testPixel(258, 277, 120);
|
testPixel(258, 277, 120);
|
||||||
testPixel(259, 277, 122);
|
testPixel(259, 277, 122);
|
||||||
|
|||||||
@ -15,7 +15,7 @@ export function initCornerstoneToolsAliases() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Creating aliases for Common page elements
|
//Creating aliases for Common page elements
|
||||||
export function initCommonElementsAliases() {
|
export function initCommonElementsAliases(skipMarkers) {
|
||||||
cy.get('[data-cy="trackedMeasurements-btn"]').as('measurementsBtn');
|
cy.get('[data-cy="trackedMeasurements-btn"]').as('measurementsBtn');
|
||||||
cy.get('.cornerstone-viewport-element').as('viewport');
|
cy.get('.cornerstone-viewport-element').as('viewport');
|
||||||
cy.get('[data-cy="seriesList-btn"]').as('seriesBtn');
|
cy.get('[data-cy="seriesList-btn"]').as('seriesBtn');
|
||||||
@ -33,8 +33,17 @@ export function initCommonElementsAliases() {
|
|||||||
cy.get('[data-cy="viewport-overlay-bottom-right"]').as('viewportInfoBottomRight');
|
cy.get('[data-cy="viewport-overlay-bottom-right"]').as('viewportInfoBottomRight');
|
||||||
cy.get('[data-cy="viewport-overlay-bottom-left"]').as('viewportInfoBottomLeft');
|
cy.get('[data-cy="viewport-overlay-bottom-left"]').as('viewportInfoBottomLeft');
|
||||||
|
|
||||||
cy.get('.left-mid.orientation-marker').as('viewportInfoMidLeft');
|
console.debug('🚀 ~ skipMarkers:', skipMarkers);
|
||||||
cy.get('.top-mid.orientation-marker').as('viewportInfoMidTop');
|
if (skipMarkers) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
cy.get('.left-mid.orientation-marker')?.as('viewportInfoMidLeft');
|
||||||
|
cy.get('.top-mid.orientation-marker')?.as('viewportInfoMidTop');
|
||||||
|
} catch (error) {
|
||||||
|
console.log('Error: ', error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Creating aliases for Routes
|
//Creating aliases for Routes
|
||||||
|
|||||||
@ -232,8 +232,8 @@ Cypress.Commands.add('initCornerstoneToolsAliases', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//Initialize aliases for Common page elements
|
//Initialize aliases for Common page elements
|
||||||
Cypress.Commands.add('initCommonElementsAliases', () => {
|
Cypress.Commands.add('initCommonElementsAliases', skipMarkers => {
|
||||||
initCommonElementsAliases();
|
initCommonElementsAliases(skipMarkers);
|
||||||
});
|
});
|
||||||
|
|
||||||
//Initialize aliases for Routes
|
//Initialize aliases for Routes
|
||||||
|
|||||||
@ -561,7 +561,9 @@ const WADO_IMAGE_LOADER = {
|
|||||||
columns: toNumber(instance.Columns),
|
columns: toNumber(instance.Columns),
|
||||||
imageOrientationPatient: toNumber(ImageOrientationPatient),
|
imageOrientationPatient: toNumber(ImageOrientationPatient),
|
||||||
rowCosines: toNumber(rowCosines || [0, 1, 0]),
|
rowCosines: toNumber(rowCosines || [0, 1, 0]),
|
||||||
|
isDefaultValueSetForRowCosine: toNumber(rowCosines) ? false : true,
|
||||||
columnCosines: toNumber(columnCosines || [0, 0, -1]),
|
columnCosines: toNumber(columnCosines || [0, 0, -1]),
|
||||||
|
isDefaultValueSetForColumnCosine: toNumber(columnCosines) ? false : true,
|
||||||
imagePositionPatient: toNumber(instance.ImagePositionPatient || [0, 0, 0]),
|
imagePositionPatient: toNumber(instance.ImagePositionPatient || [0, 0, 0]),
|
||||||
sliceThickness: toNumber(instance.SliceThickness),
|
sliceThickness: toNumber(instance.SliceThickness),
|
||||||
sliceLocation: toNumber(instance.SliceLocation),
|
sliceLocation: toNumber(instance.SliceLocation),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user