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;
|
||||
};
|
||||
|
||||
const getPreviewTools = ({ toolGroupService }) => {
|
||||
const labelmapTools = getLabelmapTools({ toolGroupService });
|
||||
|
||||
const previewTools = labelmapTools.filter(tool => tool.acceptPreview || tool.rejectPreview);
|
||||
|
||||
return previewTools;
|
||||
};
|
||||
|
||||
const segmentAI = new ONNXSegmentationController({
|
||||
autoSegmentMode: true,
|
||||
models: {
|
||||
@ -1709,14 +1717,15 @@ function commandsModule({
|
||||
});
|
||||
},
|
||||
_handlePreviewAction: action => {
|
||||
const labelmapTools = getLabelmapTools({ toolGroupService });
|
||||
const { viewport } = _getActiveViewportEnabledElement();
|
||||
const activeTools = labelmapTools.filter(
|
||||
tool => tool.mode === 'Active' || tool.mode === 'Enabled'
|
||||
);
|
||||
const previewTools = getPreviewTools({ toolGroupService });
|
||||
|
||||
activeTools.forEach(tool => {
|
||||
tool[`${action}Preview`]();
|
||||
previewTools.forEach(tool => {
|
||||
try {
|
||||
tool[`${action}Preview`]();
|
||||
} catch (error) {
|
||||
console.debug('Error accepting preview for tool', tool.toolName);
|
||||
}
|
||||
});
|
||||
|
||||
if (segmentAI.enabled) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user