Skip to content

Instantly share code, notes, and snippets.

Philipp Otto philippotto

  • Berlin
View GitHub Profile
View nice git log
git config --global alias.l "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@philippotto
philippotto / mergerMode_v2.js
Last active Apr 22, 2017
Merger mode for api v2
View mergerMode_v2.js
window.webknossos.apiReady(2).then(async (api) => {
const welcomeMessage =
`Mr. Motta and Mr. Boergens proudly present
The webKnossos Merger Mode Suite
[8] Shuffles segmentation color of current tree
[9] Toggles segment opacity
[right-click] Adds node and makes segment pink
[delete] Removes node and restores original segment color
View test-7.js
window.webknossos.apiReady(3).then(async (api) => {
api.utils.registerKeyHandler("7", () => { alert("You pressed 7"); });
});
View test-gist-2.js
window.webknossos.apiReady(3).then(async (api) => {
api.utils.registerKeyHandler("8", () => { alert("You pressed 8"); });
});
View merger-mode-script.txt
window.webknossos.apiReady(3).then(async (api) => {
const welcomeMessage =
`Mr. Motta and Mr. Boergens proudly present
The webKnossos Merger Mode Suite (version 23.04.2017)
[8] Shuffles segmentation color of current tree
[9] Toggles segment opacity
[right-click] Adds node and makes segment pink
[delete] Removes node and restores original segment color
View highlight_neighboring_cells.js
async function applyMapping(api) {
const trees = api.tracing.getAllTrees();
const currentTreeId = api.tracing.getActiveTreeId();
const currentTree = trees[currentTreeId];
const segmentationName = api.data.getVolumeTracingLayerName()
const cellIdSet = new Set()
for (const node of currentTree.nodes.values()) {
const cellId = await api.data.getDataValue(segmentationName, node.position);
You can’t perform that action at this time.