feat(segmentation): Enhance Segmentation with New AI and Once Click Tools (#4910)
This commit is contained in:
1 parent
908482d2e0
commit
c75a3f3af5
29 files changed
+846
-556
No files matched your search
@@ -42,14 +42,14 @@ export function ToolBoxButtonGroupWrapper({ groupId, buttonSection, ...props })
|
||||
);
|
||||
}
|
||||
|
||||
export function ToolBoxButtonWrapper({ onInteraction, options, ...props }) {
|
||||
export function ToolBoxButtonWrapper({ onInteraction, className, options, ...props }) {
|
||||
return (
|
||||
<div className="bg-popover flex flex-row rounded-md px-0 py-0">
|
||||
<ToolButton
|
||||
{...props}
|
||||
id={props.id}
|
||||
size="small"
|
||||
className={classNames(props.disabled && 'text-foreground/70')}
|
||||
className={classNames(props.disabled && 'text-foreground/70', className)}
|
||||
onInteraction={event => {
|
||||
onInteraction?.({
|
||||
event,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useState, useCallback } from 'react';
|
||||
import React, { useEffect, useState, useCallback, useRef } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { InvestigationalUseDialog } from '@ohif/ui';
|
||||
@@ -55,6 +55,18 @@ function ViewerLayout({
|
||||
setRightPanelClosed
|
||||
);
|
||||
|
||||
const leftPanelRef = useRef<HTMLDivElement>(null);
|
||||
const rightPanelRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const handleMouseEnter = () => {
|
||||
if (
|
||||
leftPanelRef.current?.contains(document.activeElement) ||
|
||||
rightPanelRef.current?.contains(document.activeElement)
|
||||
) {
|
||||
(document.activeElement as HTMLElement)?.blur();
|
||||
}
|
||||
};
|
||||
|
||||
const LoadingIndicatorProgress = customizationService.getCustomization(
|
||||
'ui.loadingIndicatorProgress'
|
||||
);
|
||||
@@ -150,16 +162,17 @@ function ViewerLayout({
|
||||
{showLoadingIndicator && <LoadingIndicatorProgress className="h-full w-full bg-black" />}
|
||||
<ResizablePanelGroup {...resizablePanelGroupProps}>
|
||||
{/* LEFT SIDEPANELS */}
|
||||
|
||||
{hasLeftPanels ? (
|
||||
<>
|
||||
<ResizablePanel {...resizableLeftPanelProps}>
|
||||
<SidePanelWithServices
|
||||
side="left"
|
||||
isExpanded={!leftPanelClosedState}
|
||||
servicesManager={servicesManager}
|
||||
{...leftPanelProps}
|
||||
/>
|
||||
<div ref={leftPanelRef}>
|
||||
<SidePanelWithServices
|
||||
side="left"
|
||||
isExpanded={!leftPanelClosedState}
|
||||
servicesManager={servicesManager}
|
||||
{...leftPanelProps}
|
||||
/>
|
||||
</div>
|
||||
</ResizablePanel>
|
||||
<ResizableHandle
|
||||
onDragging={onHandleDragging}
|
||||
@@ -171,7 +184,10 @@ function ViewerLayout({
|
||||
{/* TOOLBAR + GRID */}
|
||||
<ResizablePanel {...resizableViewportGridPanelProps}>
|
||||
<div className="flex h-full flex-1 flex-col">
|
||||
<div className="relative flex h-full flex-1 items-center justify-center overflow-hidden bg-black">
|
||||
<div
|
||||
className="relative flex h-full flex-1 items-center justify-center overflow-hidden bg-black"
|
||||
onMouseEnter={handleMouseEnter}
|
||||
>
|
||||
<ViewportGridComp
|
||||
servicesManager={servicesManager}
|
||||
viewportComponents={viewportComponents}
|
||||
@@ -188,12 +204,14 @@ function ViewerLayout({
|
||||
className={resizableHandleClassName}
|
||||
/>
|
||||
<ResizablePanel {...resizableRightPanelProps}>
|
||||
<SidePanelWithServices
|
||||
side="right"
|
||||
isExpanded={!rightPanelClosedState}
|
||||
servicesManager={servicesManager}
|
||||
{...rightPanelProps}
|
||||
/>
|
||||
<div ref={rightPanelRef}>
|
||||
<SidePanelWithServices
|
||||
side="right"
|
||||
isExpanded={!rightPanelClosedState}
|
||||
servicesManager={servicesManager}
|
||||
{...rightPanelProps}
|
||||
/>
|
||||
</div>
|
||||
</ResizablePanel>
|
||||
</>
|
||||
) : null}
|
||||
|
||||
@@ -95,7 +95,7 @@ export function Toolbox({ buttonSectionId, title }: { buttonSectionId: string; t
|
||||
)}
|
||||
</PanelSection.Header>
|
||||
|
||||
<PanelSection.Content className="flex-shrink-0 border-none">
|
||||
<PanelSection.Content className="bg-muted flex-shrink-0 border-none">
|
||||
{showConfig && <CustomConfigComponent />}
|
||||
{toolboxSections.map(section => {
|
||||
const sectionId = section.componentProps.buttonSection;
|
||||
@@ -131,7 +131,7 @@ export function Toolbox({ buttonSectionId, title }: { buttonSectionId: string; t
|
||||
);
|
||||
})}
|
||||
{activeToolOptions && (
|
||||
<div className="bg-primary-dark h-auto px-2">
|
||||
<div className="bg-primary-dark mt-1 h-auto px-2">
|
||||
<ToolSettings options={activeToolOptions} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user