Reformat in HP MPR (#5717)
* Reformat in HP MPR * fix: Orientation markers should work
This commit is contained in:
parent
6e4ef68a83
commit
760adc50d6
@ -20,6 +20,34 @@ export const HYDRATE_SEG_SYNC_GROUP = {
|
||||
},
|
||||
};
|
||||
|
||||
const viewportStructure = {
|
||||
layoutType: 'grid',
|
||||
properties: {
|
||||
rows: 1,
|
||||
columns: 3,
|
||||
layoutOptions: [
|
||||
{
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 1 / 3,
|
||||
height: 1,
|
||||
},
|
||||
{
|
||||
x: 1 / 3,
|
||||
y: 0,
|
||||
width: 1 / 3,
|
||||
height: 1,
|
||||
},
|
||||
{
|
||||
x: 2 / 3,
|
||||
y: 0,
|
||||
width: 1 / 3,
|
||||
height: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const mpr: Types.HangingProtocol.Protocol = {
|
||||
id: 'mpr',
|
||||
name: i18n.t('Hps:MPR'),
|
||||
@ -53,33 +81,7 @@ export const mpr: Types.HangingProtocol.Protocol = {
|
||||
stages: [
|
||||
{
|
||||
name: 'MPR 1x3',
|
||||
viewportStructure: {
|
||||
layoutType: 'grid',
|
||||
properties: {
|
||||
rows: 1,
|
||||
columns: 3,
|
||||
layoutOptions: [
|
||||
{
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 1 / 3,
|
||||
height: 1,
|
||||
},
|
||||
{
|
||||
x: 1 / 3,
|
||||
y: 0,
|
||||
width: 1 / 3,
|
||||
height: 1,
|
||||
},
|
||||
{
|
||||
x: 2 / 3,
|
||||
y: 0,
|
||||
width: 1 / 3,
|
||||
height: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
viewportStructure,
|
||||
viewports: [
|
||||
{
|
||||
viewportOptions: {
|
||||
@ -134,5 +136,63 @@ export const mpr: Types.HangingProtocol.Protocol = {
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
name: 'MPR Reformat 1x3',
|
||||
viewportStructure,
|
||||
viewports: [
|
||||
{
|
||||
viewportOptions: {
|
||||
viewportId: 'mpr-axial',
|
||||
toolGroupId: 'mpr',
|
||||
viewportType: 'volume',
|
||||
orientation: 'axial_reformat',
|
||||
initialImageOptions: {
|
||||
preset: 'middle',
|
||||
},
|
||||
syncGroups: [VOI_SYNC_GROUP, HYDRATE_SEG_SYNC_GROUP],
|
||||
},
|
||||
displaySets: [
|
||||
{
|
||||
id: 'activeDisplaySet',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
viewportOptions: {
|
||||
viewportId: 'mpr-sagittal',
|
||||
toolGroupId: 'mpr',
|
||||
viewportType: 'volume',
|
||||
orientation: 'sagittal_reformat',
|
||||
initialImageOptions: {
|
||||
preset: 'middle',
|
||||
},
|
||||
syncGroups: [VOI_SYNC_GROUP, HYDRATE_SEG_SYNC_GROUP],
|
||||
},
|
||||
displaySets: [
|
||||
{
|
||||
id: 'activeDisplaySet',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
viewportOptions: {
|
||||
viewportId: 'mpr-coronal',
|
||||
toolGroupId: 'mpr',
|
||||
viewportType: 'volume',
|
||||
orientation: 'coronal_reformat',
|
||||
initialImageOptions: {
|
||||
preset: 'middle',
|
||||
},
|
||||
syncGroups: [VOI_SYNC_GROUP, HYDRATE_SEG_SYNC_GROUP],
|
||||
},
|
||||
displaySets: [
|
||||
{
|
||||
id: 'activeDisplaySet',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@ -8,6 +8,9 @@ jest.mock('@cornerstonejs/core', () => ({
|
||||
SAGITTAL: 'sagittal',
|
||||
CORONAL: 'coronal',
|
||||
ACQUISITION: 'acquisition',
|
||||
AXIAL_REFORMAT: 'axial_reformat',
|
||||
SAGITTAL_REFORMAT: 'sagittal_reformat',
|
||||
CORONAL_REFORMAT: 'coronal_reformat',
|
||||
},
|
||||
},
|
||||
}));
|
||||
@ -33,6 +36,21 @@ describe('getCornerstoneOrientation', () => {
|
||||
expect(result).toBe(Enums.OrientationAxis.CORONAL);
|
||||
});
|
||||
|
||||
it('should return AXIAL_REFORMAT when orientation is axial_reformat', () => {
|
||||
const result = getCornerstoneOrientation('axial_reformat');
|
||||
expect(result).toBe(Enums.OrientationAxis.AXIAL_REFORMAT);
|
||||
});
|
||||
|
||||
it('should return SAGITTAL_REFORMAT when orientation is sagittal_reformat', () => {
|
||||
const result = getCornerstoneOrientation('sagittal_reformat');
|
||||
expect(result).toBe(Enums.OrientationAxis.SAGITTAL_REFORMAT);
|
||||
});
|
||||
|
||||
it('should return CORONAL_REFORMAT when orientation is coronal_reformat', () => {
|
||||
const result = getCornerstoneOrientation('coronal_reformat');
|
||||
expect(result).toBe(Enums.OrientationAxis.CORONAL_REFORMAT);
|
||||
});
|
||||
|
||||
it('should return ACQUISITION for unknown orientation', () => {
|
||||
const result = getCornerstoneOrientation('unknown');
|
||||
expect(result).toBe(Enums.OrientationAxis.ACQUISITION);
|
||||
|
||||
@ -3,16 +3,25 @@ import { Enums } from '@cornerstonejs/core';
|
||||
const AXIAL = 'axial';
|
||||
const SAGITTAL = 'sagittal';
|
||||
const CORONAL = 'coronal';
|
||||
const AXIAL_REFORMAT = 'axial_reformat';
|
||||
const SAGITTAL_REFORMAT = 'sagittal_reformat';
|
||||
const CORONAL_REFORMAT = 'coronal_reformat';
|
||||
|
||||
export default function getCornerstoneOrientation(orientation: string): Enums.OrientationAxis {
|
||||
if (orientation) {
|
||||
switch (orientation.toLowerCase()) {
|
||||
case AXIAL:
|
||||
return Enums.OrientationAxis.AXIAL;
|
||||
case AXIAL_REFORMAT:
|
||||
return Enums.OrientationAxis.AXIAL_REFORMAT;
|
||||
case SAGITTAL:
|
||||
return Enums.OrientationAxis.SAGITTAL;
|
||||
case SAGITTAL_REFORMAT:
|
||||
return Enums.OrientationAxis.SAGITTAL_REFORMAT;
|
||||
case CORONAL:
|
||||
return Enums.OrientationAxis.CORONAL;
|
||||
case CORONAL_REFORMAT:
|
||||
return Enums.OrientationAxis.CORONAL_REFORMAT;
|
||||
default:
|
||||
return Enums.OrientationAxis.ACQUISITION;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user