webKnossos Frontend API

0.17.146

API initializer. Will be called as soon as the webKnossos API is ready.

apiReady
Parameters
version (number)
Example
window.webknossos.apiReady(2).then((api) => {
  // Your cool user script / wK plugin
  const nodes = api.tracing.getAllNodes();
  ...
});

All tracing related API methods. This is the newest version of the API (version 3).

new TracingApi(model: OxalisModel)
Version: 3
Parameters
model (OxalisModel)
Instance Members
getActiveNodeId()
getActiveNodeId()
getActiveTreeId()
getActiveTreeId()
setActiveNode(id)
setActiveNode(id)
getAllNodes()
getAllNodes()
getAllTrees()
getAllTrees()
deleteNode(nodeId, treeId)
deleteNode(nodeId, treeId)
setCommentForNode(commentText, nodeId, treeId)
setCommentForNode(commentText, nodeId, treeId)
getCommentForNode(nodeId, treeId, tree)
getCommentForNode(nodeId, treeId, tree)
setTreeName(name, treeId)
setTreeName(name, _treeId)
setActiveTree(treeId)
setTreeColorIndex(treeId, colorIndex)
setTreeVisibility(treeId, isVisible)
getTreeGroups()
setTreeGroup(treeId, groupId)
renameGroup(groupId, newName)
getTreeName(treeId)
getTreeName(treeId)
save()
save()
finishAndGetNextTask()
finishAndGetNextTask()
restart(newTracingType, newAnnotationId, newControlMode, versions)
restart(newTracingType, newAnnotationId, newControlMode)
setNodeRadius(delta, nodeId, treeId)
setNodeRadius(delta, nodeId, treeId)
centerNode
centerNode
centerTDView
centerTDView
centerPositionAnimated(position, skipDimensions, rotation)
centerPositionAnimated(position, skipDimensions, rotation)
getCameraPosition()
getCameraPosition()
getActiveCellId()
getActiveCellId()
setActiveCell(id)
setActiveCell(id)
getVolumeTool()
getVolumeTool()
setVolumeTool(tool)
setVolumeTool(tool)

All tracing related API methods. This is the newest version of the API (version 2).

new TracingApi(model: OxalisModel)
Version: 2
Parameters
model (OxalisModel)
Instance Members
getActiveNodeId()
getActiveNodeId()
getActiveTreeId()
getActiveTreeId()
setActiveNode(id)
setActiveNode(id)
getAllNodes()
getAllNodes()
getAllTrees()
getAllTrees()
deleteNode(nodeId, treeId)
deleteNode(nodeId, treeId)
setCommentForNode(commentText, nodeId, treeId)
setCommentForNode(commentText, nodeId, treeId)
getCommentForNode(nodeId, treeId, tree)
getCommentForNode(nodeId, treeId, tree)
setTreeName(name, treeId)
setTreeName(name, _treeId)
setActiveTree(treeId)
setTreeColorIndex(treeId, colorIndex)
setTreeVisibility(treeId, isVisible)
getTreeGroups()
setTreeGroup(treeId, groupId)
renameGroup(groupId, newName)
getTreeName(treeId)
getTreeName(treeId)
save()
save()
finishAndGetNextTask()
finishAndGetNextTask()
restart(newTracingType, newAnnotationId, newControlMode, versions)
restart(newTracingType, newAnnotationId, newControlMode)
setNodeRadius(delta, nodeId, treeId)
setNodeRadius(delta, nodeId, treeId)
centerNode
centerNode
centerTDView
centerTDView
centerPositionAnimated(position, skipDimensions, rotation)
centerPositionAnimated(position, skipDimensions, rotation)
getCameraPosition()
getCameraPosition()
getActiveCellId()
getActiveCellId()
setActiveCell(id)
setActiveCell(id)
getVolumeTool()
getVolumeTool()
setVolumeTool(tool)
setVolumeTool(tool)

All binary data / layer related API methods.

new DataApi(model: OxalisModel)
Parameters
model (OxalisModel)
Instance Members
getLayerNames()
getLayerNames()
getVolumeTracingLayerName()
getVolumeTracingLayerName()
setMapping(layerName, mapping, options)
setMapping(layerName, mapping)
getBoundingBox(layerName)
getBoundingBox(layerName)
getDataValue(layerName, position, zoomStep)
getDataValue(layerName, position, zoomStep)
downloadRawDataCuboid(layerName, topLeft, bottomRight)
downloadRawDataCuboid(layerName, topLeft, bottomRight)
labelVoxels(voxels, label)
labelVoxels(voxels, label)
getConfiguration(key)
getConfiguration(key)
setConfiguration(key, value)
setConfiguration(key, value)

All binary data / layer related API methods.

new DataApi(model: OxalisModel)
Parameters
model (OxalisModel)
Instance Members
getLayerNames()
getLayerNames()
getVolumeTracingLayerName()
getVolumeTracingLayerName()
setMapping(layerName, mapping, options)
setMapping(layerName, mapping)
getBoundingBox(layerName)
getBoundingBox(layerName)
getDataValue(layerName, position, zoomStep)
getDataValue(layerName, position, zoomStep)
downloadRawDataCuboid(layerName, topLeft, bottomRight)
downloadRawDataCuboid(layerName, topLeft, bottomRight)
labelVoxels(voxels, label)
labelVoxels(voxels, label)
getConfiguration(key)
getConfiguration(key)
setConfiguration(key, value)
setConfiguration(key, value)

All user configuration related API methods.

new UserApi(model: OxalisModel)
Parameters
model (OxalisModel)
Instance Members
getConfiguration(key)
getConfiguration(key)
setConfiguration(key, value)
setConfiguration(key, value)

All user configuration related API methods.

new UserApi(model: OxalisModel)
Parameters
model (OxalisModel)
Instance Members
getConfiguration(key)
getConfiguration(key)
setConfiguration(key, value)
setConfiguration(key, value)

Utility API methods to control wK.

new UtilsApi(model: OxalisModel)
Parameters
model (OxalisModel)
Instance Members
sleep(milliseconds)
sleep(milliseconds)
showToast(type, message, timeout)
showToast(type, message, timeout)
registerOverwrite(actionName, overwriteFunction)
registerOverwrite(actionName, overwriteFunction)
registerKeyHandler(key, handler)
registerKeyHandler(key, handler)

Utility API methods to control wK.

new UtilsApi(model: OxalisModel)
Parameters
model (OxalisModel)
Instance Members
sleep(milliseconds)
sleep(milliseconds)
showToast(type, message, timeout)
showToast(type, message, timeout)
registerOverwrite(actionName, overwriteFunction)
registerOverwrite(actionName, overwriteFunction)
registerKeyHandler(key, handler)
registerKeyHandler(key, handler)