Classes
Methods
addWindowLevelPresets(presets) → {object}
Add window/level presets to the view.
Name | Type | Description |
---|---|---|
presets | object | A preset object. |
The list of presets.
- Type:
- object
bindImageAndLayer(viewLayer)
Bind the view image to the provided layer.
Name | Type | Description |
---|---|---|
viewLayer | ViewLayer | The layer to bind. |
canQuantifyImage() → {boolean}
Can the image values be quantified?
True if possible.
- Type:
- boolean
canScroll() → {boolean}
Can the data be scrolled?
True if the data has either the third dimension or above greater than one.
- Type:
- boolean
canWindowLevel() → {boolean}
Can window and level be applied to the data?
- Deprecated
- Since v0.33, please use isMonochrome instead.
True if possible.
- Type:
- boolean
decrementIndex(dim, silentopt) → {boolean}
Decrement the provided dimension.
Name | Type | Attributes | Description |
---|---|---|---|
dim | number | The dimension to increment. | |
silent | boolean | <optional> | Do not send event. |
False if not in bounds.
- Type:
- boolean
decrementScrollIndex(silentopt) → {boolean}
Decrement the scroll dimension index.
Name | Type | Attributes | Description |
---|---|---|---|
silent | boolean | <optional> | Do not send event. |
False if not in bounds.
- Type:
- boolean
equalImageMeta(meta) → {boolean}
Compare the input meta data to the associated image one.
Name | Type | Description |
---|---|---|
meta | object | The meta data. |
True if the associated image has equal meta data.
- Type:
- boolean
generateImageData(array, indexopt)
Generate display image data to be given to a canvas.
Name | Type | Attributes | Description |
---|---|---|---|
array | ImageData | The array to fill in. | |
index | Index | <optional> | Optional index at which to generate, otherwise generates at current index. |
get2DSpacing() → {Scalar2D}
Get the current view (2D) spacing.
The spacing as a 2D array.
- Type:
- Scalar2D
getColourMap() → {string}
Get the colour map.
The colour map name.
- Type:
- string
getCurrentImageUid() → {string}
Get the SOP image UID of the current image.
The UID.
- Type:
- string
getCurrentIndex() → {Index}
Get the current index.
The current index.
- Type:
- Index
getCurrentOrientedIndex() → {Index}
Get the current oriented index.
The index.
- Type:
- Index
getCurrentPosition() → {Point}
Get the current position.
The position.
- Type:
- Point
getCurrentScrollIndexValue() → {object}
Get the current scroll index value.
The value.
- Type:
- object
getCurrentScrollPosition() → {number}
Get the current scroll position value.
The value.
- Type:
- number
getCurrentWindowPresetName() → {string}
Get the current window level preset name.
The preset name.
- Type:
- string
getDecrementPosition(dim) → {Point}
Get the current position decremented in the input direction.
Name | Type | Description |
---|---|---|
dim | number | The direction in which to decrement. |
The resulting point.
- Type:
- Point
getDecrementScrollPosition() → {Point}
Get the current position decremented in the scroll direction.
The resulting point.
- Type:
- Point
getImageRegionValues(min, max) → {Array}
Get some values from the associated image in a region.
A list of values.
- Type:
- Array
getImageRescaledDataRange() → {object}
Get the image rescaled data range.
The range as {min, max}.
- Type:
- object
getImageSize() → {Size}
Get the oriented image size.
The size.
- Type:
- Size
getImageVariableRegionValues(regions) → {Array}
Get some values from the associated image in variable regions.
Name | Type | Description |
---|---|---|
regions | Array.<Array.<Array.<number>>> | A list of [x, y] pairs (min, max). |
A list of values.
- Type:
- Array
getImageWorldSize() → {Scalar2D}
Get the image world (mm) 2D size.
The 2D size as {x,y}.
- Type:
- Scalar2D
getIncrementPosition(dim) → {Point}
Get the current position incremented in the input direction.
Name | Type | Description |
---|---|---|
dim | number | The direction in which to increment. |
The resulting point.
- Type:
- Point
getIncrementScrollPosition() → {Point}
Get the current position decremented in the scroll direction.
The resulting point.
- Type:
- Point
getIndexFromPosition(point) → {Index}
Get the index of a world position.
Name | Type | Description |
---|---|---|
point | Point | The 3D position. |
The index.
- Type:
- Index
getModality() → {string}
Get the image modality.
The modality.
- Type:
- string
getOffset3DFromPlaneOffset(offset2D) → {Vector3D}
Get a 3D offset from a plane one.
Name | Type | Description |
---|---|---|
offset2D | Scalar2D | The plane offset as {x,y}. |
The 3D world offset.
- Type:
- Vector3D
getOrigin(positionopt) → {Point3D}
Get the first origin or at a given position.
Name | Type | Attributes | Description |
---|---|---|---|
position | Point | <optional> | Optional position. |
The origin.
- Type:
- Point3D
getOriginForImageUid(uid) → {Point3D|undefined}
Get the image origin for a image UID.
Name | Type | Description |
---|---|---|
uid | string | The UID. |
The origin.
- Type:
- Point3D |
undefined
getPixelUnit() → {string}
Get the image pixel unit.
The unit.
- Type:
- string
getPlaneHelper() → {PlaneHelper}
Get the plane helper.
- Source
The helper.
- Type:
- PlaneHelper
getPlanePoints(position) → {Array.<Point3D>}
Get a list of points that define the plane at input position, given this classes orientation.
Name | Type | Description |
---|---|---|
position | Point | The position. |
An origin and 2 cosines vectors.
- Type:
- Array.<Point3D>
getPlanePositionFromPlanePoint(point2D) → {Point3D}
Get a plane 3D position from a plane 2D position: does not compensate for the image origin. Needed for setting the scale center...
Name | Type | Description |
---|---|---|
point2D | Point2D | The 2D position. |
The 3D point.
- Type:
- Point3D
getPlanePositionFromPosition(point) → {Point2D}
Get a 2D plane position from a world position.
Name | Type | Description |
---|---|---|
point | Point | The 3D position. |
The 2D position.
- Type:
- Point2D
getPositionFromPlanePoint(point2D, kopt) → {Point}
Get a world position from a 2D plane position.
Name | Type | Attributes | Description |
---|---|---|---|
point2D | Point2D | The input point. | |
k | number | <optional> | Optional slice index, if undefined, uses the current one. |
The associated position.
- Type:
- Point
getRescaledImageValue(position) → {number|undefined}
Get the image rescaled value at the input position.
Name | Type | Description |
---|---|---|
position | Point | The input position. |
The image value or undefined if out of bounds or no quantifiable (for ex RGB).
- Type:
- number |
undefined
getScrollIndex() → {number}
Get the scroll index.
The index.
- Type:
- number
getWindowLevel() → {WindowLevel}
Get the window/level.
The window and level.
- Type:
- WindowLevel
getWindowLevelPresetsNames() → {Array.<string>}
Get the window/level presets names.
The presets names.
- Type:
- Array.<string>
includesImageUid(uid) → {boolean}
Check if the image includes an UID.
Name | Type | Description |
---|---|---|
uid | string | The UID. |
True if present.
- Type:
- boolean
incrementIndex(dim, silentopt) → {boolean}
Increment the provided dimension.
Name | Type | Attributes | Description |
---|---|---|---|
dim | number | The dimension to increment. | |
silent | boolean | <optional> | Do not send event. |
False if not in bounds.
- Type:
- boolean
incrementScrollIndex(silentopt) → {boolean}
Increment the scroll dimension index.
Name | Type | Attributes | Description |
---|---|---|---|
silent | boolean | <optional> | Do not send event. |
False if not in bounds.
- Type:
- boolean
initialise()
Initialise the controller.
isAquisitionOrientation() → {boolean}
Is this view in the same orientation as the image aquisition.
True if in aquisition plane.
- Type:
- boolean
isMask() → {boolean}
Check is the associated image is a mask.
- Source
True if the associated image is a mask.
- Type:
- boolean
isMonochrome() → {boolean}
Is the data monochrome.
True if the data is monochrome.
- Type:
- boolean
isPlaying() → {boolean}
Check if the controller is playing.
True if the controler is playing.
- Type:
- boolean
isPositionInBounds(positionopt) → {boolean}
Check if the current position (default) or the provided position is in bounds.
Name | Type | Attributes | Description |
---|---|---|---|
position | Point | <optional> | Optional position. |
True is the position is in bounds.
- Type:
- boolean
moreThanOne(dim) → {boolean}
Is the data size larger than one in the given dimension?
Name | Type | Description |
---|---|---|
dim | number | The dimension. |
True if the image size is larger than one in the given dimension.
- Type:
- boolean
play()
Scroll play: loop through all slices.
setColourMap(name)
Set the colour map.
Name | Type | Description |
---|---|---|
name | string | The colour map name. |
setCurrentIndex(index, silentopt) → {boolean}
Set the current index.
Name | Type | Attributes | Description |
---|---|---|---|
index | Index | The index. | |
silent | boolean | <optional> | If true, does not fire a positionchange event. |
False if not in bounds.
- Type:
- boolean
setCurrentPosition(pos, silentopt) → {boolean}
Set the current position.
Name | Type | Attributes | Description |
---|---|---|---|
pos | Point | The position. | |
silent | boolean | <optional> | If true, does not fire a positionchange event. |
False if not in bounds.
- Type:
- boolean
setImage(img)
Set the associated image.
Name | Type | Description |
---|---|---|
img | Image | The associated image. |
setViewAlphaFunction(func)
Set the view per value alpha function.
Name | Type | Description |
---|---|---|
func | alphaFn | The function. |
setWindowLevel(wl)
Set the window and level.
Name | Type | Description |
---|---|---|
wl | WindowLevel | The window and level. |
setWindowLevelPreset(name)
Set the window level to the preset with the input name.
Name | Type | Description |
---|---|---|
name | string | The name of the preset to activate. |
setWindowLevelPresetById(id)
Set the window level to the preset with the input id.
Name | Type | Description |
---|---|---|
id | number | The id of the preset to activate. |
stop()
Stop scroll playing.
unbindImageAndLayer(viewLayer)
Unbind the view image to the provided layer.
Name | Type | Description |
---|---|---|
viewLayer | ViewLayer | The layer to bind. |