Coder Social home page Coder Social logo

aplbrain / colocar Goto Github PK

View Code? Open in Web Editor NEW
4.0 10.0 0.0 3.4 MB

tools for sparse human annotation of three-dimensional [neuroscience] datasets

JavaScript 95.07% HTML 3.06% Shell 0.05% CSS 0.35% Python 1.47%
jhuapl ground-truth web-application neuroscience bossdb sparse-annotations

colocar's Introduction

colocar

Introduction

Welcome to colocar! This repository houses a number of React.js- and p5.js-based tools for sparse annotations of three-dimensional (primarily spatial) datasets and complementary tools for validation of those sparse annotations.

These are primarily used through deployment to Amazon Web Services (AWS), but they can also be run locally with ease. In either case, they require access to a spatial database that houses the data to be annotated and a document-oriented database to receive the annotations. In particular, the current production workflow pulls imagery from the Boss and pushes annotations to colocard.

Setup

Preamble: colocorazon

First, one must build the shared libraries, found in colocorazon. This can be done by cd-ing into colocorazon and running yarn && yarn build. This will transpile the shared libraries into browser-friendly, old-timey JavaScript.

cd colocorazon
yarn run build

Then, for example:

cd ../breadcrumbs
yarn add ../colocorazon

You can also directly link the build like so:

cd colocorazon
yarn run build
yarn link
cd pointfog
yarn link colocorazon

Changes to the colocorazon build will now immediately take effect in the link-downstreams. (So... exercise caution if doing this for a production deploy!)

Amble: installing dependencies

Next, the apps require pulling modules into their node_modules. At present, this can be done by cd-ing into the app directory and running yarn.

Postamble: with your powers combined!

Finally, with all dependencies built and installed, we are ready to run and deploy our apps.

Running Locally

Each of the apps has a configuration file in the src directory called _config.json. Point this configuration file at the colocard host URL before launching.

At this stage, the apps can be run locally by cd-ing into their directories and running yarn start. When the browser launches a window, it will prompt you to enter credentials to the Boss. After successful entry, you will have access to the image data and the web app.

Deploying to AWS

Each of the colocar apps can be easily built and deployed to AWS using the handy script, colocart. This tool requires a python3 installation with the libraries boto3, click, and colored.

Be sure that the apps have already been set up on AWS via the quickstart-website portal (TODO: this tool was deprecated and is unavailable). This connects a CloudFront service to a particular S3 bucket. The name of that S3 bucket must be entered into the build.cfg file such that the contents are as follows.

[UPLOAD]
BucketName = <S3-BUCKET-NAME-OF-APP>

Once the apps have had their dependencies installed, the python3 environment is ready, and the configuration file is updated, one can use ./colocart build <APP-NAME> && ./colocart deploy <APP-NAME> to deploy a fresh version of the current working directory to AWS.

Directories

Pointcloud generation from images

Skeleton 'graph' tracing from images

Skeleton 'graph' pairwise visualization

forced choice point proofreading

forced choice graph proofreading


Made with โ™ฅ at JHU APL

colocar's People

Contributors

dependabot[bot] avatar j6k4m8 avatar jtpdowns avatar tuckerchapin avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

colocar's Issues

Single localForage key for all questions

The current key for localForage in pointfog does not depend on the questionId, which means that one question's points could be loaded for another question if the localForage was not properly purged ie if the node upload failed. Adding the questionId to the key should fix the problem.

Add border annotation

Add annotation option to indicate the border of a volume in breadcrumbs. Also prohibit upload of trace with leaf nodes without annotation of axon (a), dendrite (d), or border (b).

First right-click always hints

If one wants to select a previously placed node in breadcrumbs, right-clicking is the only option. However, right-clicking once will show a hint for node placement even if the cursor is over an existing node. A second click will select the node. This behavior is confusing, and so we should just select the node on the first click.

Add pop-ups for confirmation

When submitting, add an interactive session to confirm that submit is clear and intentional. No analogous pop-up for saving because that happens often in background.

Arbitrary delete in pointfog

At present, deleting a node in pointfog selects a new activeNode immediately. If people hit the delete key multiple times, this is almost guaranteed to result in behavior they do not want or expect. We should require explicit select to delete in pointfog.

Add save functionality

Include some kind of UI to access the saveNodes function in pointfog to store nodes in the browser before submitting

  • save button
  • save keys (ctrl+s)
  • autosave

Position values do not change with current zoom

It seems like the position values stay constant as one zooms the UI, despite the fact that the zoom moves the position to UI center. This seems like it would have to result in wrong values for things like node position placement and might explain the "spider web" patterns we've seen.

"Saving..." indicator

Perhaps a toast of some sort to indicate that a roundtrip is taking place so the user doesn't mash the submit button.

Separately; should debounce the submit button so the user can't upload twice

Add pointfog select old node

Right now it seems to be difficult to select a node that was dropped before. It may not be possible to delete a node if this is the case.

Implement Colocard#postGraph in db.js

See also #32.

Should be able to post a graph to colocard; may need to modify the graph in order to hit the colocard schema.

Will definitely need to add author (maybe add argument to fn?), timestamp (new Date() * 1), etc.

postGraph(graph: graphlib.DiGraph): Promise<Object>

Use cutout service instead of image slice

This saves on data-use pretty dramatically

This code currently uses the image endpoint. There is a cutout endpoint (docs) which accepts an Accept-Type header of jpeg, which returns a 'film-strip'-style image.

Then we'll need to "window" that long image to get individual square XY images. You can use the p5#image fn to do this (see last example on this page)

  • breadcrumbs
  • pointfog

Gotchas:

  • We use the ImageManager.imageURLs.length in a few places around the codebase (don't remember the exact name of that var, but something like that). Need to replace with a getZDepth() or something like that.
  • It's possible that the full volume is too big to load in one cutout request, so I'd suggest we cut the download into five-ish segments:
[ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ]

...where the 3 segment contains the starting synapse, and is loaded first.

Implement colocar#getNextQuestion in db.js

Implement the colocard API for only required endpoints in breadcrumbs/src/db.js.

There is an existing interface, Database, which has one required function, getNextQuestion. This currently returns a question AND a volume; probably we should just return a single object which contains all of the required information, in line with the colocard schema. (This was developed prior to finishing the question work in colocard, so when there are disagreements between this implementation and colocard, use the colocard schemas/types!)

Scoping this issue a bit tighter, JUST implement the getNextQuestion function; postGraph can happen as a separate issue.

getNextQuestion: (user: string, type: string): Promise<colocard.Question>

Interactions with ui insert nodes

If you click on the zoom button or submit button, nodes will appear on the EM underneath where you clicked. We should probably disable this and have some sense of what is in the foreground.

Bookmarks render quirk

Bookmarks appear opaque even when out of view or many slices away. Whenever a new node is dropped, the bookmark opacity returns to full.

Can delete non-leaf nodes

Current breadcrumbs allows deletion of active node, even when this would break trace into multiple connected components. Should disallow and only delete from leaves or else maintain tree structure somehow.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.