Skip to main content

Variable: state

const state: object

Type declaration

resetAnnotationManager()

resetAnnotationManager: () => void

Returns

void

addAnnotation()

Add the annotation to the annotation manager along with the options that is used to filter the annotation manager and the annotation group that the annotation belongs to.

As a result, our default implementation will add the annotation to the default manager using the FrameOfReferenceUID as the group key.

Parameters

annotation: Annotation

The annotation that is being added to the annotations manager.

annotationGroupSelector: AnnotationGroupSelector

element or FrameOfReferenceUID that is used to group annotations in the annotation manager.

Returns

string

addChildAnnotation()

Creates a parent/child association between annotations. A annotation may have only one parent and multiple children (eg: a contour may have multiple holes in it).

Parameters

parentAnnotation: Annotation

Parent annotation

childAnnotation: Annotation

Child annotation

Returns

void

clearParentAnnotation()

Removes the association between the annotation passed as parameter and its parent in case it has one (eg: contour holes).

Parameters

annotation: Annotation

Annotation

Returns

void

getAllAnnotations()

Returns

Annotations

getAnnotation()

Get the Annotation object by its UID

Parameters

annotationUID: string

The unique identifier of the annotation.

Returns

Annotation

getAnnotationManager()

It returns the default annotations manager.

Returns

any

the singleton default annotations manager.

getAnnotations()

Returns the annotations for a given tool with the provided options that is used to filter annotations based on the annotation manager.

In our default implementation, the options are the element and/or the FrameOfReferenceUID. Hence, the getAnnotations function will return the annotations for the given tool that are associated with the FrameOfReferenceUID.

Parameters

toolName: string

The name of the tool.

annotationGroupSelector: AnnotationGroupSelector

element or FrameOfReferenceUID that is used to group annotations in the annotation manager.

Returns

Annotations

The annotations corresponding to the Frame of Reference and the toolName.

getChildAnnotations()

Returns all children annotation of a given one since annotations can be associated in a parent/child way (eg: polyline holes)

Parameters

annotation: Annotation

Annotation

Returns

Annotation[]

Child annotations

getNumberOfAnnotations()

Get the number of annotations for a given tool with the provided options that is used to filter annotations based on the annotation manager.

In our default implementation, the options are the element and/or the FrameOfReferenceUID. Hence, the getNumberOfAnnotations function will return the number of annotations for the given tool that are associated with the FrameOfReferenceUID.

Parameters

toolName: string

The name of the tool

annotationGroupSelector: AnnotationGroupSelector

element or FrameOfReferenceUID that is used to group annotations in the annotation manager.

Returns

number

getParentAnnotation()

Returns the parent annotation of a given one since annotations can be associated in a parent/child way (eg: polyline holes)

Parameters

annotation: Annotation

Annotation

Returns

Annotation

Parent annotation

invalidateAnnotation()

Invalidate current and all parent annotations (eg: contour holes)

Parameters

annotation: Annotation

Annotation

Returns

void

removeAllAnnotations()

It removes all annotations from the default annotation manager

Returns

void

removeAnnotation()

Remove the annotation by UID of the annotation.

Parameters

annotationUID: string

The unique identifier for the annotation.

Returns

void

removeAnnotations()

Removes all annotations associated with the specified group (FrameOfReferenceUID) and tool, or all annotations for the group (FrameOfReferenceUID) if the tool name is not provided.

Parameters

toolName: string

Optional. The name of the tool to remove annotations for.

annotationGroupSelector: AnnotationGroupSelector

The group (FrameOfReferenceUID) to remove annotations for.

Returns

void

setAnnotationManager()

Set the annotation manager to be used for rendering, adding, removing, etc.

Parameters

annotationManager: IAnnotationManager

The annotation manager to be used

Returns

void

Defined in

tools/src/stateManagement/annotation/index.ts:10