Members
cacheSizeInBytes
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()
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
(async) decodeAsync(compressedImageFrame, imageInfo)
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
compressedImageFrame |
* | |||||||
imageInfo |
object |
Properties
|
(async) decodeAsync(compressedImageFrame, imageInfo)
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
compressedImageFrame |
* | |||||||
imageInfo |
object |
Properties
|
(async) decodeAsync(compressedImageFrame, imageInfo)
- Source:
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
compressedImageFrame |
* | |||||||
imageInfo |
object |
Properties
|
(async) decodeImageFrame()
- Source:
Decodes the provided image frame.
This is an async function return the result, or you can provide an optional
callbackFn that is called with the results.
extractOrientationFromDataset(dataSet)
Extract orientation information from a dataset. It tries to get the orientation
from the Detector Information Sequence (for NM images) if image type equal
to RECON TOMO or RECON GATED TOMO
Parameters:
| Name | Type | Description |
|---|---|---|
dataSet |
* |
extractOrientationFromMetadata(metaData)
Extract orientation information from a metadata. It tries to get the orientation
from the Detector Information Sequence (for NM images) if image type equal
to RECON TOMO or RECON GATED TOMO
Parameters:
| Name | Type | Description |
|---|---|---|
metaData |
* |
extractOrientationFromNMMultiframeDataset(dataSet)
Extracts the orientation from NM multiframe dataset, if image type
equal to RECON TOMO or RECON GATED TOMO
Parameters:
| Name | Type | Description |
|---|---|---|
dataSet |
* |
extractOrientationFromNMMultiframeMetadata(metaData)
Extracts the orientation from NM multiframe metadata, if image type
equal to RECON TOMO or RECON GATED TOMO
Parameters:
| Name | Type | Description |
|---|---|---|
metaData |
* |
extractPositionFromDataset(dataSet)
Extract position information from a dataset. It tries to get the position
from the Detector Information Sequence (for NM images) if image type equal
to RECON TOMO or RECON GATED TOMO
Parameters:
| Name | Type | Description |
|---|---|---|
dataSet |
* |
extractPositionFromMetadata(metaData)
Extract position information from a metaData. It tries to get the position
from the Detector Information Sequence (for NM images) if image type equal
to RECON TOMO or RECON GATED TOMO
Parameters:
| Name | Type | Description |
|---|---|---|
metaData |
* |
extractPositionFromNMMultiframeDataset(dataSet)
Extracts the position from NM multiframe dataset, if image type
equal to RECON TOMO or RECON GATED TOMO
Parameters:
| Name | Type | Description |
|---|---|---|
dataSet |
* |
extractPositionFromNMMultiframeMetadata(metaData)
Extracts the position from NM multiframe dataset, if image type
equal to RECON TOMO or RECON GATED TOMO
Parameters:
| Name | Type | Description |
|---|---|---|
metaData |
* |
extractSliceThicknessFromDataset(dataSet)
Extract the sliceThickness information. If exists, extracts this information
from Pixel Measures Sequence
Parameters:
| Name | Type | Description |
|---|---|---|
dataSet |
* |
extractSpacingFromDataset(dataSet)
Extract the pixelSpacing information. If exists, extracts this information
from Pixel Measures Sequence
Parameters:
| Name | Type | Description |
|---|---|---|
dataSet |
* |
framesAreFragmented()
Function to deal with extracting an image frame from an encapsulated data set.
getImageTypeSubItemFromDataset(dataSet, index)
Get a subpart of Image Type dicom tag defined by index
Parameters:
| Name | Type | Description |
|---|---|---|
dataSet |
* | |
index |
* | 0 based index of the subtype |
getImageTypeSubItemFromMetadata(metaData, index)
Get a subpart of Image Type dicom tag defined by index
Parameters:
| Name | Type | Description |
|---|---|---|
metaData |
* | |
index |
* | 0 based index of the subtype |
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) → {*}
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
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()
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 |
(async) handler()
- Source:
Task handler function
initialize(configObject)
- Source:
Initialization function for the web worker manager - spawns web workers
Parameters:
| Name | Type | Description |
|---|---|---|
configObject |
initialize()
- Source:
Task initialization function
initialize(data)
- Source:
Initialization function that loads additional web workers and initializes them
Parameters:
| Name | Type | Description |
|---|---|---|
data |
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 |
removeAFromRGBA(imageFrame, targetBuffer)
- Source:
Removes the A from RGBA to return RGB buffer, this is used when the
decoding happens with browser API which results in RGBA, but if useRGBA flag
is set to false, we want to return RGB
Parameters:
| Name | Type | Description |
|---|---|---|
imageFrame |
decoded image in RGBA | |
targetBuffer |
target buffer to write to |
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()
Function to deal with unpacking a binary frame