Class HTMLViewportPDF

A class to manage all the HTML viewport PDF

Hierarchy

Index

Constructors

constructor

  • new HTMLViewportPDF(htmlElementName: string, width: number, height: number, repaintable?: boolean): HTMLViewportPDF
  • description

    constructs the HTMLViewportPDF object; the initialization is deferred till the init() call since this is executed synchronously and we never want the constructor to fail

    Parameters

    • htmlElementName: string

      name of HTML5 element

    • width: number

      Initial width of this viewport

    • height: number

      Initial height of this viewport

    • Default value repaintable: boolean = false

    Returns HTMLViewportPDF

    Returns the newly created instance HTMLViewportPDF

Properties

botLeftCorner

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

botRightCorner

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

Protected cachedRenderParams

cachedRenderParams: any

Protected displayPatientOrientationMarkersInViewport

displayPatientOrientationMarkersInViewport: boolean = false

Protected drawListenerList

drawListenerList: any[] = new Array()

Protected height

height: number

Protected htmlElement

htmlElement: any

Protected htmlElementName

htmlElementName: string

Protected htmlViewportAdaptors

htmlViewportAdaptors: HTMLViewportAdaptors = null

Protected htmlViewportGroup

htmlViewportGroup: HTMLViewportGroup = null

Protected modifiedOrientation

modifiedOrientation: string

Protected nonImageSeriesDataContext

nonImageSeriesDataContext: NonImageSeriesDataContext

Protected observer

observer: ObserverInterface = null

offsetX

offsetX: number = 0

offsetY

offsetY: number = 0

Protected onDrawCallback

onDrawCallback: any = null

Protected renderEngine

renderEngine: any

Protected repaintData

repaintData: any

Protected repaintHeight

repaintHeight: any

Protected repaintImageBuffer

repaintImageBuffer: any = null

Protected repaintImageType

repaintImageType: any

Protected repaintUsePNG

repaintUsePNG: any

Protected repaintWidth

repaintWidth: any

Protected repaintableViewport

repaintableViewport: boolean = false

Protected seriesDataContext

seriesDataContext: SeriesDataContext

Protected showDICOMOverlay

showDICOMOverlay: boolean = false

Protected showLocalizerLines

showLocalizerLines: boolean = false

Protected showRuler

showRuler: boolean = false

topLeftCorner

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

topRightCorner

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

Protected url

url: string

Protected width

width: number

Methods

addDrawListener

  • addDrawListener(drawListener: any): void
  • description

    Add the given event listener into event listener list

    Parameters

    • drawListener: any

      Specifies the event listener

    Returns void

changeHTMLCanvasID

  • changeHTMLCanvasID(newHTMLElement: any): void
  • description

    Change the viewport html element's canvasid from the given Html element

    Parameters

    • newHTMLElement: any

      Specifies the reference to HtmlElement

    Returns void

disableRightClickMenu

  • disableRightClickMenu(disableMenu?: boolean): void
  • description

    toggle the right-click popup menu

    Parameters

    • Default value disableMenu: boolean = true

      Specifies the boolean flag to toggle

    Returns void

displayAnnotations

  • displayAnnotations(showAnnotation: boolean): void
  • description

    base class signature that allows subclass to toggle its annotations on/off

    Parameters

    • showAnnotation: boolean

      true if annotations are to be displayed, false otherwise

    Returns void

displayDICOMOverlay

  • displayDICOMOverlay(showDICOMOverlay?: boolean): void
  • description

    Display or hide the overlay based on the given flag

    Parameters

    • Default value showDICOMOverlay: boolean = true

      Specifies the toggle boolean flag

    Returns void

displayFPS

  • displayFPS(showFPS: boolean): void
  • description

    Display the FPS text in the viewport

    Parameters

    • showFPS: boolean

      Set to true to display frames per seoond in the viewport, false to hide it

    Returns void

displayLocalizerLines

  • displayLocalizerLines(showLocalizerLines?: boolean): void
  • description

    Display or hide the localizer lines based on the given flag

    Parameters

    • Default value showLocalizerLines: boolean = true

      Specifies the toggle boolean flag

    Returns void

displayPatientOrientationMarkers

  • displayPatientOrientationMarkers(showMarkers?: boolean): void
  • description

    Display the image position markers (A/P/S/I/L/R) in the viewport

    Parameters

    • Default value showMarkers: boolean = true

      to true to display image markers in the viewport, false to hide it

    Returns void

displayRuler

  • displayRuler(showRuler?: boolean): void
  • description

    Display or hide the ruler based on the given flag

    Parameters

    • Default value showRuler: boolean = true

      Specifies the toggle boolean flag

    Returns void

Protected doubleBufferInit

  • doubleBufferInit(): void

Protected doubleBufferPaint

  • doubleBufferPaint(bytes: any, width: any, height: any, imageType: any, usePNG: any, data: any): void
  • description

    Render the dicom image on the viewport form the given arguments

    Parameters

    • bytes: any

      Specifies the image data

    • width: any

      Specifies the image width

    • height: any

      Specifies the image height

    • imageType: any

      Specifies the image type

    • usePNG: any

      boolean flag that specifies whether the image to be render as png or not

    • data: any

      Specifies Dicom image data

    Returns void

doubleBufferResizeWindow

  • doubleBufferResizeWindow(width: number, height: number, adjustZoom?: boolean, useMax?: boolean): void
  • description

    update the internal offscreen buffer width / height

    Parameters

    • width: number

      Specifies the width of the window to be resized

    • height: number

      Specifies the height of the window to be resized

    • Default value adjustZoom: boolean = true

      Specifies the zoom level of the window to be resized

    • Default value useMax: boolean = false

      Specifies the boolean flag whether to use maximum values or not

      • @returns Returns value returned by resizeWindow method call

    Returns void

Protected drawClientData

  • drawClientData(context: any, image: any, width: number, height: number, data: any): void
  • description

    draw given image data

    Parameters

    • context: any

      context fetched from canvas

    • image: any

      dicom image

    • width: number

      width of the viewport

    • height: number

      height of the viewpot

    • data: any

      dicom tag

    Returns void

Protected drawDICOMOverlay

  • drawDICOMOverlay(context: any, width: any, height: any, sdc: any, rp: any, imageTags: any): void
  • description

    render dicom overlay from the given arguments

    Parameters

    • context: any

      context retrieved from canvas

    • width: any

      width of the viewport

    • height: any

      height of the viewport

    • sdc: any

      Specifies the SeriesDataContext

    • rp: any

      renderparams

    • imageTags: any

      Specify the DICOMImageTags reference

    Returns void

Protected drawRuler

  • drawRuler(context: any, data: any): void
  • description

    draw the ruler on the canvas from the given data

    Parameters

    • context: any

      context fetched from canvas

    • data: any

      data to be rendered on ruler

    Returns void

getCachedRenderParams

  • getCachedRenderParams(): any

Protected getFPS

  • getFPS(): number
  • description

    get FPS value for current frame but do not update lastimageprocessed

    Returns number

getHTMLElement

  • getHTMLElement(): any
  • description

    Gets the Html element

    Returns any

    HTML element associated with this viewport

getHTMLViewportGroup

getHtmlElementName

  • getHtmlElementName(): string
  • description

    Get the html element name of the viewport

    Returns string

    Returns Html element name in success case

getHtmlViewportAdaptors

getRenderEngine

init

  • init(nonSeriesDataContext: NonImageSeriesDataContext, subSeriesID: Number, onDrawCallback?: any, imageMetaDataReceived?: any, callbackFunc?: any): any
  • description

    initialize the HTMLViewportPDF

    Parameters

    • nonSeriesDataContext: NonImageSeriesDataContext

      seriesDataContext instance associated with this viewport

    • subSeriesID: Number

      sub series id for that pdf viewport to be created

    • Optional onDrawCallback: any

      call back method that will be called when viewport draw event occurs

    • Optional imageMetaDataReceived: any

      call back method that will be called when image received from viewport for processing

    • Optional callbackFunc: any

      call back function that will be called on success and failure case

    Returns any

    This is an asynchronous method that returns a Promise as follows:

    Promise .then(void) .catch (err: ReturnCode )

Protected invokeObserver

  • invokeObserver(data: any): void
  • description

    invoke the observer object with the given data

    Parameters

    • data: any

      specifies the data

    Returns void

isRepaintable

  • isRepaintable(): boolean
  • description

    Get the Flag whether the viewport is repaint able or not

    Returns boolean

    Returns the repaint able flag

Protected paint

  • paint(bytes: any, width: any, height: any, imageType: any, usePNG: any, data: any): void
  • description

    paints the dicom image and overlay

    Parameters

    • bytes: any

      raw image

    • width: any

      width of the viewport

    • height: any

      height of the viewport

    • imageType: any

      image type

    • usePNG: any

      Specifies the boolean flag whether image rendered as png or not

    • data: any

      dicom image

    Returns void

Protected procesPDFFromServer

  • procesPDFFromServer(data: any): void
  • description

    procesPDFFromServer is called when pdf is ready to be rendered for a render engine. If data.image is null, there was an error, in which case we reset the mouse/touch state. at this point, there is no knowledge of the canvasID (either in our code, or external), so the mapping between the renderEngineID (data.name) is used to find the correct object, and then its render() method will be called.

    Parameters

    • data: any

      data to be processed

    Returns void

Protected processImageFromServer

  • processImageFromServer(data: any): void
  • description

    processImageFromServer is called when image is ready to be rendered for a render engine. If data.image is null, there was an error, in which case we reset the mouse/touch state.
    At this point, there is no knowledge of the canvasID (either in our code, or external), so the mapping between the renderEngineID (data.name) is used to find the correct object, and then its render() method will be called. render the supplied bytes to the HTML element using paint(), and then update the internal state varaibles. If the mouse adaptor has a postRender step, such as during flythrough, invoke its postRender() method after the rendering is complete so the next frames can be requested.
    The renderImageData() method is extended in the subclass HTMLViewport3D to create a duplicate copy of the rendered image from the server, so it is possible to update the viewport without forcing a native renderImageData() if the render parameters have not changed.
    TODO: extend this to support postRender for the touch flythrough

    Parameters

    • data: any

      data to be processed

    Returns void

reAlignViewport

  • reAlignViewport(current3DCursor: Vector): void
  • description

    Re-Align the viewport.

    Parameters

    Returns void

releaseSessionResources

  • releaseSessionResources(callbackFunc?: any): any
  • description

    Release the session related resources

    Parameters

    • Optional callbackFunc: any

      call back method returned on success and failure case

    Returns any

    This is an asynchronous method that returns a Promise as follows:

    Promise .then(void) .catch (err: ReturnCode )

removeDrawListener

  • removeDrawListener(drawListener: any): void
  • description

    Remove the given event listener from the event listener list

    Parameters

    • drawListener: any

      Specifies the event listener

    Returns void

render

  • render(): any
  • description

    Triggers an asynchronous intermedate render operation, and generate a JPEG image using the interactive quality setting.

    Returns any

    This is a synchronous method and returns ReturnCode.ok on success.

renderFinal

  • description

    Invokes the native renderFinal() method.

    Returns ReturnCode

    This is a synchronous method and returns ReturnCode.ok on success.

Protected renderPdfInit

  • renderPdfInit(): void
  • description

    initialize the view port to render

    Returns void

repaint

  • repaint(): void
  • description

    Initiates a client-side repaint() of the viewport. This will not trigger a server operaiton, but instead will redraw the last server image onto the canvas, allowing the client to draw its objects onto the viewport (such as moving of annotations).

    Returns void

resetFPSTime

  • resetFPSTime(): void

resizeWindow

  • resizeWindow(width: number, height: number, adjustZoom?: boolean, useMax?: boolean): void
  • description

    Re-Size the window

    Parameters

    • width: number

      , width - number

    • height: number
    • Default value adjustZoom: boolean = true
    • Default value useMax: boolean = false

    Returns void

setCustomMouseAdaptor

  • description

    set custom Mouse Adapter into HtmlViewPortAdaptors

    Parameters

    • mouseAdaptorInterface: any

      Specifies the reference to MouseAdaptorInterface

    • mouseButton: MouseButton

      Specifies the Mouse button to invoke this adapter

    • Default value modifier: KeyboardModifier = KeyboardModifier.none

      Specifies the Key modifier to invoke this Adapter

    Returns void

setCustomTouchAdaptor

setDefaultAdaptors

setHTMLViewportGroup

  • setHTMLViewportGroup(htmlViewportGroup: any): void
  • description

    Set the htmlViewportGroup instance

    Parameters

    • htmlViewportGroup: any

      Specifies the htmlViewportGroup instance

    Returns void

setMouseAdaptor

  • description

    Set Mouse Adapter into HtmlViewPortAdaptors

    Parameters

    • mouseAdaptorID: any

      Specifies the mouse adapter id

    • mouseButton: MouseButton

      Specifies the reference to mouse button to invoke this adapter

    • Default value modifier: KeyboardModifier = KeyboardModifier.none

      Specifies the Key modifier to invoke this adapter

    • Default value orientation: ViewType = Fovia.ViewType.oblique

      Specifies the view type

    Returns void

setOverrideMouseAdaptor

setOverrideTouchAdaptor

setTouchAdaptor

  • description

    Set touch Adaptor into HtmlViewPortAdaptors

    Parameters

    • touchAdaptorInterface: TouchAdaptors

      Specifies the reference to TouchAdaptorInterface

    • touchEvent: TouchEvents

      Specifies the touch event to invoke this adapter

    • Default value orientation: ViewType = Fovia.ViewType.oblique

      Specifies the view type

    Returns void

Protected updateFPS

  • updateFPS(): void