Skip to main content

publicBrushTool

Hierarchy

Index

Constructors

constructor

  • Parameters

    Returns BrushTool

Properties

publicconfiguration

configuration: Record<string, any>

publicmode

mode: ToolModes

Tool Mode - Active/Passive/Enabled/Disabled/

publicsupportedInteractionTypes

supportedInteractionTypes: InteractionTypes[]

Supported Interaction Types - currently only Mouse

publictoolGroupId

toolGroupId: string

ToolGroup ID the tool instance belongs to

statictoolName

toolName: any

Methods

publicacceptPreview

  • acceptPreview(element?: HTMLDivElement): void
  • Accepts a preview, marking it as the active segment.


    Parameters

    • element: HTMLDivElement = ...

    Returns void

publicapplyActiveStrategy

  • applyActiveStrategy(enabledElement: IEnabledElement, operationData: unknown): any
  • Applies the active strategy function to the enabled element with the specified operation data.


    Parameters

    • enabledElement: IEnabledElement

      The element that is being operated on.

    • operationData: unknown

      The data that needs to be passed to the strategy.

    Returns any

    The result of the strategy.

publicapplyActiveStrategyCallback

  • applyActiveStrategyCallback(enabledElement: IEnabledElement, operationData: unknown, callbackType: string): any
  • Applies the active strategy, with a given event type being applied. The event type function is found by indexing it on the active strategy function.


    Parameters

    • enabledElement: IEnabledElement

      The element that is being operated on.

    • operationData: unknown

      The data that needs to be passed to the strategy.

    • callbackType: string

      the type of the callback

    Returns any

    The result of the strategy.

createEditData

  • createEditData(element: any): { imageIdReferenceMap: undefined; referencedVolumeId: any; segmentationRepresentationUID: string; segmentsLocked: number[] | []; volumeId: string } | { imageIdReferenceMap: Map<string, string>; referencedVolumeId?: undefined; segmentationRepresentationUID: string; segmentsLocked: number[] | []; volumeId: undefined }
  • Parameters

    • element: any

    Returns { imageIdReferenceMap: undefined; referencedVolumeId: any; segmentationRepresentationUID: string; segmentsLocked: number[] | []; volumeId: string } | { imageIdReferenceMap: Map<string, string>; referencedVolumeId?: undefined; segmentationRepresentationUID: string; segmentsLocked: number[] | []; volumeId: undefined }

publicgetToolName

  • getToolName(): string
  • Returns the name of the tool


    Returns string

    The name of the tool.

publicinvalidateBrushCursor

  • invalidateBrushCursor(): void
  • Returns void

mouseMoveCallback

  • mouseMoveCallback(evt: InteractionEventType): void
  • This call will be made when the mouse moves and the tool is active, but not actually drawing at the moment. The behavior is:

    1. Update the cursor
    2. Call the active strategy event ‘preview’ and ‘rejectPreview’ on the mouse cursor position on a periodic basis to create a preview when configured to do so.

    The preview will be shown after the mouse has been stationary for 250 ms. Any preview will be cancelled (immediately) after moving outside the center distance. As well, if the mouse moves but stays inside the center area for 250 ms, then the cancel will happen with a new preview being added.

    See mouse up details for how the preview gets accepted.

    The preview also needs to be cancelled on changing tools.


    Parameters

    • evt: InteractionEventType

    Returns void

onSetToolDisabled

  • onSetToolDisabled(evt: any): void
  • Parameters

    • evt: any

    Returns void

onSetToolEnabled

  • onSetToolEnabled(): void
  • Returns void

onSetToolPassive

  • onSetToolPassive(evt: any): void
  • Parameters

    • evt: any

    Returns void

preMouseDownCallback

  • preMouseDownCallback(evt: MouseDownActivateEventType): boolean
  • Parameters

    • evt: MouseDownActivateEventType

    Returns boolean

previewCallback

  • previewCallback(): void
  • Returns void

publicrejectPreview

  • rejectPreview(element?: HTMLDivElement): void
  • Cancels any preview view being shown, resetting any segments being shown.


    Parameters

    • element: HTMLDivElement = ...

    Returns void

renderAnnotation

publicsetActiveStrategy

  • setActiveStrategy(strategyName: string): void
  • Sets the active strategy for a tool. Strategies are multiple implementations of tool behavior that can be switched by tool configuration.


    Parameters

    • strategyName: string

      name of the strategy to be set as active

    Returns void

publicsetConfiguration

  • setConfiguration(newConfiguration: Record<string, any>): void
  • merges the new configuration with the tool configuration


    Parameters

    • newConfiguration: Record<string, any>

    Returns void