Class ServerContext

ServerContext is a static class will initialize the HDVR rendering server, load data, and access server resources.

Hierarchy

  • ServerContext

Index

Methods

Static addSOPClassUID

  • addSOPClassUID(sopClassUIDs: Array<string>, callbackFunc?: any): any
  • Add new SOP class UID to create sub series per image

    Parameters

    • sopClassUIDs: Array<string>
    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode )

Static callCustomFunction

  • Call custom functions server operations

    Parameters

    • volumes: Array<VolumeDataContext>

      The array of volumes to call custom function operations.

    • octrees: Array<OctreeContext>

      The array of octres to call custom function operations.

    • renderEngines: Array<RenderEngineContext3D>

      The array of render engines to call custom function operations.

    • segmentations: Array<VolumeSegmentationContext>

      The array of segmentations to call custom function operations.

    • parameters: any

      The JSON parameters to be sent to server for custom functions operations.

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode )

Static callCustomFunction2D

  • Call custom functions 2D server operations

    Parameters

    • sdcArray: Array<SeriesDataContext>
    • segmentations: Array<SeriesSegmentationContext>

      The array of segmentations to call custom function operations.

    • parameters: any

      The JSON parameters to be sent to server for custom functions operations.

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode )

Static callServerFunction

  • callServerFunction(parameters: any, callbackFunc?: any): any
  • Parameters

    • parameters: any
    • Optional callbackFunc: any

    Returns any

Static Private create4DRenderEngine

  • create4DRenderEngine(voiIDs: Array<number>, octreeIDs: Array<number>, callbackFunc?: any): any
  • description

    create a renderingEngine and invoke the callback once this is complete this operation is fast, but we MUST block client (not server) until it completes

    Parameters

    • voiIDs: Array<number>

      volume data context ids

    • octreeIDs: Array<number>

      octtree ids

    • Optional callbackFunc: any

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

Static createBlendedRenderEngine3D

  • description

    Creates a blended 3D/MPR Rendering Engine using the array of render engines and volume data context objects.

    Parameters

    • renderEngineList: Array<RenderEngineContext3D>

      list of 3D render engines used to create the blended render engine.

    • vdcList: Array<VolumeDataContext>

      list of volmume data contexts used to create the blended render engine.

    • imagereadycallback: any

      callback invokved when images are generated.

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , renderEngineContext : RenderEngineContext3D )

Static createOctree

  • createOctree(volID: any, smooth?: SmoothParameter, useShared?: boolean, callbackFunc?: any): any
  • description

    Create an octree for the dataset. The octree create function requires a volume ID and optionally smoothing parameter and callback

    Parameters

    • volID: any

      identifier for volume data to create octree

    • Optional smooth: SmoothParameter

      optionally specify the smoothing value of the type Fovia.SmoothParameter. The supported smoothing for octree values are Fovia.SmoothParameter.none, Fovia.SmoothParameter.trilinear and Fovia.SmoothParameter.tricubic

    • Optional useShared: boolean

      Reserved for future use

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , octreeContext : OctreeContext )

Static createPolygonContext

  • createPolygonContext(vertices: Array<Vector>, normals: Array<Vector>, colors: Array<Color>, callbackFunc?: any): any
  • Creates a PolygonContext object with the supplied vertices, normals, and colors.

    Parameters

    • vertices: Array<Vector>

      array of vectors for each polygon point

    • normals: Array<Vector>

      array of vectors for each normal assoicated with each polygon point

    • colors: Array<Color>

      array of colors assoicated with each polygon point

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , polygonContext : PolygonContext )

Static createPolygonContextFromFile

  • Creates a PolygonContext object from a file stored on disk.

    Parameters

    • filename: String

      The name of the file.

    • Default value smoothMode: PolygonSmoothMode = PolygonSmoothMode.none

      An optional smoothing parameter to be applied.

    • Default value centerAtOrigin: boolean = false

      If true the mesh object's vertices are recalculated so that the center of the object is positioned on the origin. If false the object is loaded unmodified.

    • Default value fileType: PolygonFileType = PolygonFileType.unspecified

      A PolygonFileType value specifying the type of polygon object to be loaded.

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , renderParams : PolygonContext )

Static createPolygonContextFromObjFileWithTexture

  • createPolygonContextFromObjFileWithTexture(filename: String, textureMapFilename: String, centerAtOrigin?: boolean, callbackFunc?: any): any
  • Creates a PolygonContext object from an OBJ file stored on disk performs a vertex colorization from a 'texture' JPG image. This is different from true UV texture mapping and works best on models with a high ratio of vertices to texture resolution. For true UV texture mapping use the PolygonContext.setTextureMapFromFile() method.

    Parameters

    • filename: String

      The name of the file.

    • textureMapFilename: String

      The name of the JPG image to use as the vertex colorization source.

    • Default value centerAtOrigin: boolean = false

      If true the mesh object's vertices are recalculated so that the center of the object is positioned on the origin. If false the object is loaded unmodified.

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , renderParams : PolygonContext )

Static createPolygonContextFromVolume

  • createPolygonContextFromVolume(volumeDataContext: VolumeDataContext, octreeContext: OctreeContext, computeGradients: boolean, isUpperLimit: boolean, threshold: number, tfMask: number, callbackFunc?: any): any
  • Creates a PolygonContext object by converting volume data to polygon data.

    Parameters

    • volumeDataContext: VolumeDataContext

      The volume data from which the polygon data will be generated.

    • octreeContext: OctreeContext

      The octree associated with the volume data from which the polygon data will be generated.

    • computeGradients: boolean

      If true then volume data gradients at the isosurface will be used to compute vertex normals. If false then normals are not calculated.

    • isUpperLimit: boolean

      If true then increasing volume gradients are considered to be inside the mesh. If false then the opposite is true. Normally this value should be true.

    • threshold: number

      The dataset value corosponding to the isosurface from which to generate the polygon data.

    • tfMask: number

      A bitmask determining which segmentation label volumes will be included in the polgyon conversion process.

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , renderParams : PolygonContext )

Static createRenderEngine2D

  • createRenderEngine2D(sdc: SeriesDataContext, imageReadyCallback: any, callbackFunc?: any): any
  • description

    Creates a 2D Rendering Engine using the series data context

    Parameters

    • sdc: SeriesDataContext

      series data context used to create the render engine.

    • imageReadyCallback: any
    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , renderEngineContext : RenderEngineContext2D )

Static createRenderEngine3D

  • description

    Creates a 3D/MPR Rendering Engine using the specified volume data context.

    Parameters

    • vdc: VolumeDataContext

      volmume data context used to create the render engine.

    • octree: OctreeContext

      octree context used to create the render engine (may be null).

    • renderEngineType: RenderType

      initial renderType for this engine.

    • imageReadyCallback: any
    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , renderEngineContext : RenderEngineContext3D )

Static createRenderEngine4D

  • createRenderEngine4D(volDataArray: Array<VolumeDataContext>, renderEngineType: RenderType, imageReadyCallback: any, callbackFunc?: any): any
  • description

    Creates a 4D Rendering Engine using the specified volume data context.

    Parameters

    • volDataArray: Array<VolumeDataContext>
    • renderEngineType: RenderType

      initial renderType for this engine.

    • imageReadyCallback: any
    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , renderEngineContext : RenderEngineContext3D )

Static createRenderEnginePDF

  • description

    create render engine instance for the pdf view port

    Parameters

    • nsdc: NonImageSeriesDataContext

      series data context to be updated in new render engine instance

    • subSeriesID: any

      sub series id

    • imageReadyCallback: any

      call back method to be called when dicom image received

    • Optional callbackFunc: any

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

Static createSeriesSegmentationContext

  • description

    create new SeriesSegmentationContext instance

    Parameters

    • sdc: SeriesDataContext

      series data context that to be updated on new instance

    • Optional callbackFunc: any

      call back method that to be called in both success and failure cas

    Returns any

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

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

Static createShadowMap

  • description

    Create new shadow map

    Parameters

    • vdc: VolumeDataContext

      volume data context

    • Optional callbackFunc: any

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

Static createVolumeSegmentationContext

  • createVolumeSegmentationContext(octree: any, callbackFunc?: any): any
  • description

    Creates a VolumeSegmentationContext object used to segment volume data.

    Parameters

    • octree: any

      The octree associated with the volume data to segment.

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , segmentationContext : VolumeSegmentationContext )

Static Private getCustomVolumeDataInfo

  • getCustomVolumeDataInfo(volID: number, callbackFunc?: any): any
  • Parameters

    • volID: number
    • Optional callbackFunc: any

    Returns any

Static getFiles

  • getFiles(directory: any, callbackFunc?: any): any
  • Parameters

    • directory: any
    • Optional callbackFunc: any

    Returns any

Static getNonImageData

  • getNonImageData(renderEngineID: number, callbackFunc?: any): any
  • Get Non-Image data (GSPS, CADSR, Key Images) for given render engine

    Parameters

    • renderEngineID: number

      The render engine ID

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode )

Static getPresetList

  • getPresetList(directoryPath: string, callbackFunc?: any): any
  • Retrieves a list of presets from the remote server.

    Parameters

    • directoryPath: string
    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , listOfPresetFileNames: Array )

Static getServerOSPlatform

  • getServerOSPlatform(callbackFunc?: any): any
  • Parameters

    • Optional callbackFunc: any

    Returns any

Static getStudyDetails

  • getStudyDetails(callbackFunc?: any): any
  • Parameters

    • Optional callbackFunc: any

    Returns any

Static initiateStudyLoading

  • initiateStudyLoading(directoryPath: any, preloadData?: boolean, callbackFunc?: any): any
  • Parameters

    • directoryPath: any
    • Default value preloadData: boolean = true
    • Optional callbackFunc: any

    Returns any

Static load2DCustomData

  • load2DCustomData(jsonToSend: string, callbackFunc?: any): any
  • description

    Load a dataset using the custom data loader. The custom data loader requires an identifier and parameter list.

    Parameters

    • jsonToSend: string
    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , volumeDataInfo : VolumeDataContext )

Static loadCustomData

  • loadCustomData(jsonToSend: string, buildOctree?: boolean, callbackFunc?: any): any
  • description

    Load a dataset using the custom data loader. The custom data loader requires an identifier and parameter list.

    Parameters

    • jsonToSend: string
    • Default value buildOctree: boolean = true

      If true, and octree is created for the loaded volume data.

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , volumeDataInfo : VolumeDataContext )

Static loadDICOMDir

  • loadDICOMDir(directoryPath: string, buildOctree?: boolean, readStandardDICOMTag?: boolean, callbackFunc?: any): any
  • Loads the specific DICOM dataset based on the supplied path. This directory should include a single 3D-able dataset. The returns a VolumeDataContext. The vdc includes an optional a SeriesDataContext, which includes contains a list of DICOM tags.

    Parameters

    • directoryPath: string

      directory path containin a single DICOM dataset.

    • Default value buildOctree: boolean = true

      automatically build the octree when set to true (default is true)

    • Default value readStandardDICOMTag: boolean = true

      Set to true to read standard DICOM tags (which is default), or false to skip this. This will slow down the call since all DICOM tags are read.

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , volumeDataInfo : VolumeDataContext )

Static Private loadDICOMFilesFromList

  • loadDICOMFilesFromList(): void
  • Returns void

Static Private loadRawDir

  • loadRawDir(): void
  • Returns void

Static Private loadRawFiles

  • loadRawFiles(): void
  • Returns void

Static Private loadVolumeFromDICOMDir

  • loadVolumeFromDICOMDir(directoryPath: string, buildOctree?: boolean, callbackFunc?: any): any
  • Loads the specific DICOM dataset based on the supplied path. This directory should include a single dataset. Unlike loadDICOMDir, this method will not return a SeriesDataContext

    Parameters

    • directoryPath: string

      directory path containin a single DICOM dataset.

    • Default value buildOctree: boolean = true

      If true then octree is created for the loaded volume data.

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , volumeDataInfo : VolumeDataContext )

Static loadVolumeFromSeries

  • loadVolumeFromSeries(sdc: SeriesDataContext, buildOctree?: boolean, callbackFunc?: any): any
  • Loads the specific DICOM dataset based on the series data context. It is expected that the series is "3D-able", or else it will thrown an exception. The returned VolumeDataContext includes a SeriesDataContext which contains a list of DICOM tags.

    Parameters

    • sdc: SeriesDataContext

      series data context witha "3D-able" series

    • Default value buildOctree: boolean = true

      If true then octree is created for the loaded volume data.

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , volumeDataInfo : VolumeDataContext )

Static Private loadVolumeFromSeriesInternal

  • loadVolumeFromSeriesInternal(sdc: SeriesDataContext, buildOctree?: boolean, callbackFunc?: any): any
  • Parameters

    • sdc: SeriesDataContext
    • Default value buildOctree: boolean = true
    • Optional callbackFunc: any

    Returns any

Static loadXMLPreset

  • loadXMLPreset(xmlPresetName: String, callbackFunc?: any): any
  • Loads an XML preset file contating the data for a RenderParams3D structure.

    Parameters

    • xmlPresetName: String

      The file name to load.

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

Static loadXMLTransferFunction

  • loadXMLTransferFunction(xmlFilename: string, callbackFunc?: any): any
  • description

    load the transfer fuction from the xml file for the given xml file name

    Parameters

    • xmlFilename: string

      xml file name to be loaded

    • Optional callbackFunc: any

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

Static pauseServerOperations

  • Pauses all server operations for one volume, all operations will be rejected on server Does not affect calls to other datasets, either segmentation, rendering etc.

    Parameters

    Returns any

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

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

    callbackFunc(err: ReturnCode )

Static release2DImageDataSessionResource

  • release2DImageDataSessionResource(studyInstanceUID: string, callbackFunc?: any): any
  • This call will release all native memory includinging the ( SeriesDataContext) associated with the 2D object. It is CRITICAL that all rendering has completed and that that any associated RenderEngine3D or HTMLViewport objects are released prior to invoking this call. Specifically, ensure that either RenderEngineContext2D.releaseSessionResources OR HTMLViewport.releaseSessionResources has been called and successfully completed, or the internal rendering state will become undefined.

    Parameters

    • studyInstanceUID: string
    • Optional callbackFunc: any

      call back method to 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 )

Static resumeAllServerOperations

  • resumeAllServerOperations(callbackFunc?: any): any
  • Resume server operations for one volume data

    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 )

Static resumeServerOperations

Static saveXMLPreset

  • saveXMLPreset(xmlPresetName: String, rp: RenderParams3D, callbackFunc?: any): any
  • Loads an XML preset file contating the data for a RenderParams3D structure.

    Parameters

    • xmlPresetName: String

      The file name to load.

    • rp: RenderParams3D

      The RenderParams3D structure to save.

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode )

Static saveXMLTransferFunction

  • saveXMLTransferFunction(xmlFilename: string, rrList: Array<RenderRangeParams>, saveTFMasks0to63?: number, saveTFMasks64to127?: number, saveTFMasks128to191?: number, saveTFMasks192to255?: number, callbackFunc?: any): any
  • description

    save the custom render values on given xml file name

    Parameters

    • xmlFilename: string

      xml file name to be written

    • rrList: Array<RenderRangeParams>
    • Default value saveTFMasks0to63: number = 255
    • Default value saveTFMasks64to127: number = 0
    • Default value saveTFMasks128to191: number = 0
    • Default value saveTFMasks192to255: number = 0
    • Optional callbackFunc: any

      call back method to 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 )

Static scanDICOMDir

  • scanDICOMDir(directoryPath: any, preloadData?: boolean, splitByImage?: boolean, reserved?: number, callbackFunc?: any): any
  • Scans the directory and build up a complete patient/study/series and NonImageSeries model of its contents. A ScanDirResults based on the supplied path. This directory should include a single dataset. Unlike loadDICOMDir, this method will not return a SeriesDataContext

    Parameters

    • directoryPath: any

      directory path to be scanned.

    • Default value preloadData: boolean = true

      set to true (default) to preload all data into memory, false otherwise.

    • Default value splitByImage: boolean = false

      Set to false (default), to split each image into sub-series for specific sop class uids

    • Default value reserved: number = 0
    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode , scanDirResults : ScanDirResults )

Static setJPEGQuality

  • setJPEGQuality(interactive: number, final: number): void
  • Specifies the JPEG quality setting used by the server for creation of all images. This is a global setting for the HDVR rendering server.

    Parameters

    • interactive: number

      JPEG interative quality, 20 - lowest quality, 100 - best quality.

    • final: number

      JPEG final quality, 20 - lowest quality, 100 - best quality.

    Returns void

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

Static setRenderingQuality

  • Specifies the default rendering quality setting used by the server. This is a combination of the Quality setting the desired FPS. This is a global setting for the HDVR rendering server.

    Parameters

    • quality: RenderQuality

      Specifies the rendering quality.

    • fps: number

      specifies a hint to the engine for desired frames per second. Specify zero (0) to disable this feature.

    Returns void

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

Static setSessionTimeout

  • setSessionTimeout(timeout: number): void
  • Specifies the default session timeout used by the server for this application (or user session).

    Parameters

    • timeout: number

      default timeout in seconds, must be 0 (no timeout) or greater

    Returns void

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

Static setVolumeFusion

  • description

    Update the volume fusion instance from the given rending engine list

    Parameters

    • renderEngineList: Array<RenderEngineContext3D>

      rendering engine instance

    • interpolationMode: ResampleType

      interpolation mode

    • dominantVolume: FusedVolume

      fuse volume

    • Optional callbackFunc: any

      call back method to 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 )

Static updateCustomPRToNative

  • updateCustomPRToNative(renderEngineID: number, presentationData: any, callbackFunc?: any): any
  • Update the custom presentation data to native

    Parameters

    • renderEngineID: number

      The render engine ID

    • presentationData: any

      The presentation data

    • Optional callbackFunc: any

    Returns any

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

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

    callbackFunc(err: ReturnCode )

Static updateRenderEngine2D

  • updateRenderEngine2D(data: any, callbackFunc?: any): any
  • Parameters

    • data: any
    • Optional callbackFunc: any

    Returns any