dwv. gui

Classes

DrawLayer
LayerGroup
Stage
Style
ViewLayer

Members

(static) interactionEventNames

List of interaction event names.

Methods

(static) OffsetBinder()

Offset binder.

(static) OpacityBinder()

Opacity binder. Only propagates to view layers of the same data.

(static) PositionBinder()

Position binder.

(static) WindowLevelBinder()

Window/level binder.

(static) ZoomBinder()

Zoom binder.

(static) canCreateCanvas(width, height) → {boolean}

Test if a canvas with the input size can be created.

Parameters:
NameTypeDescription
widthnumber

The canvas width.

heightnumber

The canvas height.

Returns:

True is the canvas can be created.

Type: 
boolean

(static) getElement(containerDivId, name) → {object}

Get a HTML element associated to a container div.

Parameters:
NameTypeDescription
containerDivIdnumber

The id of the container div.

namestring

The name or id to find.

Deprecated
  • Yes
Returns:

The found element or null.

Type: 
object

(static) getEventOffset(event) → {Array}

Get the offset of an input event.

Parameters:
NameTypeDescription
eventobject

The event to get the offset from.

Returns:

The array of offsets.

Type: 
Array

(static) getLayerDetailsFromEvent(event) → {object}

Get the layer details from a mouse event.

Parameters:
NameTypeDescription
eventobject

The event to get the layer div id from. Expecting an event origininating from a canvas inside a layer HTML div with the 'layer' class and id generated with dwv.gui.getLayerDivId.

Returns:

The layer details as {groupDivId, layerId}.

Type: 
object

(static) getLayerDetailsFromLayerDivId(idString) → {object}

Get the layer details from a div id.

Parameters:
NameTypeDescription
idStringstring

The layer div id.

Returns:

The layer details as {groupDivId, layerId}.

Type: 
object

(static) getLayerDivId(groupDivId, layerId) → {string}

Get the layer div id.

Parameters:
NameTypeDescription
groupDivIdstring

The layer group div id.

layerIdnumber

The lyaer id.

Returns:

A string id.

Type: 
string

(static) getScaledOffset(offset, scale, newScale, center) → {object}

Get a scaled offset to adapt to new scale and such as the input center stays at the same position.

Parameters:
NameTypeDescription
offsetobject

The previous offset as {x,y}.

scaleobject

The previous scale as {x,y}.

newScaleobject

The new scale as {x,y}.

centerobject

The scale center as {x,y}.

Returns:

The scaled offset as {x,y}.

Type: 
object

(static) getTargetOrientation(imageOrientation, viewOrientation) → {dwv.math.Matrix33}

Get the target orientation according to an image and view orientation. The target orientation is used to go from target to real space.

Parameters:
NameTypeDescription
imageOrientationdwv.math.Matrix33

The image geometry.

viewOrientationdwv.math.Matrix33

The view orientation.

Returns:

The target orientation.

Type: 
dwv.math.Matrix33

(static) getTouchesPositions(touches) → {Array}

Get the positions (without the parent offset) of a list of touch events.

Parameters:
NameTypeDescription
touchesArray

The list of touch events.

Returns:

The list of positions of the touch events.

Type: 
Array

(static) getViewOrientation(imageOrientation, targetOrientation) → {dwv.math.Matrix33}

Get the view orientation according to an image and target orientation. The view orientation is used to go from target to image space.

Parameters:
NameTypeDescription
imageOrientationdwv.math.Matrix33

The image geometry.

targetOrientationdwv.math.Matrix33

The target orientation.

Returns:

The view orientation.

Type: 
dwv.math.Matrix33

(static) prompt(message, value) → {string}

Prompt the user for some text. Uses window.prompt.

Parameters:
NameTypeDescription
messagestring

The message in front of the input field.

valuestring

The input default value.

Returns:

The new value.

Type: 
string