Class: BrushTool
Extends
Constructors
new BrushTool()
new BrushTool(
toolProps
,defaultToolProps
):BrushTool
Parameters
• toolProps: PublicToolProps
= {}
• defaultToolProps: SharedToolProp
= ...
Returns
Overrides
Defined in
tools/src/tools/segmentation/BrushTool.ts:108
Properties
configuration
configuration:
Record
<string
,any
>
Inherited from
Defined in
tools/src/tools/base/BaseTool.ts:17
mode
mode:
ToolModes
Tool Mode - Active/Passive/Enabled/Disabled/
Inherited from
Defined in
tools/src/tools/base/BaseTool.ts:21
supportedInteractionTypes
supportedInteractionTypes:
InteractionTypes
[]
Supported Interaction Types - currently only Mouse
Inherited from
BaseTool
.supportedInteractionTypes
Defined in
tools/src/tools/base/BaseTool.ts:15
toolGroupId
toolGroupId:
string
ToolGroup ID the tool instance belongs to
Inherited from
Defined in
tools/src/tools/base/BaseTool.ts:19
toolName
static
toolName:any
Overrides
Defined in
tools/src/tools/segmentation/BrushTool.ts:76
Methods
acceptPreview()
acceptPreview(
element
):void
Accepts a preview, marking it as the active segment.
Parameters
• element: HTMLDivElement
= ...
Returns
void
Defined in
tools/src/tools/segmentation/BrushTool.ts:701
applyActiveStrategy()
applyActiveStrategy(
enabledElement
,operationData
):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.
Inherited from
Defined in
tools/src/tools/base/BaseTool.ts:62
applyActiveStrategyCallback()
applyActiveStrategyCallback(
enabledElement
,operationData
,callbackType
):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.
Inherited from
BaseTool
.applyActiveStrategyCallback
Defined in
tools/src/tools/base/BaseTool.ts:86
createEditData()
createEditData(
element
):object
|object
|object
Parameters
• element: any
Returns
object
| object
| object
Defined in
tools/src/tools/segmentation/BrushTool.ts:184
getOperationData()
protected
getOperationData(element
?):object
|object
|object
|object
Parameters
• element?: any
Returns
object
| object
| object
| object
Defined in
tools/src/tools/segmentation/BrushTool.ts:546
getTargetId()
protected
getTargetId(viewport
):string
Get the target Id for the viewport which will be used to store the cached statistics scoped to that target in the annotations. For StackViewport, targetId is the viewportId, but for the volume viewport, the targetId will be grabbed from the volumeId if particularly specified in the tool configuration, or if not, the first actorUID in the viewport.
Parameters
• viewport: Viewport
viewport to get the targetId for
Returns
string
targetId
Inherited from
Defined in
tools/src/tools/base/BaseTool.ts:197
getTargetImageData()
protected
getTargetImageData(targetId
):IImageData
|CPUIImageData
Get the image that is displayed for the targetId in the cachedStats which can be
imageId:<imageId>
volumeId:<volumeId>
videoId:<basePathForVideo>/frames/<frameSpecifier>
Parameters
• targetId: string
annotation targetId stored in the cached stats
Returns
IImageData
| CPUIImageData
The image data for the target.
Inherited from
Defined in
tools/src/tools/base/BaseTool.ts:140
getToolName()
getToolName():
string
Returns the name of the tool
Returns
string
The name of the tool.
Inherited from
Defined in
tools/src/tools/base/BaseTool.ts:50
invalidateBrushCursor()
invalidateBrushCursor():
void
Returns
void
Defined in
tools/src/tools/segmentation/BrushTool.ts:752
mouseMoveCallback()
mouseMoveCallback(
evt
):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:
- Update the cursor
- 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
Defined in
tools/src/tools/segmentation/BrushTool.ts:372
onSetToolDisabled()
onSetToolDisabled(
evt
):void
Parameters
• evt: any
Returns
void
Defined in
tools/src/tools/segmentation/BrushTool.ts:175
onSetToolEnabled()
onSetToolEnabled():
void
Returns
void
Defined in
tools/src/tools/segmentation/BrushTool.ts:171
onSetToolPassive()
onSetToolPassive(
evt
):void
Parameters
• evt: any
Returns
void
Defined in
tools/src/tools/segmentation/BrushTool.ts:167
preMouseDownCallback()
preMouseDownCallback(
evt
):boolean
Parameters
• evt: MouseDownActivateEventType
Returns
boolean
Defined in
tools/src/tools/segmentation/BrushTool.ts:319
previewCallback()
previewCallback():
void
Returns
void
Defined in
tools/src/tools/segmentation/BrushTool.ts:411
rejectPreview()
rejectPreview(
element
):void
Cancels any preview view being shown, resetting any segments being shown.
Parameters
• element: HTMLDivElement
= ...
Returns
void
Defined in
tools/src/tools/segmentation/BrushTool.ts:684
renderAnnotation()
renderAnnotation(
enabledElement
,svgDrawingHelper
):void
Parameters
• enabledElement: IEnabledElement
• svgDrawingHelper: SVGDrawingHelper
Returns
void
Defined in
tools/src/tools/segmentation/BrushTool.ts:767
setActiveStrategy()
setActiveStrategy(
strategyName
):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
Inherited from
Defined in
tools/src/tools/base/BaseTool.ts:126
setConfiguration()
setConfiguration(
newConfiguration
):void
merges the new configuration with the tool configuration
Parameters
• newConfiguration: Record
<string
, any
>
Returns
void
Inherited from
Defined in
tools/src/tools/base/BaseTool.ts:112
updateCursor()
protected
updateCursor(evt
):void
Updates the cursor position and whether it is showing or not. Can be over-ridden to add more cursor details or a preview.
Parameters
• evt: InteractionEventType
Returns
void