Options
All
  • Public
Menu

Class RenderEngineContext3D

RenderEngineContext3D is backed by a native renering engine and is typically associated with a Fovia.UI.HTMLViewport3D .

Hierarchy

Index

Constructors

constructor

  • Constructor for the RenderEngineContext3D

    Parameters

    • renderEngineID: number

      Unique render engine ID that corresponds to the native rendering engine.

    • vdc: VolumeDataContext

      volumeDataContext associated with this native rendering engine.

    • imageReadyCallback: Function
    • Default value renderEngineLocation: RenderLocation = Fovia.RenderLocation.Server

    Returns RenderEngineContext3D

Properties

Protected bIsOpenglEngine

bIsOpenglEngine: boolean = false

Protected cachedRenderParams

cachedRenderParams: any = null

Protected imageReadyCallback

imageReadyCallback: Function

Protected renderEngineLocation

renderEngineLocation: RenderLocation = Fovia.RenderLocation.Server

Static Protected openGLRenderObj

openGLRenderObj: any = null

Methods

applyVolumetricShadowMap

  • applyVolumetricShadowMap(shadowMap: ShadowMapContext, callbackFunc?: any): Promise<Object>
  • description

    update volumetric shadow map

    Parameters

    • shadowMap: ShadowMapContext

      ShadowMapContext to be updated

    • Optional callbackFunc: any

      call bsck method to be called on both success and failure case

    Returns Promise<Object>

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

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

canShowCurvedMprPathWarning

  • canShowCurvedMprPathWarning(): boolean

computeScrollAndRender

  • computeScrollAndRender(viewType: ViewType, currentSlice: number, optionalRender3D?: RenderRequest, callbackFunc?: any): void
  • Parameters

    • viewType: ViewType
    • currentSlice: number
    • Default value optionalRender3D: RenderRequest = Fovia.RenderRequest.noRender
    • Optional callbackFunc: any

    Returns void

getCachedRenderParams

  • getCachedRenderParams(): any

getCurvedMPRPathEx

  • getCurvedMPRPathEx(cmprReturnOptions: CmprDataOptions, callbackFunc?: any): any
  • Returns server side algorithmic data defining the current curved MPR path generated by the setCurvedMPRPathEx() function. This function, in addition to immedeately returning the requested data, can also be used to automaticly return curve and interpolation data as part of the metadata returned along with a rendered image frame. Use the bDefaultFlags paramtater to set this feature. This automatic return feature is much more efficient then programaticly calling getCurvedMPRPathEx() each frame. All metadata return flags are set to false by default. The developer should, to maximize performance, ensure that only the necessary data return flags are set to true.

    Parameters

    • cmprReturnOptions: CmprDataOptions

      A CmprDataOptions structure specifying what Curved MPR data fields will be returned. The fields are as follows. ctrlPoints - If true, the array of control points will be returned. interpTangents - If true, the array of interpolated tangents will be returned. interpMatrices - If true, the array of interpolated matrices will be returned. curveData - If true, a collection of miscellaneous curve calculation data will be returned. defaultFlags - If true, the data associated with the set of input boolean return flags will be set as the default metadata return set (see description).

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode )

getImageReadyCallback

  • getImageReadyCallback(): Function
  • Returns Function

getOpenGlRenderFlag

  • getOpenGlRenderFlag(): boolean
  • Returns boolean

getOpenGlRenderObj

  • getOpenGlRenderObj(): any
  • Returns any

getPolygonCrossSectionData

  • getPolygonCrossSectionData(callbackFunc?: any): Promise<Object>
  • Gets the polygon cross section data. This consists of an array of screen space coordinates representing the 2D line segments that make up the cross section rendering. The returned array will have 2 coordinates (4 integers) per segment.

    Parameters

    • Optional callbackFunc: any

    Returns Promise<Object>

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

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

    callbackFunc(err: ReturnCode , data)

getPolygonLighting

  • getPolygonLighting(callbackFunc?: any): Promise<Object>
  • Gets the lighting characterists for rendering of the polygons.

    Parameters

    • Optional callbackFunc: any

    Returns Promise<Object>

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

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

    callbackFunc(err: ReturnCode , data)

getRenderEngineActive

  • getRenderEngineActive(): boolean

getRenderEngineID

  • getRenderEngineID(): number
  • getRenderEngineID(renderEngineIndex: number): number
  • Return the render engine ID associated with this object

    Returns number

  • Parameters

    • renderEngineIndex: number

    Returns number

getRenderEngineLocation

getRenderParams

getSeriesDataContext

getTransferFunction

  • getTransferFunction(index: number, callbackFunc?: any): any
  • Gets one of the transfer functions associated with this engine.

    Parameters

    • index: number
    • Optional callbackFunc: any

    Returns any

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

    Promise .then(renderRangeParams : RenderRangeParams ) .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode , renderRenderParams : RenderRangeParams )

getVolumeDataContext

imageReceived

  • imageReceived(data: any): void
  • Parameters

    • data: any

    Returns void

init

loadTransferFunctionFromFile

  • loadTransferFunctionFromFile(xmlFilename: string, rescaleSlope?: number, rescaleIntercept?: number, callbackFunc?: any): Promise<Object>
  • Loads a transfer function XML file and applies the contents to the engine.

    Parameters

    • xmlFilename: string

      The file name of a transfer function XML file to load and apply.

    • Default value rescaleSlope: number = 1
    • Default value rescaleIntercept: number = 0
    • Optional callbackFunc: any

    Returns Promise<Object>

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

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

    callbackFunc(err: ReturnCode )

projectPoint

  • projectPoint(vectorList: Array<Vector>, callbackFunc?: any): any
  • Projects the specific array of vectors into the scene and returns a correpsonding array of points.

    Parameters

    • vectorList: Array<Vector>
    • Optional callbackFunc: any

    Returns any

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

    Promise .then(pointList : Array< Point >) .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode , pointList Point : Array< Point> )

releaseMemMap

  • releaseMemMap(bufName: string, callbackFunc?: any): Promise<Object>
  • Parameters

    • bufName: string
    • Optional callbackFunc: any

    Returns Promise<Object>

releaseSessionResources

  • releaseSessionResources(callbackFunc?: any): Promise<Object>
  • Releases server side resources assoicated with this RenderEngineContext3D instance.

    Parameters

    • Optional callbackFunc: any

    Returns Promise<Object>

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

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

    callbackFunc(err: ReturnCode )

render

renderFinal

saveRenderedImageToFile

  • saveRenderedImageToFile(filename: string, isFinal?: boolean, callbackFunc?: any): Promise<Object>
  • description

    Renders an image and saves it to disk.

    Parameters

    • filename: string

      Name of the file to save to disk.

    • Default value isFinal: boolean = true

      Set to true to render a final quality image (defualt), or false for interactive quality image.

    • Optional callbackFunc: any

    Returns Promise<Object>

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

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

saveTransferFunctionToFile

  • saveTransferFunctionToFile(xmlFilename: string, rescaleSlope?: number, rescaleIntercept?: number, callbackFunc?: any): Promise<Object>
  • Saves the current set of transfer functions to an XML file.

    Parameters

    • xmlFilename: string

      The file name of a transfer function XML file to save to.

    • Default value rescaleSlope: number = 1

      Optional rescale slope to be applied to DICOM display units in saved file.

    • Default value rescaleIntercept: number = 0

      Optional rescale intercept to be applied to DICOM display units in saved file.

    • Optional callbackFunc: any

    Returns Promise<Object>

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

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

    callbackFunc(err: ReturnCode )

setCurvedMPRPath

  • Sets the curved MPR path to use. Essentially, the X vector (m11,m21,m31) in the projection plane describes the direction for the linear slice to take at every interpolated point on the curve. The offset (m14,m24,m34) in the projection plane describes where each point is. From this description, the points you specify are interpolated via Catmull-Rom spline interpolation. The spacing between interpolated points is dictated by the image size.

    Parameters

    • arrProjPlanes: Matrix[]

      An arry of transformation matrices designating the position and direction vector for each control point.

    • cMPRType: CurvedMPRType

      A value designating which vector to align the points against.

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode )

setCurvedMPRPathEx

  • Sets the control points and curve interpolation data for a Curved MPR path. This is an enhanced version of the original setCurvedMPRPath() function.

    Parameters

    • arrPoints: Vector[]

      An arry of control point for the curved MPR path.

    • cMPRType: CurvedMPRType

      A value designating if the line is flattend or straightened.

    • cMPRMode: CurvedMPRMode
    • zDirection: Vector

      The Z direction of the line.

    • rotationAxis: Vector

      The rotation axis of the line (only used with flattened curves).

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode )

setDefaultTransferFunctions

  • setDefaultTransferFunctions(numTFs: number, callbackFunc?: any): Promise<Object>
  • Sets a default transfer function to a set of label volume indices.

    Parameters

    • numTFs: number

      Applies a transfer function to label volumes 0 to numTFs-1. (Currntly ignored)

    • Optional callbackFunc: any

    Returns Promise<Object>

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

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

    callbackFunc(err: ReturnCode )

setDisablePolygonOcclusion

  • setDisablePolygonOcclusion(enableGPU: boolean, bAutoOffset?: boolean, offsetDist?: number, callbackFunc?: any): Promise<Object>
  • Enables OpenGL GPU based rendering of polygon objects. All polygon objects will be rendered by OpenGL on the system GPU for this engine. The polygon objects are rendered into a seperate buffer that is overlayed on top of the HDVR image. OpenGL based polygon rendering is potentially much faster than the HDVR polygon engine, and supports layered object translucency. However, because the polygon objects are rendered into a seperate buffer and then overlayed on the HDVR image, they will always appear on top of the HDVR image. If volume occluded polygon objects are desired, the HDVR polygon engine must be used.

    When this function is used to disable or enable OpenGL rendering it will reset the render engine's polygon state. This means that any PolygonContext objects that have been applied to the engine will be cleared, and FastPolygon rendering will be disabled. One must call setPolygonContexts and setFastPolygonEnable, as approptiate, to re-apply the polygon state.

    For polygon objects to be visible the HDVR camera must be positioned so that the objects are in view. The HDVR camera position as represented in the RenderParams.transform variable may be different than the actual camera position if the front clipping plane is disabled (this is the default setting). This offsetting may be automated by using the bAutoOffset and offsetDistance paramaters. This auto offset feature is necessary if rendering in slab mode.

    OpenGL polygon rendering is only available when the rendering server is running on a GPU enabled Microsoft Windows system.

    Parameters

    • enableGPU: boolean

      Set to true to enable OpenGL GPU polygon rendering. Set to false to enable HDVR CPU polygon rendering.

    • Default value bAutoOffset: boolean = true

      True to enable auto camera offset feature for OpenGL frustrum. False to disable.

    • Default value offsetDist: number = 1000

      Offset distance for auto offset feature.

    • Optional callbackFunc: any

    Returns Promise<Object>

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

    Promise .then(renderParams : RenderParams3D ) .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode , renderParams : RenderParams3D )

setFastPolygonEnable

  • setFastPolygonEnable(fastPolygonEnable: boolean, callbackFunc?: any): any
  • Sets the engine to use fast polygons mode. In this mode changes to PolygonContext objects are rendered more quickly. However, no changes to the render engine state other than polygon transformations are permitted while in this mode. This means that no changes to the position, orientation, or any other RenderParams3D fields are permitted.

    Parameters

    • fastPolygonEnable: boolean

      Set to true to turn fast polygon mode on, set to false to turn off.

    • Optional callbackFunc: any

    Returns any

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

    Promise .then(renderParams : RenderParams3D ) .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode , renderParams : RenderParams3D )

setMaxNumMappedFile

  • setMaxNumMappedFile(maxNumMappedFile: number): void
  • Parameters

    • maxNumMappedFile: number

    Returns void

setOpenGlRenderData

setPolygonContexts

  • Sets an array of PolygonContext objects to be assoicated with the render engine. Once added to the engine, a new frame is rendered that includes the added polygon objects.

    Parameters

    • polygonContextList: Array<PolygonContext>

      An array of PolygonContext objects to be assoicated with the render engine.

    • Optional optionalRender: RenderRequest

      optional parameter specifies RenderRequest.noRender, .render, or .renderFinal

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

setPolygonLighting

  • setPolygonLighting(ambience: number, brightness: number, reflection: number, shininess: number, callbackFunc?: any): Promise<Object>
  • Sets the lighting characterists for rendering of the polygons.

    Parameters

    • ambience: number
    • brightness: number
    • reflection: number
    • shininess: number
    • Optional callbackFunc: any

    Returns Promise<Object>

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

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

    callbackFunc(err: ReturnCode , void)

setRenderEngineActive

  • setRenderEngineActive(state?: boolean): void

setRenderParams

  • Sets the rendering parameter to be used with the render engine.

    Parameters

    • rp: RenderParams3D

      A RenderParams3D object containing the values that are to be applied to the rendering engine.

    • Default value optionalRender3D: RenderRequest = Fovia.RenderRequest.noRender

      enum to instruct the render engine to re-render with the updated parameters

    • Optional callbackFunc: any

    Returns Promise<Object>

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

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

    callbackFunc(err: ReturnCode )

    While this does not provide a return value, it is sometimes useful to wait for it to complete as in:

    renderEngineContext.setRenderParams(renderParams).then(function() { renderEngineContext.render(); renderFinal(); });

setShowCurvedMprPathWarning

  • setShowCurvedMprPathWarning(state?: boolean): void

setTransferFunction

  • setTransferFunction(index: number, renderRanges: RenderRangeParams[], callbackFunc?: any): any
  • Sets the transfer function on this rendering engine.

    Parameters

    • index: number

      0-based number for transfer function to set.

    • renderRanges: RenderRangeParams[]

      An array of render ranges to set.

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode )

shootRay

  • shootRay(pointList: Array<Point>, callbackFunc?: any): any
  • Shoots ray into the screen from an array of points, and returns a correpsonding array of RayStopInfo objects.

    Parameters

    • pointList: Array<Point>

      Array of Vectors to project into the scene. At most 20 points can be passed at one time.

    • Optional callbackFunc: any

    Returns any

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

    Promise .then(rayStopInfoList : Array< RayStopInfo>) .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode , rayStopInfoList : Array< RayStopInfo> )