fix(hotkeyBindings): consolidate Escape hotkey behavior for contour drawing tools (#6104)
* fix(hotkeyBindings): consolidate Escape hotkey behavior for contour drawing tools * PR feedback. * PR feedback.
This commit is contained in:
1 parent
b7c8b865dd
commit
661ecb5b2e
12 files changed
+442
-12
No files matched your search
@@ -344,6 +344,57 @@ export class RightPanelPageObject {
|
||||
select: async () => {
|
||||
await menuButton.click();
|
||||
},
|
||||
// Switches to the contour tab and creates a new Contour-type segmentation,
|
||||
// which enables the contour drawing tools (Spline / Livewire / Freehand).
|
||||
addSegmentation: async () => {
|
||||
await menuButton.click();
|
||||
await addSegmentationButton.click();
|
||||
},
|
||||
tools: {
|
||||
get splineContour() {
|
||||
const button = page.getByTestId('SplineContourSegmentationTool');
|
||||
// Maps a friendly spline name to the underlying cornerstone tool name,
|
||||
// which is also the data-cy of its option in the Spline Type dropdown.
|
||||
const splineTypeToolNames = {
|
||||
catmullRom: 'CatmullRomSplineROI',
|
||||
linear: 'LinearSplineROI',
|
||||
bSpline: 'BSplineROI',
|
||||
} as const;
|
||||
return {
|
||||
button,
|
||||
// Activates the Spline Contour tool, arming the spline variant currently
|
||||
// selected in the Spline Type dropdown. This defaults to Catmull-Rom until
|
||||
// selectType is used to switch it.
|
||||
click: async () => {
|
||||
await button.click();
|
||||
},
|
||||
// Opens the Spline Type dropdown (rendered once the tool is active) and
|
||||
// switches to the requested spline variant.
|
||||
selectType: async (type: keyof typeof splineTypeToolNames) => {
|
||||
await page.getByTestId('splineTypeSelect').getByRole('combobox').click();
|
||||
await page.getByTestId(splineTypeToolNames[type]).click();
|
||||
},
|
||||
};
|
||||
},
|
||||
get livewireContour() {
|
||||
const button = page.getByTestId('LivewireContourSegmentationTool');
|
||||
return {
|
||||
button,
|
||||
click: async () => {
|
||||
await button.click();
|
||||
},
|
||||
};
|
||||
},
|
||||
get freehandContour() {
|
||||
const button = page.getByTestId('PlanarFreehandContourSegmentationTool');
|
||||
return {
|
||||
button,
|
||||
click: async () => {
|
||||
await button.click();
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
get labelMapSegmentationPanel() {
|
||||
|
||||
Reference in new issue
Block a user