Giter Site home page Giter Site logo

aces / brainbrowser Goto Github PK

View Code? Open in Web Editor NEW
351.0 32.0 122.0 154.22 MB

Web-based visualization tools for neurological data.

Home Page: https://brainbrowser.cbrain.mcgill.ca/

License: GNU Affero General Public License v3.0

JavaScript 99.47% CSS 0.19% HTML 0.12% Python 0.22%

brainbrowser's Introduction

LOGO

Build Status

BrainBrowser is a JavaScript library allowing for web-based, 2D and 3D visualization of neurological data. It consists of the Surface Viewer, a real-time 3D rendering tool for visualizing surface data, and the Volume Viewer, a slice-by-slice volumetric data analysis tool.

BrainBrowser uses open web-standard technologies such as HTML5, CSS, JavaScript and WebGL. The Surface Viewer uses three.js for 3D rendering.

Demonstrations of available functionality can be found at the BrainBrowser website.

Getting Started

To try out some BrainBrowser sample applications, simply clone this git repo, and make the examples directory available over HTTP. This can be done using nano-server:

  $ git clone https://github.com/aces/brainbrowser.git
  $ npm install -g nano-server
  $ nano-server 5000 brainbrowser/examples

Note that nano-server is recommended because it can send gzip compressed versions of requested files. If a server without this functionality is used, files in brainbrowser/examples/models/ and brainbrowser/examples/color-maps/ will have to be gunzipped.

Once the server is running, navigate to to appropriate address (localhost:5000 in the above example) in your browser and select either of the Surface Viewer or Volume Viewer sample applications.

Surface Viewer

The BrainBrowser Surface Viewer allows users to display and manipulate 3D surface data. The Surface Viewer is invoked by calling BrainBrowser.SurfaceViewer.start() with the id of the HTML element into which the viewer will be inserted, and a callback function to which a viewer object will be passed:

  BrainBrowser.SurfaceViewer.start("viewer-div", function(viewer) {
    // Manipulate viewer object here.
  });

Full documentation of the Surface Viewer API can be found here.

Volume Viewer

The BrainBrowser Volume Viewer allows users to display and manipulate volumetric data in a slice-by-slice manner. The Volume Viewer is invoked by calling BrainBrowser.VolumeViewer.start() with the id of the HTML element into which the viewer will be inserted, and a callback function to which a viewer object will be passed:

  BrainBrowser.VolumeViewer.start("viewer-div", function(viewer) {
    // Manipulate viewer object here.
  });

Full documentation of the Volume Viewer API can be found here.

Contributing

Please see the Contribution Guidelines.

brainbrowser's People

Contributors

amarzullo24 avatar cesine avatar dependabot[bot] avatar driusan avatar jonathanlurie avatar mpetkova avatar natacha-beck avatar nkassis avatar paulmougel avatar pbellec avatar pipitone avatar prioux avatar tom32i avatar tsherif avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

brainbrowser's Issues

Race condition in Surface Viewer worker preloading.

The preloading of web workers is done through AJAX requests, and currently, if the preloading isn't complete by the time viewer starts, the viewer will throw an exception indicating that its configuration isn't complete.

It might be preferable to have picking occur on the markers.

As currently implemented, markers are ignored for picking. The vertex of the model is what is actually picked and is used to look up an annotation. This can be confusing in terms of the interaction. If you click on an annotation marker but miss the vertex, nothing happens. I think one solution would be to store all annotation information in the marker mesh which could then be used directly through the picking to retrieve the annotation.

Volume Viewer: movement in voxel space.

Currently, the Volume Viewer moves one pixel at a time, and this generally maps to one unit in world space. If a voxel is represented by more than one pixel, your have to move through several pixels to get to the next slice. It would probably be preferable to move one voxel at a time.

Volume Viewer cursor updating broken.

It seems that when you move the cursor on one panel, the slices on other panels gets updated but the cursor doesn't move. Was probably introduced when I refactored the loading code (07ded5e).

Simplify configuration

The Surface Viewer currently requires users to redundantly set configuration for built in workers. These workers should simply configure themselves, and the only configuration parameter that should have to be set by a user is the worker_dir. Also, I'd kind of like configuration to be handled by an object that gets and sets parameters through methods. E.g. :

BrainBrowser.config.set("worker_dir", "js/brainbrowser/workers");
BrainBrowser.config.get("model_types.mniobj.worker");

Centralize event model.

Events are now defined on the viewer objects. I think it would be better to centralize them in the top-level BrainBrowser namespace, so that they can be accessed in non-viewer modules (e.g. BrainBrowser.loading or BrainBrowser.utils).

Write some tests for tree store.

Unlike a lot of the graphical stuff, the tree store should be fairly straightforward to write some unit tests for. A lot of systems depend on it, so I think it would be worthwhile to do so. I'm leaning towards qUnit as the testing framework.

Include a simple node server in the examples directory.

I just noticed that the mongoose server has become a more closed project. It's not as easy to just compile and use as it used to be, so I think the "Getting Started" part of the README is no longer valid. I'll just create a simple node server in the examples directory, and modify the README to use that.

Make the start of rendering in loadVolumes an optional callback.

The Volume Viewer's loadVolumes() always starts rendering when loading is complete. Now that volumes can be removed and reloaded (see bf86904), it would be better if loadVolumes() took an optional complete callback that could start the rendering. That way, it could be used more than once without creating multiple render loops.

Get rid of caching mechanism in the Volume Viewer viewer object.

Not sure why this was done, but the cached_slices object in the viewer object doesn't cache actual slice objects. It's some strange intermediary object that holds the slice width_space and height_space objects and the image of the slice. Slice caching is already done within the volume objects, and the image can be cached in the appropriate panel object.

Mouse tracker for the Surface Viewer

I've noticed a few places where the mouse has to be captured, and the code is being rewritten each time. It would be nice to have a property of the viewer object that tracks the mouse (like the captureMouse() function does in the Volume Viewer).

Possible issue with coordinate conversion

Louis noticed (and Cecile and I confirmed) that when going through world coordinates in one axis each step is equal for both voxel and world coordinates. Based on the conversion from voxel to world this is probably not expected behaviour.
There is a voxel to world minc tool and some explanation of world coordinates in the following url:
http://www.bic.mni.mcgill.ca/software/minc/minc2_format/node4.html

It might be worthwhile looking at a file that is in stereotaxic space to ensure that voxel coordinates are correct first. For example look at 0,0,0 location to ensure that this is correctly encoded.

Change signature of Surface Viewer's setTransparency()

Right now it requires you to give a shape name as the first parameter. I think it would be better if it defaulted to changing the transparency of all loaded shapes, and then maybe took an optional second parameter (or an options object with a "shape" property) to set the transparency on a single shape. E.g.

viewer.setTransparency(0.5, {
  "shape": "left_hemisphere"
});

Actually, this type of signature might be good for other methods, like setWireframe().

Integrate annotator into BrainBrowser

Came up with a rough draft for annotation mechanism for BrainBrowser at a hackathon this weekend. Just need to refine it an integrate into the core.

Add BrainBrowser to CDNJS

Would it make sense to make BrainBrowser available through cdnjs?

I saw a few examples of using requirejs to load javascript libraries from cdnjs into an ipython notebook and curious if a similar approach would work for brainbrowser. You can always download a release and configure it locally, but cdnjs looks like it might make the process more straight forward.

Surface Viewer instensity_data.createColorArray should be cleaned up.

Method is defined in parse_intensity_data.js. It probably shouldn't be part of the public API. It makes more sense to put it as a private function in surface-viewer/modules/color.js, since that's the only place it's used. It could also probably be cleaned up a bit:

  • Use a typed array for the created color array
  • Define size of color ahead of time instead of constantly pushing onto the array
  • See if the logic can be clarified a bit.

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.