Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
async function applyMapping(api) {
const trees = api.tracing.getAllTrees();
const currentTreeId = api.tracing.getActiveTreeId();
const currentTree = trees[currentTreeId];
const segmentationName =
const cellIdSet = new Set()
for (const node of currentTree.nodes.values()) {
const cellId = await, node.position);
const cellIds = Array.from(cellIdSet.values());
const mapping = {};
for (const cellId of cellIds) {
mapping[cellId] = cellId
}, mapping, { hideUnmappedIds: true})
webknossos.apiReady(3).then(api => {
api.utils.registerOverwrite("SET_ACTIVE_TREE", (store, next, originalAction) => {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.