Global

Members

cacheSizeInBytes

Source:
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 Default Description
taskType the taskType for this task
data data specific to the task
priority 0 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()

Source:
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

framesAreFragmented()

Source:
Function to deal with extracting an image frame from an encapsulated data set.

getMinMax(storedPixelData) → {Object}

Source:
Calculate the minimum and maximum values in an Array
Parameters:
Name Type Description
storedPixelData Array.<Number>
Returns:
Type
Object

getNumberString(element, indexopt, defaultValueopt) → {*}

Source:
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) → {*}

Source:
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

getTransferSyntaxForContentType(contentType)

Source:
Helper method to extract the transfer-syntax from the response of the server.
Parameters:
Name Type Description
contentType string The value of the content-type header as returned by the WADO-RS server.
Returns:
The transfer-syntax as announced by the server, or Implicit Little Endian by default.

getUncompressedImageFrame()

Source:
Function to deal with extracting an image frame from an encapsulated data set.

getValue(element, indexopt, defaultValueopt) → {*}

Source:
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

handler()

Source:
Task handler function

initialize(data)

Source:
Initialization function that loads additional web workers and initializes them
Parameters:
Name Type Description
data

initialize()

Source:
Task initialization function

initialize(configObject)

Source:
Initialization function for the web worker manager - spawns web workers
Parameters:
Name Type Description
configObject

loadCodecs(config)

Source:
Function to control loading and initializing the codecs
Parameters:
Name Type Description
config

loadWebWorkerTask(sourcePath, taskConfig)

Source:
dynamically loads a web worker task
Parameters:
Name Type Description
sourcePath
taskConfig

loadWebWorkerTask(data)

Source:
Function to load a new web worker task with updated configuration
Parameters:
Name Type Description
data

registerLoaders(cornerstone)

Source:
Register the WADO-URI and WADO-RS image loaders and metaData providers with an instance of Cornerstone Core.
Parameters:
Name Type Description
cornerstone The Cornerstone Core library to register the image loaders with

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 Default Description
taskId the taskId to change the priority of
priority 0 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

terminate()

Source:
Terminate all running web workers.

unpackBinaryFrame()

Source:
Function to deal with unpacking a binary frame