DWVv0.37.0

Annotation

Source: annotation.js:21

Image annotation.


Constructor

new Annotation(): Annotation

Constructor: set default annotation id and uid.


Instance Methods

getMetaConceptIds(): Array.<string>

Get the concepts ids of the annotation meta data.

Returns

  • Array.<string> — The ids.

getMetaItem(conceptId: string): object | undefined

Get an annotation meta data.

Parameters

  • conceptId (string) — The value of the concept dicom code.

Returns

  • object | undefined — The corresponding meta data item as {concept, value} or undefined.

addMetaItem(concept: DicomCode, value: DicomCode | string)

Add annotation meta data.

Parameters

  • concept (DicomCode) — The concept code.
  • value (DicomCode | string) — The value code.

removeMetaItem(conceptId: string)

Remove an annotation meta data.

Parameters

  • conceptId (string) — The value of the concept dicom code.

getOrientationName(): string | undefined

Get the orientation name for this annotation.

Returns

  • string | undefined — The orientation name, undefined if same as reference data.

init(viewController: ViewController)

Initialise the annotation.

Parameters

canView(): boolean

Check if the annotation can be displayed: true if it has an associated view controller.

Returns

  • boolean — True if the annotation can be displayed.

isCompatibleView(planeHelper: PlaneHelper): boolean

Check if an input view is compatible with the annotation.

Parameters

  • planeHelper (PlaneHelper) — The input view to check.

Returns

  • boolean — True if compatible view.

setViewController(viewController: ViewController)

Set the associated view controller if it is compatible.

Parameters

getCentroid(): Point | undefined

Get the centroid of the math shape.

Returns

  • Point | undefined — The 3D centroid point.

contains(point: Point2D, tolerance?: number): boolean

Check if a plane point is on the annotation math shape, within a tolerance.

Parameters

  • point (Point2D) — The plane point to check.
  • tolerance (number, optional, default: 0) — Optional maximum distance to the shape, defaults to 0.

Returns

  • boolean — True if the point is on the shape.

setTextExpr(labelText: Record.<string, string>)

Set the annotation text expression.

Parameters

  • labelText (Record.<string, string>) — The list of label texts indexed by modality.

getText(): string

Get the annotation label text by applying the text expression on the current quantification.

Returns

  • string — The resulting text.

updateQuantification()

Update the annotation quantification.

getFactory(): object | undefined

Get the math shape associated draw factory.

Returns

  • object | undefined — The factory.

Instance Fields

trackingId: string

Tracking id, unique within domain.

trackingUid: string

Tracking Unique id.

referencedSopInstanceUID: string

Referenced image SOP instance UID.

referencedSopClassUID: string

Referenced image SOP class UID.

referencedFrameNumber: number | undefined

Referenced frame number, 1-based as the DICOM Referenced Frame Number: frame number 1 is the first frame (time index 0).

mathShape: object

Mathematical shape.

referencePoints: Array.<Point2D> | undefined

Additional points used to define the annotation.

colour: string

Colour: for example 'green', '#00ff00' or 'rgb(0,255,0)'.

quantification: Record.<string, NumberValue> | undefined

Annotation quantification.

textExpr: string

Text expression. Can contain variables surrounded with '{}' that will be extracted from the quantification object.

labelPosition: Point2D | undefined

Label position. If undefined, the default shape label position will be used.

planeOrigin: Point3D | undefined

Plane origin: 3D position of index [0, 0, k].

planePoints: Array.<Point3D> | undefined

A couple of points that help define the annotation plane.