VRView

VRView

A class representing a Volume Rendering scene

Constructor

new VRView(element)

Source:

Create a volume rendering scene

Parameters:
Name Type Description
element HTMLElement

the target html element to render the scene

Classes

VRView

Members

blurOnInteraction :bool

Source:

Toggle blurring on interaction (Increase performance)

Type:
  • bool

cropWidget :bool

Source:

Crop widget on / off

Type:
  • bool

edgeEnhancement

Source:

Toggle edge enhancement

lut :String

Source:

Set colormap and opacity function
lutName - as in presets list

Type:
  • String

presetsList :Array

Source:

Presets

Type:
  • Array

rangeLUT :Array

Source:

Set range to apply lut !!! WIP

Type:
  • Array

rescaleLUT :bool

Source:

Flag to set lut rescaling on opacity range

Type:
  • bool

resolution :Number

Source:

raysDistance

Type:
  • Number

sliceOpacity :Number

Source:

Set slice opacity

Type:
  • Number

slicePlane :bool

Source:

Toggle slice plane visibility

Type:
  • bool

slicePosition :Number

Source:

Set slice position [0, 1] along its normal

Type:
  • Number

sliceWwwl :Array

Source:

sliceWwwl

Type:
  • Array

widgetElement :HTMLelement

Source:

PGwidgetElement (set null to hide)

Type:
  • HTMLelement

wwwl :Array

Source:

wwwl

Type:
  • Array

Methods

_initCropWidget()

Source:

Setup crop widget

_initPicker()

Source:

initPicker

addLandmarks(landmarks, render)

Source:

Add landmarks to be rendered as spheres

Parameters:
Name Type Default Description
landmarks Array

[{label, x, y, z, color, radius}]
Use replaceLandmarks() to replace existing landmarks.

render Boolean true

Optional render toggle (default true)

addSurface()

Source:

Add surfaces to be rendered

Parameters:
Type Description
Object

{buffer: bufferarray, fileType?: string, props: Object}
Props contains color, label, opacity, wireframe

clearHighlightedLandmark(render)

Source:

Hide highlighted landmark indicator

Parameters:
Name Type Default Description
render Boolean true

Optional render toggle (default true)

destroy()

Source:

Destroy webgl content and release listeners

getLandmarks() → {Array}

Source:

Get current landmarks state (for debug)

Returns:
  • [{label, x, y, z, color, radius}]
Type
Array

getLutList() → {Array}

Source:

Get vtk LUTs list

Returns:
  • Lut list as array of strings
Type
Array

getSlicePlane() → {Object}

Source:

Get slice plane origin and normal

Returns:

{origin, normal}

Type
Object

replaceLandmarks(landmarks)

Source:

Replace all landmarks in a single render pass

Parameters:
Name Type Description
landmarks Array

[{label, x, y, z, color, radius}]

resetLandmarks(render)

Source:

Remove all landmarks from the scene

Parameters:
Name Type Default Description
render Boolean true

Optional render toggle (default true)

resetMeasurementState(measurementState)

Source:

Reset measurement state to default

Parameters:
Name Type Description
measurementState *

resetView()

Source:

Reset view

resize()

Source:

on resize callback

setHighlightedLandmark(labelOrId, options)

Source:

Highlight a landmark with a red cross indicator

Parameters:
Name Type Description
labelOrId String | Object

Landmark label or landmark-like object

options Object
Properties
Name Type Description
radius Number

Override landmark radius

lengthFactor Number

Scale factor for cross length (default 4)

setImage(image)

Source:

Set the image to be rendered

Parameters:
Name Type Description
image ArrayBuffer

The image content data as buffer array

setPickingEnabled(enabled, options)

Source:

Toggle picking with stored or provided options

Parameters:
Name Type Description
enabled Boolean
options Object
Properties
Name Type Description
onPick function
labels Array.<String>
preserveCallback Boolean

Keep previous callback when updating labels
labels null/[] means "all pickable actors"

setSlicePlane(origin, normal)

Source:

Set slice plane origin and normal

Parameters:
Name Type Description
origin Array
normal Array

setSurfaceVisibility(label, toggle)

Source:

Toggle surface visibility on/off

Parameters:
Name Type Description
label String

The string that identifies the surface

toggle Boolean

setTool(toolName, options, measurementState)

Source:

Set active tool
("Length/Angle", {mouseButtonMask:1}, measurementState)

Parameters:
Name Type Description
toolName *
options *
measurementState *

turnPickingOff()

Source:

Unregister the picking callback.

turnPickingOn(callback, targetLabels)

Source:

Register a callback for picking on a list of actors.
The callback will receive an object with { worldPosition, displayPosition, actorLabel }

Parameters:
Name Type Description
callback function

The function to call on pick.

targetLabels Array.<String>

A list of actor labels to pick from.

updateLandmarkPosition(label, position)

Source:

Update the position of an existing landmark.

Parameters:
Name Type Description
label String

The label of the landmark.

position Array.<Number>

The new position as [x, y, z].

updateSurface(label, buffer, fileType)

Source:

Update surface buffer
TODO maybe there is a more efficient way

Parameters:
Name Type Description
label String

The string that identifies the surface

buffer ArrayBuffer
fileType String

Optional file type ('stl' or 'vtp')