ViewController

dwv.ctrl. ViewController

new ViewController(view)

Source:

View controller.

Parameters:
Name Type Description
view dwv.image.View

The associated view.

Methods

addWindowLevelPresets(presets) → {object}

Source:

Add window/level presets to the view.

Parameters:
Name Type Description
presets object

A preset object.

Returns:

The list of presets.

Type
object

canQuantifyImage() → {boolean}

Source:

Can the image values be quantified?

Returns:

True if possible.

Type
boolean

canScroll() → {boolean}

Source:

Can the data be scrolled?

Returns:

True if the data has either the third dimension or above greater than one.

Type
boolean

canWindowLevel() → {boolean}

Source:

Can window and level be applied to the data?

Returns:

True if possible.

Type
boolean

decrementIndex(dim, silent) → {boolean}

Source:

Decrement the provided dimension.

Parameters:
Name Type Description
dim number

The dimension to increment.

silent boolean

Do not send event.

Returns:

False if not in bounds.

Type
boolean

decrementScrollIndex(silent) → {boolean}

Source:

Decrement the scroll dimension index.

Parameters:
Name Type Description
silent boolean

Do not send event.

Returns:

False if not in bounds.

Type
boolean

generateImageData(array)

Source:

Generate display image data to be given to a canvas.

Parameters:
Name Type Description
array Array

The array to fill in.

get2DSpacing() → {Array}

Source:

Get the current spacing.

Returns:

The 2D spacing.

Type
Array

getColourMap() → {object}

Source:

Get the colour map.

Returns:

The colour map.

Type
object

getCurrentIndex() → {dwv.math.Index}

Source:

Get the current index.

Returns:

The current index.

Type
dwv.math.Index

getCurrentOrientedPosition() → {dwv.math.Point}

Source:

Get the current oriented position.

Returns:

The position.

Type
dwv.math.Point

getCurrentPosition() → {dwv.math.Point}

Source:

Get the current position.

Returns:

The position.

Type
dwv.math.Point

getCurrentScrollIndexValue() → {object}

Source:

Get the current scroll index value.

Returns:

The value.

Type
object

getCurrentScrollPosition() → {object}

Source:

Get the current scroll position value.

Returns:

The value.

Type
object

getImageRegionValues(min, max) → {Array}

Source:

Get some values from the associated image in a region.

Parameters:
Name Type Description
min dwv.math.Point2D

Minimum point.

max dwv.math.Point2D

Maximum point.

Returns:

A list of values.

Type
Array

getImageSize() → {dwv.image.Size}

Source:

Get the image size.

Returns:

The size.

Type
dwv.image.Size

getImageVariableRegionValues(regions) → {Array}

Source:

Get some values from the associated image in variable regions.

Parameters:
Name Type Description
regions Array

A list of regions.

Returns:

A list of values.

Type
Array

getOffset3DFromPlaneOffset(offset2D) → {dwv.math.Vector3D}

Source:

Get a 3D offset from a plane one.

Parameters:
Name Type Description
offset2D object

The plane offset as {x,y}.

Returns:

The 3D world offset.

Type
dwv.math.Vector3D

getPlaneHelper() → {object}

Source:

Get the plane helper.

Returns:

The helper.

Type
object

getPlanePositionFromPlanePoint(point2D) → {dwv.math.Point3D}

Source:

Get a plane 3D position from a plane 2D position: does not compensate for the image origin. Needed for setting the scale center...

Parameters:
Name Type Description
point2D dwv.math.Point2D

The 2D position as {x,y}.

Returns:

The 3D point.

Type
dwv.math.Point3D

getPositionFromPlanePoint(point2D) → {dwv.math.Point}

Source:

Get a 3D position from a plane 2D position.

Parameters:
Name Type Description
point2D dwv.math.Point2D

The 2D position as {x,y}.

Returns:

The 3D point.

Type
dwv.math.Point

getScrollIndex() → {number}

Source:

Get the scroll index.

Returns:

The index.

Type
number

getWindowLevel() → {object}

Source:

Get the window/level.

Returns:

The window center and width.

Type
object

getWindowLevelPresetsNames() → {Array}

Source:

Get the window/level presets names.

Returns:

The presets names.

Type
Array

incrementIndex(dim, silent) → {boolean}

Source:

Increment the provided dimension.

Parameters:
Name Type Description
dim number

The dimension to increment.

silent boolean

Do not send event.

Returns:

False if not in bounds.

Type
boolean

incrementScrollIndex(silent) → {boolean}

Source:

Increment the scroll dimension index.

Parameters:
Name Type Description
silent boolean

Do not send event.

Returns:

False if not in bounds.

Type
boolean

initialise()

Source:

Initialise the controller.

isPlaying() → {boolean}

Source:

Check if the controller is playing.

Returns:

True if the controler is playing.

Type
boolean

play()

Source:

Scroll play: loop through all slices.

setColourMap(colourMap)

Source:

Set the colour map.

Parameters:
Name Type Description
colourMap object

The colour map.

setColourMapFromName(name)

Source:

Set the colour map from a name.

Parameters:
Name Type Description
name string

The name of the colour map to set.

setCurrentIndex(index, silent) → {boolean}

Source:

Set the current index.

Parameters:
Name Type Description
index dwv.math.Index

The index.

silent boolean

If true, does not fire a positionchange event.

Returns:

False if not in bounds.

Type
boolean

setCurrentPosition(pos, silent) → {boolean}

Source:

Set the current position.

Parameters:
Name Type Description
pos dwv.math.Point

The position.

silent boolean

If true, does not fire a positionchange event.

Returns:

False if not in bounds.

Type
boolean

setCurrentPosition2D(x, y) → {boolean}

Source:

Set the current 2D (x,y) position.

Parameters:
Name Type Description
x number

The column position.

y number

The row position.

Returns:

False if not in bounds.

Type
boolean

setImage(img)

Source:

Set the associated image.

Parameters:
Name Type Description
img Image

The associated image.

setViewAlphaFunction(func)

Source:

Set the view per value alpha function.

Parameters:
Name Type Description
func function

The function.

setWindowLevel(wc, ww)

Source:

Set the window/level.

Parameters:
Name Type Description
wc number

The window center.

ww number

The window width.

setWindowLevelPreset(name)

Source:

Set the window level to the preset with the input name.

Parameters:
Name Type Description
name string

The name of the preset to activate.

setWindowLevelPresetById(id)

Source:

Set the window level to the preset with the input id.

Parameters:
Name Type Description
id number

The id of the preset to activate.

stop()

Source:

Stop scroll playing.