fix(markerlabelmap): accept preview/reject preview not working when the marker annotation tools are active (#5101)
Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
This commit is contained in:
parent
10ef509ff1
commit
26fd51f535
@ -65,6 +65,14 @@ const getLabelmapTools = ({ toolGroupService }) => {
|
|||||||
return labelmapTools;
|
return labelmapTools;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getPreviewTools = ({ toolGroupService }) => {
|
||||||
|
const labelmapTools = getLabelmapTools({ toolGroupService });
|
||||||
|
|
||||||
|
const previewTools = labelmapTools.filter(tool => tool.acceptPreview || tool.rejectPreview);
|
||||||
|
|
||||||
|
return previewTools;
|
||||||
|
};
|
||||||
|
|
||||||
const segmentAI = new ONNXSegmentationController({
|
const segmentAI = new ONNXSegmentationController({
|
||||||
autoSegmentMode: true,
|
autoSegmentMode: true,
|
||||||
models: {
|
models: {
|
||||||
@ -1709,14 +1717,15 @@ function commandsModule({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
_handlePreviewAction: action => {
|
_handlePreviewAction: action => {
|
||||||
const labelmapTools = getLabelmapTools({ toolGroupService });
|
|
||||||
const { viewport } = _getActiveViewportEnabledElement();
|
const { viewport } = _getActiveViewportEnabledElement();
|
||||||
const activeTools = labelmapTools.filter(
|
const previewTools = getPreviewTools({ toolGroupService });
|
||||||
tool => tool.mode === 'Active' || tool.mode === 'Enabled'
|
|
||||||
);
|
|
||||||
|
|
||||||
activeTools.forEach(tool => {
|
previewTools.forEach(tool => {
|
||||||
|
try {
|
||||||
tool[`${action}Preview`]();
|
tool[`${action}Preview`]();
|
||||||
|
} catch (error) {
|
||||||
|
console.debug('Error accepting preview for tool', tool.toolName);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (segmentAI.enabled) {
|
if (segmentAI.enabled) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user