Skip to main content

CircleScissorsTool

Tool for manipulating segmentation data by drawing a circle. It acts on the active Segmentation on the viewport (enabled element) and requires an active segmentation to be already present. By default it will use the activeSegmentIndex for the segmentation to modify. You can use SegmentationModule to set the active segmentation and segmentIndex.

Hierarchy

Index

Constructors

constructor

  • Parameters

    Returns default

Properties

publicconfiguration

configuration: Record<string, any>

editData

editData: { annotation: any; centerCanvas?: number[]; handleIndex?: number; hasMoved?: boolean; movingTextBox: boolean; newAnnotation?: boolean; segmentColor: [number, number, number, number]; segmentIndex: number; segmentation: any; segmentationId: string; segmentsLocked: number[]; viewportIdsToRender: string[] }

Type declaration

  • annotation: any
  • optionalcenterCanvas?: number[]
  • optionalhandleIndex?: number
  • optionalhasMoved?: boolean
  • movingTextBox: boolean
  • optionalnewAnnotation?: boolean
  • segmentColor: [number, number, number, number]
  • segmentIndex: number
  • segmentation: any
  • segmentationId: string
  • segmentsLocked: number[]
  • viewportIdsToRender: string[]

isDrawing

isDrawing: boolean

isHandleOutsideImage

isHandleOutsideImage: boolean

publicmode

mode: ToolModes

Tool Mode - Active/Passive/Enabled/Disabled/

publicsupportedInteractionTypes

supportedInteractionTypes: Mouse[]

Supported Interaction Types - currently only Mouse

publictoolGroupId

toolGroupId: string

ToolGroup ID the tool instance belongs to

statictoolName

toolName: string = 'CircleScissor'

Methods

_activateDraw

  • _activateDraw(element: any): void
  • Add event handlers for the modify event loop, and prevent default event propagation.


    Parameters

    • element: any

    Returns void

_deactivateDraw

  • _deactivateDraw(element: any): void
  • Add event handlers for the modify event loop, and prevent default event prapogation.


    Parameters

    • element: any

    Returns void

_mouseDragCallback

  • _mouseDragCallback(evt: MouseDragEventType): void
  • Parameters

    • evt: MouseDragEventType

    Returns void

_mouseUpCallback

  • _mouseUpCallback(evt: MouseUpEventType | MouseClickEventType): void
  • Parameters

    • evt: MouseUpEventType | MouseClickEventType

    Returns void

publicapplyActiveStrategy

  • applyActiveStrategy(enabledElement: IEnabledElement, operationData: unknown): any
  • It applies the active strategy to the enabled element.


    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.

publicgetToolName

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


    Returns string

    The name of the tool.

preMouseDownCallback

  • preMouseDownCallback(evt: MouseDownActivateEventType): boolean
  • Based on the current position of the mouse and the enabledElement, it finds the active segmentation info and use it for the current tool.


    Parameters

    • evt: MouseDownActivateEventType

      EventTypes.NormalizedMouseEventType

    Returns boolean

    The annotation object.

renderAnnotation

  • it is used to draw the circleScissor annotation in each request animation frame. Note that the annotation are disappeared after the segmentation modification.


    Parameters

    • enabledElement: IEnabledElement

      The Cornerstoneā€™s enabledElement.

    • svgDrawingHelper: SVGDrawingHelper

      The svgDrawingHelper providing the context for drawing.

    Returns boolean

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