Members
loadedDataSets
This object supports loading of DICOM P10 dataset from a uri and caching it so it can be accessed
by the caller. This allows a caller to access the datasets without having to go through cornerstone's
image loader mechanism. One reason a caller may need to do this is to determine the number of frames
in a multiframe sop instance so it can create the imageId's correctly.
Methods
addTask(taskType, data, priority, transferList) → {*}
- Source:
Function to add a decode task to be performed
Parameters:
| Name | Type | Description |
|---|---|---|
taskType |
the taskType for this task | |
data |
data specific to the task | |
priority |
optional priority of the task (defaults to 0), > 0 is higher, < 0 is lower | |
transferList |
optional array of data to transfer to web worker |
Returns:
- Type
- *
arrayBufferToString()
Special decoder for 8 bit jpeg that leverages the browser's built in JPEG decoder for increased performance
cancelTask(taskId, reason)
- Source:
Cancels a queued task and rejects
Parameters:
| Name | Type | Description |
|---|---|---|
taskId |
the taskId to cancel | |
reason |
optional reason the task was rejected |
Returns:
boolean - true on success, false if taskId not found
decodeTaskHandler()
Task handler function
decodeTaskInitialize()
Task initialization function
framesAreFragmented()
Function to deal with extracting an image frame from an encapsulated data set.
getNumberString(element, indexopt, defaultValueopt) → {*}
Returns the first string value as a Javascript number
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
element |
The javascript object for the specified element in the metadata | ||
index |
<optional> |
the index of the value in a multi-valued element, default is 0 | |
defaultValue |
<optional> |
The default value to return if the element does not exist |
Returns:
- Type
- *
getNumberValues(element, minimumLengthopt) → {*}
Returns the values as an array of javascript numbers
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
element |
The javascript object for the specified element in the metadata | ||
minimumLength |
<optional> |
the minimum number of values |
Returns:
- Type
- *
getStatistics()
- Source:
Function to return the statistics on running web workers
Returns:
object containing statistics
getUncompressedImageFrame()
Function to deal with extracting an image frame from an encapsulated data set.
getValue(element, indexopt, defaultValueopt) → {*}
Returns the raw value
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
element |
The javascript object for the specified element in the metadata | ||
index |
<optional> |
the index of the value in a multi-valued element, default is 0 | |
defaultValue |
<optional> |
The default value to return if the element does not exist |
Returns:
- Type
- *
handleMessageFromWorker(msg)
- Source:
Function to handle a message from a web worker
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
initialize(configObject)
- Source:
Initialization function for the web worker manager - spawns web workers
Parameters:
| Name | Type | Description |
|---|---|---|
configObject |
initialize(data)
- Source:
Initialization function that loads additional web workers and initializes them
Parameters:
| Name | Type | Description |
|---|---|---|
data |
loadCodecs(config)
Function to control loading and initializing the codecs
Parameters:
| Name | Type | Description |
|---|---|---|
config |
loadWebWorkerTask(data)
- Source:
Function to load a new web worker task with updated configuration
Parameters:
| Name | Type | Description |
|---|---|---|
data |
loadWebWorkerTask(sourcePath, taskConfig)
- Source:
dynamically loads a web worker task
Parameters:
| Name | Type | Description |
|---|---|---|
sourcePath |
||
taskConfig |
registerTaskHandler(taskHandler)
- Source:
Function exposed to web worker tasks to register themselves
Parameters:
| Name | Type | Description |
|---|---|---|
taskHandler |
setPixelDataType(imageFrame)
- Source:
Helper function to set pixel data to the right typed array. This is needed because web workers
can transfer array buffers but not typed arrays
Parameters:
| Name | Type | Description |
|---|---|---|
imageFrame |
setTaskPriority(taskId, priority)
- Source:
Changes the priority of a queued task
Parameters:
| Name | Type | Description |
|---|---|---|
taskId |
the taskId to change the priority of | |
priority |
priority of the task (defaults to 0), > 0 is higher, < 0 is lower |
Returns:
boolean - true on success, false if taskId not found
spawnWebWorker()
- Source:
Spawns a new web worker
startTaskOnWebWorker()
- Source:
Function to start a task on a web worker
unpackBinaryFrame()
Function to deal with unpacking a binary frame