Class RenderParams3D

A RenderParams3D object stores the complete state of a render engine. This includes properties such as render engine type, transfer function, viewpoint position, image size, cut and clip planes, and other parameters.

Hierarchy

Index

Constructors

constructor

Properties

ambience

ambience: number

Phong lighting ambience coefficient. Only applicable for Parellel and Perspective rendering modes. Values from [0..255] will map to coefficients of [0..1] in the lighting calculation.

applyLightsToPolygon

applyLightsToPolygon: boolean

If true, apply lights to the polygon while rendering

autoNavEnabled

autoNavEnabled: boolean

If true enables auto-navigation mode.

autoNavSpeed

autoNavSpeed: number

Sets the camera speed for auto-navigation mode. See RenderParams3D.autoNavEnabled.

backgroundColor

backgroundColor: Color

The background color behind the rendered image. Note that in Thin rendering modes the background will always be black since we supply 8-bit grayscale output. Also note that due to implementation details valid values are 0-254 for each component at this time. Therefore, pure white (255, 255, 255) is not achievable.

brightness

brightness: number

Phong lighting brightness coefficient. Only applicable for Parellel and Perspective rendering modes. Values from [0..255] will map to coefficients of [0..1] in the lighting calculation.

cutPlaneList

cutPlaneList: Array<CutPlane>

An array of planes used to cut away subsets of the volume. A total of 16 cut planes may be defined. Cut planes may be used with Parallel and all thick rendering modes.

Note: Two additional cutplanes are implicitly provided by the projection plane itself and the slab thickness.

Private desiredFPS

desiredFPS: number

enableFrontClippingPlane

enableFrontClippingPlane: boolean

Enables the front clipping plane if true. Otherwise the eye is locked to the outside of the volume.

enableGradientRendering

enableGradientRendering: boolean

Instructs render engine to use volume data gradients for lighting.

enableSlabMode

enableSlabMode: boolean

Enables slab mode, see RenderParams3D.slabThickness.

frontSlabPolygonTransparency

frontSlabPolygonTransparency: number

Sets the transparency of polygon objects in front of the projection plane. If 0, objects in front of the projection plane are fully visible. If 255, objects in front of the projection plane are not visible at all. Values in between will be represented by intermediate levels of transparency.

gradientLightingAtSlabSurface

gradientLightingAtSlabSurface: number

This is the distance from any cut plane (including the front of the slab) in volume units in which the renderer will not do the lighting calculation. This includes the cut planes defined by the slab created between the projection plane position and said position + slabThickness. This field is only valid for parallel rendering. Note that you can also affect the lighting calculation by toggling lighting for a ColoredPoint on the transfer function. Acceptable values are [0, 4096].

IMPORTANT: The depth is calculated as a distance from the eye location in the view direction. This means that the depth is dependent upon the view direction. Therefore, all cut planes other than the front of the slab will have their lighting depth move based upon your viewing angle in 8 * relation to the cut plane. The exception to this is when gradientLightingAtSlabSurface is set to 1. This special case will turn off lighting for the surface of the cut plane and will not have this view direction dependent behavior. As a result, 0,1, and 4096 are the recommended values to use for this field.

imageHeight

imageHeight: number

The height, in pixels, of the image to be rendered. The width and height must be multiples of 16 and the current maximum render image size is 4096x4096.

imageWidth

imageWidth: number

The width, in pixels, of the image to be rendered. The width and height must be multiples of 16 and the current maximum render image size is 4096x4096.

level

level: number

The level value, when rendering in window/level mode.

lightAttachmentMode

lightAttachmentMode: LightAttachmentMode

Sets the light attachment mode. If set to LightAttachmentMode.camera, light moves with the camera. If set to LightAttachmentMode.dataset, light position is fixed to dataset.

lightDirection

lightDirection: Vector

Light direction. If the light is attached to the camera, this is the amount to rotate along the x, y, and z axes in radians. Otherwise, it's the literal direction in volume coordinates.

Private minQualityBias

minQualityBias: number

name

name: string = RenderParams3D.className

Private normalizeTFflag

normalizeTFflag: boolean

Private numRenderingThreads

numRenderingThreads: number

outputRGBForThinMode

outputRGBForThinMode: boolean

If true, instructs the engine to output RGB images from thin rendering modes instead of 8-bit grayscale. Full bit depth output will still be 16-bit grayscale.

polygonLinesInScreenSpace

polygonLinesInScreenSpace: boolean

If PolygonContext objects are drawn as lines, by default the line width is in millimeters. If this flag is set to true line width is calculated in screen space.

polygonsUseCutPlanes

polygonsUseCutPlanes: boolean

If true, cut planes defined in RenderParams3D.cutPlaneList will also cut PolygonContext objects. If false, PolygonContext objects are unaffected by cut planes.

Private printDebug

printDebug: boolean

Private quality

quality: number

Private raycastingPrecision

raycastingPrecision: number

rearSlabPolygonTransparency

rearSlabPolygonTransparency: number

Sets the transparency of polygon objects in back of the clip plane SlabThickness volume units from the projection plane. If 0, objects in this area are fully visible. If 255, objects in this area are not visible at all. Values in between will be represented by intermediate levels of transparency.

Note: Unlike the front slab transparency, this is implemented internally by manually cutting all polygons that cross the projection plane into two polygons and applying the appropriate transparency. As a result, all vertices will be transformed with every movement of the slab and this function is not free. Therefore, it is advised to use this function sparingly if very high polygon counts are to be used.

reflection

reflection: number

Phong lighting reflection coefficient. Only applicable for Parellel and Perspective rendering modes. Values from [0..255] will map to coefficients of [0..1] in the lighting calculation.

renderPolygonAsCrossSectionLines

renderPolygonAsCrossSectionLines: boolean

If true, renders PolygonContext objects as cross sections. This field is only supported by render modes supporting RGB output.

renderRanges

renderRanges: Array<RenderRangeParams>

An arry of RenderRangeParams objects defining transfer function 0. To set transfer functions for label volumes 1-7, use RenderEngineContext3D.setTransferFunction()

Private renderSamples

renderSamples: number

renderType

renderType: RenderType

The type of render engine, parallel, perspective, mpr, etc.

shininess

shininess: number

Phong lighting shininess coefficient. Only applicable for Parellel and Perspective rendering modes. Values from [0..255] will map to coefficients of [0..1] in the lighting calculation.

slabThickness

slabThickness: number

When rendering in MIP modes or in Parallel mode with RenderParams3D.enableSlabMode set to true, this describes the distance from the projection plane in volume units where we should stop our rays from continuing. A slab thickness of 0 is an infinitely think slab and in MIP/MPR rendering the voxels are sampled directly in a thin slice. The maximum recommended value for thin rendering modes is 50. Otherwise, the maximum acceptable value is 4096.

stereoMode

stereoMode: StereoMode

Allows you to put the engine into stereo viewing mode. Note that stereo viewing is not supported for thin rendering modes. Also, when stereo is enabled in parallel rendering, you will not be able to cut through the volume with the projection plane (or slabThickness).

stereoSeparation

stereoSeparation: number

Specify 0.0 for an automatic separation calculated based upon the average depth of the scene. Otherwise, a number in the range (0,1] should be specified.

transform

transform: Matrix

The transform used for rendering includes X,Y,Z orientation vectors and an offset from the origin.

X - Defined as the direction from the left of the screen to the right of the screen. Y - Defined as the direction from the top of the screen to the bottom of the screen. Z - Defined as the view direction. In other words, a vector pointing "into" the screen. Offset - The location of the center of the screen in the volume. In perspective rendering, this is the eye location in the volume.

For best results, the vectors of the transform should be normalized and orthogonal to each other.

In all but perspective rendering, the scaling of the rendering is specified separately through the RenderParams3D.zoom field. In perspective, the RenderParams3D.viewAngle field becomes relevant.

The identity matrix will place the camera at the location 0,0,0 viewing axially.

viewAngle

viewAngle: number

The field of view for perspective rendering. Should be in the range 6-150.

window

window: number

The window value, when rendering in window/level mode.

zoom

zoom: number

Zoom is defined as the number of pixels per voxel in the rendered image. For example, if the Zoom is set to 2, that means that every voxel is 2 pixels in size. The voxel size in this definition is the size in volume units specified in VolumeDataContext.spacing.x field. Note that the Pespective rendering mode ignores this value. The maximum acceptable value for Zoom is 700.0.

Static className

className: string = "RenderParams3D"

Methods

combinewithRP

setAmbience

  • setAmbience(ambience: number, unused?: any): void
  • Sets the Phong lighting ambience coefficient. Only applicable for Parellel and Perspective rendering modes. Values from [0..255] will map to coefficients of [0..1] in the lighting calculation.

    Parameters

    • ambience: number

      The ambience value.

    • Optional unused: any

    Returns void

setApplyLightsToPolygon

  • setApplyLightsToPolygon(applyLightsToPolygon: boolean, unused?: any): void
  • Specify if the lights should be applied to the polygon, based on the current polygon lighting values with the render engine.

    Parameters

    • applyLightsToPolygon: boolean
    • Optional unused: any

    Returns void

setBackgroundColor

  • setBackgroundColor(r: any, g?: any, b?: any): void
  • Sets the backgroundColor field.

    Parameters

    • r: any

      Red color component, 0 - 255.

    • Default value g: any = 0

      Green color component, 0 - 255.

    • Default value b: any = 0

      Blue color component, 0 - 255.

    Returns void

setBrightness

  • setBrightness(brightness: number, unused?: any): void
  • Sets the Phong lighting brightness coefficient. Only applicable for Parellel and Perspective rendering modes. Values from [0..255] will map to coefficients of [0..1] in the lighting calculation.

    Parameters

    • brightness: number

      The brightness value.

    • Optional unused: any

    Returns void

setCutPlanes

  • setCutPlanes(cutPlaneList: Array<CutPlane>, unused?: any): void
  • Sets array of cut planes. Up to 16 cut planes are supported.

    Parameters

    • cutPlaneList: Array<CutPlane>

      An array of cut planes.

    • Optional unused: any

    Returns void

setDesiredFPS

  • setDesiredFPS(desiredFPS: number, unused?: any): void
  • Parameters

    • desiredFPS: number
    • Optional unused: any

    Returns void

setEnableFrontClippingPlane

  • setEnableFrontClippingPlane(enableFrontClippingPlane: boolean, unused?: any): void
  • Enables the front clipping plane if true. Otherwise the eye is locked to the outside of the volume.

    Parameters

    • enableFrontClippingPlane: boolean

      Turns clipping plane on or off.

    • Optional unused: any

    Returns void

setEnableGradientLighting

  • setEnableGradientLighting(enable: boolean, unused?: any): void
  • Instructs render engine to use volume data gradients for lighting.

    Parameters

    • enable: boolean

      If true gradients are used for lighting calulation. If false, gradients are not used.

    • Optional unused: any

    Returns void

setEnableSlabMode

  • setEnableSlabMode(enableSlabMode: boolean, unused?: any): void
  • Sets the enableSlabMode value.

    Parameters

    • enableSlabMode: boolean

      Turns the slab mode on or off.

    • Optional unused: any

    Returns void

setFrontSlabPolygonTransparency

  • setFrontSlabPolygonTransparency(frontSlabPolygonTransparency: number, unused?: any): void
  • Sets the transparency of polygon objects in front of the projection plane.

    Parameters

    • frontSlabPolygonTransparency: number

      The polygon transparancy value.

    • Optional unused: any

    Returns void

setGradientLightingAtSlabSurface

  • setGradientLightingAtSlabSurface(enable: number, unused?: any): void
  • Sets the distance from any cut plane (including the front of the slab) in volume units in which the renderer will not do the lighting calculation.

    Parameters

    • enable: number

      The gradientLightingAtSlabSurface distance value.

    • Optional unused: any

    Returns void

setLightModel

  • Sets the light attachment mode and light direction vector.

    Parameters

    • lightAttachmentMode: LightAttachmentMode

      A LightAttachmentMode value designating the attachment type.

    • lightDirection: Vector

      A direction vector.

    • Optional unused: any

    Returns void

Private setNormalizeTFflag

  • setNormalizeTFflag(normalizeTFflag: boolean, unused?: any): void
  • Parameters

    • normalizeTFflag: boolean
    • Optional unused: any

    Returns void

setOrientation

  • setOrientation(orientation: ViewType): void
  • Sets the transfomation matrix with the specified orientation.

    Parameters

    Returns void

setOutputRGBForThinMode

  • setOutputRGBForThinMode(outputRGBForThinMode: boolean, unused?: any): void
  • Sets thin engines to output RGB instead of grayscale images.

    Parameters

    • outputRGBForThinMode: boolean

      If true thin engines output RGB images. If false, grayscale images are generated.

    • Optional unused: any

    Returns void

setPolygonLinesInScreenSpace

  • setPolygonLinesInScreenSpace(enable: boolean, unused?: any): void
  • Sets the PolygonContext line drawing mode.

    Parameters

    • enable: boolean

      Enables/disables screen space line drawing mode.

    • Optional unused: any

    Returns void

setPolygonsUseCutPlanes

  • setPolygonsUseCutPlanes(enable: boolean, unused?: any): void
  • Determines if PolygonContext objects are affected by cut planes.

    Parameters

    • enable: boolean

      If true, PolygonContext objects are clipped by cut planes. If false, PolygonContext objects are unaffected by cut planes.

    • Optional unused: any

    Returns void

setQuality

  • Parameters

    Returns void

setRearSlabPolygonTransparency

  • setRearSlabPolygonTransparency(rearSlabPolygonTransparency: number, unused?: any): void
  • Sets the transparency of polygon objects in behind the projection plane.

    Parameters

    • rearSlabPolygonTransparency: number

      The polygon transparancy value.

    • Optional unused: any

    Returns void

setReflection

  • setReflection(reflection: number, unused?: any): void
  • Sets the Phong lighting reflection coefficient. Only applicable for Parellel and Perspective rendering modes. Values from [0..255] will map to coefficients of [0..1] in the lighting calculation.

    Parameters

    • reflection: number

      The reflection value.

    • Optional unused: any

    Returns void

setRenderImageSize

  • setRenderImageSize(width: number, height: number, unused?: any): void
  • Sets the imageWidth and imageHeight fields. This function will automatically scale the width and height parameters to a multiple of 16, as required by the rendering engine.

    Parameters

    • width: number

      The output image width in pixels.

    • height: number

      The output image height in pixels.

    • Optional unused: any

    Returns void

setRenderPolygonAsCrossSectionLines

  • setRenderPolygonAsCrossSectionLines(enable: boolean, unused?: any): void
  • Sets the PolygonContext object to render as a cross section.

    Parameters

    • enable: boolean

      Enables/disables PolygonContext cross section mode.

    • Optional unused: any

    Returns void

setRenderType

  • setRenderType(renderType: any, unused?: any): void
  • Sets the renderType field.

    Parameters

    • renderType: any

      The render type to set.

    • Optional unused: any

    Returns void

setShininess

  • setShininess(shininess: number, unused?: any): void
  • Sets the Phong lighting shininess coefficient. Only applicable for Parellel and Perspective rendering modes. Values from [0..255] will map to coefficients of [0..1] in the lighting calculation.

    Parameters

    • shininess: number

      The shininess value.

    • Optional unused: any

    Returns void

setSlabThickness

  • setSlabThickness(slabThickness: number, unused?: any): void
  • Sets the slabThickness field.

    Parameters

    • slabThickness: number

      The slab thickness.

    • Optional unused: any

    Returns void

setStereoMode

  • setStereoMode(stereoMode: StereoMode, unused?: any): void
  • Allows you to put the engine into stereo viewing mode. Note that stereo viewing is not supported for thin rendering modes. Also, when stereo is enabled in parallel rendering, you will not be able to cut through the volume with the projection plane (or slabThickness).

    Parameters

    • stereoMode: StereoMode

      A StereoMode value.

    • Optional unused: any

    Returns void

setStereoSeparation

  • setStereoSeparation(stereoSeparation: number, unused?: any): void
  • Specify 0.0 for an automatic separation calculated based upon the average depth of the scene. Otherwise, a number in the range (0,1] should be specified.

    Parameters

    • stereoSeparation: number

      The seperation value.

    • Optional unused: any

    Returns void

setTransferFunction

  • setTransferFunction(renderRangeParamsList: Array<RenderRangeParams>, unused?: any): void

setTransform

  • setTransform(transform: Matrix, unused?: any): void
  • Sets the transfomation matrix for the viewpoint.

    Parameters

    • transform: Matrix

      An input transformation matix to be applied to the viewpoint.

    • Optional unused: any

    Returns void

setViewAngle

  • setViewAngle(viewAngle: number, unused?: any): void
  • Sets the field of view. Should be in the range 6-150.

    Parameters

    • viewAngle: number

      The field of view value.

    • Optional unused: any

    Returns void

setWindowLevel

  • setWindowLevel(window: number, level: number, unused?: any): void
  • Sets the window and level fields.

    Parameters

    • window: number

      The window value.

    • level: number

      The level value.

    • Optional unused: any

    Returns void

setZoom

  • setZoom(zoom: number, unused?: any): void
  • Zoom is defined as the number of pixels per voxel in the rendered image. For example, if the Zoom is set to 2, that means that every voxel is 2 pixels in size. The voxel size in this definition is the size in volume units specified in VolumeDataContext.spacing.x field. Note that the Pespective rendering mode ignores this value. The maximum acceptable value for Zoom is 700.0.

    Parameters

    • zoom: number

      The zoom value.

    • Optional unused: any

    Returns void

toString

  • toString(): String
  • Returns String

Static createDefaultRenderParams

  • Example for creating a complete rendering parameters structure programatically

    Parameters

    Returns RenderParams3D