Class GraphicAnnotationContext

description

This class holds a map in that graphic annotation added with their referenced sop instance uid contains method to handle them

Hierarchy

  • GraphicAnnotationContext

Index

Constructors

constructor

Properties

isModified

isModified: boolean = false

Private sharedAnnotationMap

sharedAnnotationMap: Map<string, SharedAnnotationContext> = null

Private showFindingThreshold

showFindingThreshold: number = 0

Methods

addAnnotation

  • addAnnotation(graphicType: GraphicType, annotation: GraphicAnnotation, referencedSopInstanceUID: string, frameNumber: number, isMultiFrame?: boolean): boolean
  • description

    Add given annotation into the shared map

    Parameters

    • graphicType: GraphicType
    • annotation: GraphicAnnotation

      A point graphic annotation

    • referencedSopInstanceUID: string

      referenced sop instance uid

    • frameNumber: number

      frame number

    • Default value isMultiFrame: boolean = false

      boolean flag to say if multiframe

    Returns boolean

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

clone

  • description

    Create new GraphicAnnotationContext from this object and return

    Returns GraphicAnnotationContext

    new cloned instance will be returned in success case, null will be returned in failure case

constructAnnotationContext

  • constructAnnotationContext(nonImageData: NonImageData, referencedImageSequence: Array<ReferencedImage>, showLabel?: boolean, isMultiFrame: boolean): void
  • description

    Update graphic annotation context from the given NonImageData data

    Parameters

    • nonImageData: NonImageData

      NonImageData

    • referencedImageSequence: Array<ReferencedImage>

      An array of referenced image associated

    • Default value showLabel: boolean = true

      boolean flag stating that whether to show label along with graphic object

    • isMultiFrame: boolean

      boolean stating that whether the loaded series has multi-frame

    Returns void

constructAnnotations

  • constructAnnotations(presentation: any, showLabel?: boolean, isMultiFrame: boolean): void
  • Parameters

    • presentation: any
    • Default value showLabel: boolean = true
    • isMultiFrame: boolean

    Returns void

deleteAnnotation

  • deleteAnnotation(graphicType: GraphicType, sopInstanceUid: string, frameNumber: number): void
  • description

    Delete annotation from the shared map

    Parameters

    • graphicType: GraphicType

      GraphicType of the annotation to be deleted

    • sopInstanceUid: string

      sop instance uid of the annotation to be deleted

    • frameNumber: number

      Frame number of the annotation to be deleted

    Returns void

getAllAnnotations

  • description

    Get all the annotations present in this context

    Returns Array<GraphicAnnotation>

    Returns an array of GraphicAnnotation object

getAnnotations

  • description

    Get all the annotations for given graphic type and referenced image (combination of SOP Instance UID and framenumber)

    Parameters

    • graphicType: GraphicType

      GraphicType

    • sopInstanceUid: string

      referenced image

    Returns Array<GraphicAnnotation>

    list of graphic annotations will be returned in success case, empty list will be returned in failure case

getGraphicLayerByName

  • getGraphicLayerByName(presentation: any, layerName: string): GraphicLayer
  • description

    Get graphic layer by name

    Parameters

    • presentation: any
    • layerName: string

    Returns GraphicLayer

    Returns a GraphicLayer if success or null will be returned

getSelectedAnnotation

  • getSelectedAnnotation(currentPoint: Point, sopInstanceUid: string, frameNumber: number, renderEngine: any): GraphicAnnotation
  • description

    Get selected annotation by given render pixel, SOP Instance UID and frame number

    Parameters

    • currentPoint: Point

      render pixel point

    • sopInstanceUid: string

      SOP Instance UID

    • frameNumber: number

      Frame Number

    • renderEngine: any

      render engine object

    Returns GraphicAnnotation

    selected annotation will be returned in success case, null will be returned in failure case

getSharedAnnotationMap

  • getSharedAnnotationMap(): any
  • description

    Get the shared annotation map

    Returns any

    shared map will be returned

getShowFindingThreshold

  • Get the numeric threshold value from the given annotation

    Parameters

    • graphicAnnotation: GraphicAnnotation

      annotation used to retrieve the threshold value

    Returns number

    exact value returned on success case, 0 will be returned on failure case

isAnnotationModified

  • isAnnotationModified(): boolean
  • description

    Check whether the annotation context modified or not

    Returns boolean

    Returns true if modified, false if not

isEmpty

  • isEmpty(): boolean
  • description

    check whether the map is empty or not

    Returns boolean

    true will be returned in success case false on failure case

isLayerWithinThreaholdMeasurement

  • isLayerWithinThreaholdMeasurement(annotation: any): boolean
  • Parameters

    • annotation: any

    Returns boolean

merge

  • description

    Merge given graphic annotation context to this

    Parameters

    • graphicAnnotationContext: GraphicAnnotationContext

      GraphicAnnotationContext object to be merged

    • Default value clone: boolean = false

      This parameter specifies that false for shallow copy, true for deep copy

    Returns void

setAnnotationColor

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

    Set color for graphic layer. It iterates through all annotations and sets the given color to all the layers matching

    Parameters

    • graphicLayer: string

      Graphic layer name to which the color to be updated

    • r: number

      R value

    • g: number

      G value

    • b: number

      b value

    Returns void

setFindingThreshold

  • setFindingThreshold(showFindingThreshold: any): void
  • Set the threshold value to render or hide the cad marker findings

    Parameters

    • showFindingThreshold: any

      Specifies the threshold

    Returns void

setModified

  • setModified(flag: boolean): void
  • description

    Update the annotation context is modified or not

    Parameters

    • flag: boolean

      true if modified, false if not

    Returns void