Skip to main content

VariationTool

Abstract base class from which all tools derive. Deals with cleanly merging custom and default configuration, and strategy application.

Hierarchy

Index

Constructors

constructor

Properties

publicconfiguration

configuration: Record<string, any>

editData

editData: { planeContours: any; segmentationId: string; viewport: StackViewport | default }

Type declaration

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: string

Methods

_activateDraw

  • _activateDraw(element: HTMLDivElement): void
  • Parameters

    • element: HTMLDivElement

    Returns void

_calculateCursor

  • _calculateCursor(element: any, centerCanvas?: any): void
  • Parameters

    • element: any
    • optionalcenterCanvas: any

    Returns void

_deactivateDraw

  • _deactivateDraw(element: HTMLDivElement): void
  • Parameters

    • element: HTMLDivElement

    Returns void

_dragCallback

  • _dragCallback(evt: InteractionEventType): void
  • Parameters

    • evt: InteractionEventType

    Returns void

_endCallback

  • _endCallback(evt: InteractionEventType): void
  • Parameters

    • evt: InteractionEventType

    Returns void

_triggerAnnotationRender

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.

createHoverData

  • createHoverData(element: any, centerCanvas: any): { brushCursor: { data: {}; metadata: { FrameOfReferenceUID: string; referencedImageId: string; segmentColor: Color; toolName: string; viewPlaneNormal: Point3; viewUp: Point3 } }; centerCanvas: any; segmentColor: Color; segmentIndex: number; segmentationId: string; segmentationRepresentationUID: string; viewportIdsToRender: string[] }
  • Parameters

    • element: any
    • centerCanvas: any

    Returns { brushCursor: { data: {}; metadata: { FrameOfReferenceUID: string; referencedImageId: string; segmentColor: Color; toolName: string; viewPlaneNormal: Point3; viewUp: Point3 } }; centerCanvas: any; segmentColor: Color; segmentIndex: number; segmentationId: string; segmentationRepresentationUID: string; viewportIdsToRender: string[] }

    • brushCursor: { data: {}; metadata: { FrameOfReferenceUID: string; referencedImageId: string; segmentColor: Color; toolName: string; viewPlaneNormal: Point3; viewUp: Point3 } }
      • data: {}
        • metadata: { FrameOfReferenceUID: string; referencedImageId: string; segmentColor: Color; toolName: string; viewPlaneNormal: Point3; viewUp: Point3 }
          • FrameOfReferenceUID: string
          • referencedImageId: string
          • segmentColor: Color
          • toolName: string
          • viewPlaneNormal: Point3
          • viewUp: Point3
      • centerCanvas: any
      • segmentColor: Color
      • segmentIndex: number
      • segmentationId: string
      • segmentationRepresentationUID: string
      • viewportIdsToRender: string[]

    getSegmentationId

    • getSegmentationId(): string
    • Returns string

    publicgetToolName

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


      Returns string

      The name of the tool.

    invalidateCursor

    • invalidateCursor(): void
    • Returns void

    mouseMoveCallback

    • mouseMoveCallback(evt: InteractionEventType): void
    • Parameters

      • evt: InteractionEventType

      Returns void

    onSetToolDisabled

    • onSetToolDisabled(): void
    • Returns void

    onSetToolEnabled

    • onSetToolEnabled(): void
    • Returns void

    onSetToolPassive

    • onSetToolPassive(): void
    • Returns void

    preMouseDownCallback

    • preMouseDownCallback(evt: MouseDownActivateEventType): boolean
    • Parameters

      • evt: MouseDownActivateEventType

      Returns boolean

    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

    updateCursor

    • updateCursor(evt: InteractionEventType): void
    • Parameters

      • evt: InteractionEventType

      Returns void