Class GraphicAnnotation

This is the base class of all type of annotations, This is fetched from the root tag Graphic Annotation Sequence Attribute (0070,0001) Contains the referenced image which one refer this annotation, contains method to mange annotations having required informations to render them

Hierarchy

Index

Constructors

constructor

  • description

    constructs the GraphicAnnotation object;

    Parameters

    • graphicLayer: string

      graphicLayer object

    • Default value graphicObjects: Array<GraphicObject> = []

      graphic objects

    • Default value textObjects: Array<TextObject> = []

      text objects

    • Default value referencedImageSequence: Array<ReferencedImage> = []

      referenced image sequence

    • Default value graphicLayerIndex: number = -1

      graphicLayer index

    • Default value annotationColor: any = null

      annotation color

    Returns GraphicAnnotation

    Returns the newly created instance GraphicAnnotation

Properties

annotationColor

annotationColor: Color

Protected endPoints

endPoints: Array<Point> = []

Protected firstBoundsPoint

firstBoundsPoint: Point = new Fovia.Util.Point(0, 0)

Protected frameOfReference

frameOfReference: string

graphicLayer

graphicLayer: string

graphicLayerIndex

graphicLayerIndex: number = -1

graphicObjects

graphicObjects: Array<GraphicObject> = []

Protected isNew

isNew: boolean = false

Protected isObjectHighlight

isObjectHighlight: boolean = false

Protected isPointHighlight

isPointHighlight: boolean = false

Protected measurement

measurement: number = 0

Protected measurementLabel

measurementLabel: string

Protected measurementUnits

measurementUnits: string

patientOrientationColumn

patientOrientationColumn: string

patientOrientationRow

patientOrientationRow: string

pixelSpacing

pixelSpacing: Point = new Fovia.Util.Point(0.0, 0.0)

referencedImageSequence

referencedImageSequence: Array<ReferencedImage> = []

Protected secondBoundsPoint

secondBoundsPoint: Point = new Fovia.Util.Point(0, 0)

selectedObjectIndex

selectedObjectIndex: number = -1

Protected selectedPointIndex

selectedPointIndex: number = -1

showLabel

showLabel: boolean = true

textObjects

textObjects: Array<TextObject> = []

Protected volumeDataContext

volumeDataContext: VolumeDataContext = null

Methods

addGraphicData

  • addGraphicData(point: Point): void
  • description

    Add point on all graphic data

    Parameters

    • point: Point

      Point to be added

    Returns void

addReferencedImage

  • addReferencedImage(sopInstanceUID: string, frameNumber: number, isMultiFrame?: boolean): void
  • description

    Add referenced image, this annotation referred

    Parameters

    • sopInstanceUID: string

      sop instance uid of the referred image

    • frameNumber: number

      frame number of the referred image

    • Default value isMultiFrame: boolean = false

      true if it is multi frame, false on single frame

    Returns void

calculateMeasurementLabel

  • calculateMeasurementLabel(pixelSpacing: number[]): void
  • description

    Calculate the measurement label and set

    Parameters

    • pixelSpacing: number[]

      The pixelSpacing

    Returns void

clone

  • @ Clone this graphicAnnotation instance

    Returns GraphicAnnotation

    cloned graphicAnnotation

getEndPoints

  • getEndPoints(): Array<Point>
  • description

    Get end points

    Returns Array<Point>

    a end points

getFirstBoundsPoint

  • getFirstBoundsPoint(): Point
  • description

    Get first bounding point

    Returns Point

    a point

getGraphicData

  • getGraphicData(index?: number): Point
  • description

    Get graphic data at specified index from graphic object

    Parameters

    • Default value index: number = 0

      graphic data index

    Returns Point

getGraphicObject

  • description

    Get graphic object at specified index. Returns null if list is empty or index is invalid

    Parameters

    • Default value index: number = 0

      graphic object index

    Returns GraphicObject

Protected getMeasurement

  • getMeasurement(): string
  • description

    Get measurment

    Returns string

    a measurment

Private getPrecision

  • getPrecision(pixelSpacing: number[]): number
  • description

    Get precision

    Parameters

    • pixelSpacing: number[]

      The pixel spacing

    Returns number

    zero will be returned on failure case, or else precision will be returned

getSecondBoundsPoint

  • getSecondBoundsPoint(): Point
  • description

    Get second bounding point

    Returns Point

    a point

getSelectedPointIndex

  • getSelectedPointIndex(): number
  • description

    Get selected point index

    Returns number

    Returns the selected index

hasCadGraphicAnnotation

  • description

    Check whether the given sop instance uid referred and it is a cad annotation

    Parameters

    Returns boolean

    true will be returned in success case, false will be returned in failure case

isHighlighted

  • isHighlighted(): boolean
  • description

    Check if object is highlight or not

    Returns boolean

    True will be returned in success case, false will be returned in failure case

isImagePresent

  • isImagePresent(sopInstanceUID: string): boolean
  • description

    Check whether the sop instance uid already referred or not

    Parameters

    • sopInstanceUID: string

      SOP Instance Uid to be checked

    Returns boolean

    True will be returned if already exists , false will be returned if not exists

isLargerObject

  • isLargerObject(): boolean
  • description

    Check whether the annotation has large number of graphic objects

    Returns boolean

    True will be returned in success case, false will be on failure case

isLayerWithinThreaholdMeasurement

  • isLayerWithinThreaholdMeasurement(): boolean
  • description

    Check whether the layer within the threshold value or not

    Returns boolean

    True will be returned in success case, false will be returned in failure case

isPointHighlighted

  • isPointHighlighted(): boolean
  • description

    Check if point is highlight or not

    Returns boolean

    True returned if highlighted, false will be returned if not

isPointSelected

  • isPointSelected(currentPoint: Point, pointToCompare: Point): boolean
  • description

    Check whether the point is selected or not

    Parameters

    • currentPoint: Point

      current mouse point

    • pointToCompare: Point

      point to compare

    Returns boolean

    true will be returned in success case false on failure case

isValidObjectSelected

  • isValidObjectSelected(): boolean
  • description

    Check whether selected index in valid or not

    Returns boolean

    Return false if selected object index is -1. Otherwise true

resetTextObjects

  • resetTextObjects(): void
  • description

    Reset text objects to empty

    Returns void

setAnnotationColor

  • setAnnotationColor(r: number, g: number, b: number): void
  • description

    update the annotation color to be rendered

    Parameters

    • r: number

      red value to be updated

    • g: number

      green value to be updated

    • b: number

      blue value to be updated

    Returns void

setFirstBoundPoint

  • setFirstBoundPoint(point: Point): void
  • description

    Set first bounding point. This will be set when user performs mouseDown event

    Parameters

    • point: Point

      a point in dicom image.

    Returns void

setHighlight

  • setHighlight(flag: boolean): void
  • description

    Set whether the annotation is highlighted or not

    Parameters

    • flag: boolean

      True if highlighted false if not

    Returns void

setIsNewFlag

  • setIsNewFlag(flag: boolean): void
  • description

    update the flag whether it is newly added annotation or else it is loaded from dicom file

    Parameters

    • flag: boolean

      True for new one, false for loaded for dicom file

    Returns void

setMeasurement

  • setMeasurement(measurement: number): void
  • description

    Set measurement

    Parameters

    • measurement: number

      The measurement

    Returns void

setMeasurementLabel

  • setMeasurementLabel(value: string): void
  • description

    Set measurement label

    Parameters

    • value: string

      The measurement label

    Returns void

setMeasurementUnits

  • setMeasurementUnits(value: string): void
  • description

    Set measurement units

    Parameters

    • value: string

      The measurement units

    Returns void

setPointHighlight

  • setPointHighlight(flag: boolean): void
  • description

    Set the flag, that says point is highlighted or not

    Parameters

    • flag: boolean

      True for highlighted, false for not

    Returns void

setSecondBoundPoint

  • setSecondBoundPoint(point: Point): void
  • description

    Set second bounding point. It will be changing when user moves mouse or releases at some point

    Parameters

    • point: Point

      a point in dicom image.

    Returns void

setSelectedObjectIndex

  • setSelectedObjectIndex(index: number): void
  • description

    Set selected object index

    Parameters

    • index: number

      The selected object index

    Returns void

setSelectedPointIndex

  • setSelectedPointIndex(selectedIndex: number): void
  • description

    Set selected point index

    Parameters

    • selectedIndex: number

    Returns void

setShowLabelFlag

  • setShowLabelFlag(flag: boolean): void
  • description

    Update the show label flag, based on that label will render or hide later

    Parameters

    • flag: boolean

      True to render, false to hide

    Returns void

updateBoundingPoints

  • updateBoundingPoints(center: Point, endPoint: Point): void
  • description

    Calculate distance from given center and end point. Update first and second bounding points

    Parameters

    • center: Point

      center point to be updated

    • endPoint: Point

      end point to be updated

    Returns void

updateNoOfGraphicPoints

  • updateNoOfGraphicPoints(): void
  • description

    Update number Of graphicPoints

    Returns void

Protected updateTextObjects

  • updateTextObjects(anchorPoint: Point): void
  • description

    Update text objects in the annotaion

    Parameters

    Returns void