forked from google/neuroglancer
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
editing for butterfly webserver #1
Open
thejohnhoffer
wants to merge
82
commits into
master
Choose a base branch
from
rhoana_stable
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
These changes allow real-time collaborative editing through a websocket connection to the Butterfly server. Butterfly currently serves a static build of Neuroglancer (from this repository) to give Harvard researchers an interface to view and modify terabytes of scanned and/or labeled volumes.
Background
Our goal is to perform two operations on a labeled volume:
The butterfly server allows multiple concurrent users to send and receive merge and split information following by the Websocket API described here. The Neuroglancer edits here:
The user interface for splitting labels is still under development.
Admittedly, the fork of Neuroglancer developed by the Seung Lab lets users merge and split labels. After reading the code and reaching out to them, we learned their branch relies on several remote-procedure calls specific to their custom graph server that requires a hierarchical merge tree representation of the labels. Such a representation was considered infeasible by our group.
So, this branch implements a simple websocket interface to manage edits stored in the butterfly webserver. While we could target a different open-source server such as the Boss, our butterfly server reads directly from several file formats used daily by members of our group. Most importantly, the butterfly server presented the quickest solution for writing the backend of the websocket interface.
Interface
The Websocket connection URL is constructed in third_party/dojo/websocket.js. An example URL of
wss://dojo.rc.fas.harvard.edu/ws/JWR::2018_01_18::8x8y8z/id
matches:Where:
{wss}
protocol determines whether (wss) or not (ws) to use SSL encryption{host}
provides the hostname of the NDStore datasource{key}
gives an arbitrary string identifying the resource location{channel}
names a specific image source within a given resourceThe data exchanged between server and client meets the following format:
To send a subset of available data, use
"action": save
. To send all data, use"action": restore
. The value of"error":
can be any arbitrary string. No changes to client or server state should occur for error values other than""
.The strings
id
,sub
,x0
,x1
,y0
,y1
,z0
, andz1
should all be standard base-10 string representations of integers.The value of
"merge":
can be an empty array[]
, or an array of arrays ofid
values defining image labels to be joined into a single label. Example:[["1","2","3"],["9","100"]]
The value of
"split":
can be an empty array[]
, or an array of strings ofid:sub:x0:x1:y0:y1:z0:z1
values defining image labels to be joined into a single label. A new labelsub
should be applied to all voxels that match 3 conditions:id
label in the original datax0
,y0
,z0
x1
,y1
,z1
Example:
["1:0:50:50:50:100:50:50","1:1:0:0:0:100:100:100"]
TODO
"split:"
commands, not only"merge:"
commands