Class HTMLViewport3D

Extends the abstract HTMLViewport class so it can display a 3D/MIP/MPR volume

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

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

    constructs the HTMLViewport3D object; the initialization is deferred till the init() call rather odd behavior if you attempt to create a Promise inside a constructor since it cannot return a value

    Parameters

    • htmlElementName: string

      name of HTML5 element

    • width: number

      width of the viewport

    • height: number

      height of the viewport

    • Default value repaintable: boolean = false

      boolean flag specifies whether this viewport is repaintable or not

    Returns HTMLViewport3D

    Returns the newly created instance HTMLViewport3D

Properties

botLeftCorner

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

botRightCorner

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

Protected cachedRenderParams

cachedRenderParams: any

Private currentMPRPoint_VolumeUnits

currentMPRPoint_VolumeUnits: Vector = new Fovia.Util.Vector(0, 0, 0)

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 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

scrollData

scrollData: ScrollAdaptorData = null

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 vdc

Protected viewType

viewType: ViewType = null

Protected width

width: number

wlData

wlData: WindowLevelData = null

Static g_ForceRecalculationOfWindowOffsetForAngular

g_ForceRecalculationOfWindowOffsetForAngular: any = undefined

Methods

GetPixelsPerMillimeter

  • GetPixelsPerMillimeter(spacingX: any, zoom: any): number
  • Parameters

    • spacingX: any
    • zoom: any

    Returns number

GetZoomForPixelsPerMillimeter

  • GetZoomForPixelsPerMillimeter(spacingX: any, pixelsPerMilli: any): number
  • Parameters

    • spacingX: any
    • pixelsPerMilli: any

    Returns number

addDrawListener

  • addDrawListener(drawListener: any): void
  • description

    Add the given event listener into event listener list

    Parameters

    • drawListener: any

      Specifies the event listener

    Returns void

Private applyXMLPresetToRenderEngine

  • description

    Applies the given xml preset and update this view port render engine

    Parameters

    Returns any

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

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

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

Protected createRenderEngine

  • description

    Create render engine instance for this viewport

    Parameters

    • volumeDataInfo: VolumeDataContext

      VolumeDataContext instance used to rendering purpose

    • Default value renderEngineType: RenderType = Fovia.RenderType.parallel

      render engine type

    Returns any

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

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

Protected createRenderEngine4D

  • description

    Create render engine instance for this viewport

    Parameters

    Returns any

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

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

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

    render the given dicom image data on view port

    Parameters

    • context: any

      context used to render

    • image: any

      dicom image to be rendered

    • width: number

      width of the image

    • height: number

      height of the image

    • data: any

      dicom tag data

    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

Private drawLocalizer

  • drawLocalizer(context: any, data: any, width: any, height: any): void
  • description

    render the localizer on view port

    Parameters

    • context: any

      context used to render

    • data: any

      dicom tag data to be rendered

    • width: any

      width of the localizer line

    • height: any

      height of the localizer line

    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

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(renderEngine: RenderEngineContext3D, renderEngineType?: RenderType, onDrawCallback?: any, imageMetaDataReceived?: any, callbackFunc?: any): any
  • init(volumeDataInfo: VolumeDataContext, renderEngineType?: RenderType, onDrawCallback?: any, imageMetaDataReceived?: any, callbackFunc?: any): any
  • init(volDataArray: Array<VolumeDataContext>, renderEngineType?: RenderType, onDrawCallback?: any, imageMetaDataReceived?: any, callbackFunc?: any): any
  • description

    initialize the foviaHTMLViewport

    Parameters

    • renderEngine: RenderEngineContext3D
    • Optional renderEngineType: RenderType

      Render engine type (defaults to Parallel Rendering)

    • Optional onDrawCallback: any
    • Optional imageMetaDataReceived: any
    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , void)

    While this does not provide a return value, it is critical that render operations are not triggered in this component until after the initializtion is complete and the Promise or callback returns.:

  • Parameters

    • volumeDataInfo: VolumeDataContext
    • Optional renderEngineType: RenderType
    • Optional onDrawCallback: any
    • Optional imageMetaDataReceived: any
    • Optional callbackFunc: any

    Returns any

  • Parameters

    • volDataArray: Array<VolumeDataContext>
    • Optional renderEngineType: RenderType
    • Optional onDrawCallback: any
    • Optional imageMetaDataReceived: any
    • Optional callbackFunc: any

    Returns any

Protected invokeObserver

  • invokeObserver(data: any): void
  • description

    invoke the observer to render the given dicom image data

    Parameters

    • data: any

      DicomImageData

    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 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

    realign the viewport based on the given 3d cursor location

    Parameters

    • current3DCursor: Vector

      3d cursor location

    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

  • renderFinal(): any
  • description

    Triggers an asynchronous final render operation and generates either a JPEG image using the final quality setting, or a lossless compressed PNG file. This operation is much more costly than a render() and should not be done inside a mouseDrag loop, only done when the user finishes the operation, such as a mouseUp. The initial display should use a renderFinal to ensure the highest quality result is displayed.

    Returns any

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

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

    Resizes this component and triggers a render() / renderFinal() sequence

    Parameters

    • width: number

      Updated width of this viewport

    • height: number

      Updated height of this viewport

    • Default value adjustZoom: boolean = true

      udpdate the zoom level

    • Default value useMax: boolean = false

      flag that mention maximum zoom level or not

    Returns void

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

setAndRenderXMLPreset

  • setAndRenderXMLPreset(xmlPresetName: String, callbackFunc?: any): any
  • setAndRenderXMLPreset(xmlPresetName: Array<String>, callbackFunc?: any): any
  • description

    Applies the specified XML preset to this viewport

    Parameters

    • xmlPresetName: String

      path and filename of the XML file to load. This will be relative to the FoviaWebSDK.EXE directory, or can be an absolute path

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , void)

    While this does not provide a return value, the application will be notified once the preset has been applied and rendered

  • Parameters

    • xmlPresetName: Array<String>
    • Optional callbackFunc: any

    Returns any

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