Class RenderEngineContext3D

RenderEngineContext3D is backed by a native renering engine and is typically associated with a Fovia.UI.HTMLViewport3D . This objectis typically created by a ServerContext.loadDICOMDir or a ServerContext.loadCustomData .

Hierarchy

Index

Constructors

constructor

Properties

Protected cachedRenderParams

cachedRenderParams: any = null

Protected imageReadyCallback

imageReadyCallback: Function

Private renderEngineID

renderEngineID: number

Private vdc

Methods

applyVolumetricShadowMap

  • applyVolumetricShadowMap(shadowMap: ShadowMapContext, callbackFunc?: any): any
  • 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 any

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

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

getCachedRenderParams

  • getCachedRenderParams(): any

getPolygonLighting

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

    Parameters

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , data)

getRenderEngineID

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

    Returns number

  • Parameters

    • renderEngineIndex: number

    Returns number

getRenderParams

  • getRenderParams(callbackFunc?: any): any
  • Gets the current RenderParams3D structure for the engine.

    Parameters

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

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

loadTransferFunctionFromFile

  • loadTransferFunctionFromFile(xmlFilename: string, callbackFunc?: any): any
  • 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.

    • Optional callbackFunc: any

    Returns any

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

releaseSessionResources

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

    Parameters

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode )

render

  • Renders an interactive quality image.

    Returns ReturnCode

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

renderFinal

  • Renders a final maximum quality image.

    Returns ReturnCode

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

saveRenderedImageToFile

  • saveRenderedImageToFile(filename: string, isFinal?: boolean, callbackFunc?: any): any
  • 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 any

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

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

saveTransferFunctionToFile

  • saveTransferFunctionToFile(xmlFilename: string, callbackFunc?: any): any
  • 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.

    • Optional callbackFunc: any

    Returns any

    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 )

setDisablePolygonOcclusion

  • setDisablePolygonOcclusion(enableGPU: boolean, bAutoOffset?: boolean, offsetDist?: number, callbackFunc?: any): any
  • 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 any

    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 )

Private setFramesPerPhase

  • setFramesPerPhase(frames: number): void
  • Sets the number of animation frames that will be produces for each dataset in a 4D series.

    Parameters

    • frames: number

    Returns void

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

Private setPhase

  • setPhase(phase: number): void
  • Sets the current 'phase' or animation frames in a 4D series.

    Parameters

    • phase: number

    Returns void

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

setPolygonContexts

  • setPolygonContexts(polygonContextList: Array<PolygonContext>, intermediateRender?: any, callbackFunc?: any): any
  • 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 intermediateRender: any

      If true an interactive quality image is automaticly generated. If false no image is generated.

    • 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): any
  • Sets the lighting characterists for rendering of the polygons.

    Parameters

    • ambience: number
    • brightness: number
    • reflection: number
    • shininess: number
    • 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)

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 optionalRender: RenderRequest = Fovia.RenderRequest.noRender

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

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

    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(); });

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