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

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)

Source:

Add landmarks to be rendered as spheres

Parameters:
Name Type Description
landmarks Array

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

addSurface()

Source:

Add surfaces to be rendered

Parameters:
Type Description
Object

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

destroy()

Source:

Destroy webgl content and release listeners

getLutList() → {Array}

Source:

Get vtk LUTs list

Returns:
  • Lut list as array of strings
Type
Array

resetMeasurementState(measurementState)

Source:

Reset measurement state to default

Parameters:
Name Type Description
measurementState *

resetView()

Source:

Reset view

resize()

Source:

on resize callback

setImage(image)

Source:

Set the image to be rendered

Parameters:
Name Type Description
image ArrayBuffer

The image content data as buffer 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')