Namespace: UTILITIES

UTILITIES

Methods

(static) changeModeOfLayer(layerId, otherMode, toggle)

Change rendering mode of a shader by toggle between "show" and "otherMode" without
Parameters:
Name Type Description
layerId layer id in the visualization target
otherMode other toggle mode, default "mask"
toggle if false, just update the current mode
Source:
Returns:
true if successfully performed

(static) fetch(url, postData, headers) → {Promise.<(string|any)>}

Send requests - both request and response format JSON with POST, the viewer meta is automatically included - makes the viewer flexible for integration within existing APIs
Parameters:
Name Type Description
url
postData
headers
Source:
Throws:
HTTPError
Returns:
Type
Promise.<(string|any)>

(static) fetchJSON(url, postData, headers) → {Promise.<(string|any)>}

Send requests - both request and response format JSON with POST, the viewer meta is automatically included - makes the viewer flexible for integration within existing APIs
Parameters:
Name Type Description
url
postData
headers
Source:
Throws:
HTTPError
Returns:
Type
Promise.<(string|any)>

(static) fileNameFromPath(imageFilePath, stripSuffix)

Parameters:
Name Type Description
imageFilePath image path
stripSuffix
Source:

(static) isLoaded(id, isPlugin)

Check whether component is loaded
Parameters:
Name Type Description
id string component id
isPlugin boolean true if check for plugins
Source:

(static) loadModules(onload, ids)

Load modules at runtime NOTE: in case of failure, loading such id no longer works unless the page is refreshed
Parameters:
Name Type Description
onload function to call on successful finish
ids all modules id to be loaded (rest parameter syntax)
Source:

(static) loadPlugin(id, onload)

Load a plugin at runtime NOTE: in case of failure, loading such id no longer works unless the page is refreshed
Parameters:
Name Type Description
id plugin to load
onload function to call on successful finish
Source:

(static) makeCacheSnapshot(named)

Set visualization parameters cache
Parameters:
Name Type Description
named boolean cache by layer name if true, position if false
Source:

(static) multiplexSingleTileSource(image)

Generic Multiplexing for TileSources allows to use built-in protocols as multi tile sources for visualization viewing. The image exchange must be in images - the tile response is interpreted as an Image object
Parameters:
Name Type Description
image OpenSeadragon.TiledImage
Source:
Example
//ENV configuration
  ...
  "client": {
    "[...]": {
      ...
      "data_group_protocol": "`${path}?Deepzoom=${data}.dzi`"
    }
  },
  "setup": {
    "fetchAsync": true
  },
  ...

(static) serializeApp(includedPluginsList, withCookies, staticPreview) → {Promise.<{app: string, data: {}}>}

Serialize the Viewer
Parameters:
Name Type Description
includedPluginsList
withCookies
staticPreview Whether to mark the serialized app as static or not
Source:
Returns:
Type
Promise.<{app: string, data: {}}>

(static) setFilterOfLayer(layerId, filter, value)

Set filter for given layer id
Parameters:
Name Type Description
layerId
filter filter to set, "use_*" style (gamma, exposure...)
value filter parameter (scalar) value
Source:

(static) setIsCanvasFocused(focused)

Allows changing focus state artificially
Parameters:
Name Type Description
focused boolean
Source:

(static) shaderPartSetBlendModeUIEnabled()

Enable or disable UI for modes, with the given mode applied (no need to call changeModeOfLayer)
Source:

(static) stripSuffix(path) → {string}

Strip path suffix
Parameters:
Name Type Description
path string
Source:
Returns:
Type
string

(static) testRendering()

Test for rendering capabilities Throws error on failure
Source: