Code Monkey home page Code Monkey logo

brayns's Introduction

Banner

DOI

Brayns is a large-scale scientific visualization platform. It is based on Intel OSPRAY to perform CPU Ray-tracing, which allows it to take full advantage of the underlying hardware where it runs.

It is based on a extension-plugin architecture. The core provides basic functionalities that can be reused and/or extended on plugins, which are independent and can be loaded or disabled at start-up. This simplifies the process of adding support for new scientific visualization use cases, without compromising the reliability of the rest of the software.

Brayns comes with a main application for its usage:

  • braynsService: A rendering backend which can be accessed over the internet and streams images to the connected clients.

Brayns also comes with some already-made plugins:

  • CircuitExplorer: The main plugin used at BBP. Allows for neuronal circuit visualization and simulation rendering.
  • DTI: A diffuse-tensor imaging visualization plugin.
  • AtlasExplorer: A plugin capable of interpreting and render NRRD volumes.
  • CylindricCamera: A plugin that adds a cylindric camera projection for inmersive environments.
  • MoleculeExplorer: A plugin that adds support for XYZ and PDB files.

Building

Brayns is developed, maintained and run on Linux-based operating systems, being tested mainly on RHEL and Ubuntu. The following platforms and build environments have been tested:

  • Linux: Ubuntu 16.04, Ubuntu 18.04, Ubuntu 20.04, Debian 9, RHEL 7 (Makefile, x64)

System dependencies

The following components must be installed on the system where Brayns will be built:

Optionally, to build the core plugins of Brayns, the following components are required.

  • HDF5 development files
  • Bzip2

Brayns uses further dependencies, but if they are not present on the system, it will download them by itself during build.

Build command

Once the given dependencies are installed, Brayns can be cloned and built as follows:

$ git clone https://github.com/BlueBrain/Brayns.git
$ cd Brayns && mkdir build && cd build
$ cmake .. -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_PREFIX_PATH=/path/to/OSPRay/cmake/config/folder
$ make -j

This will build the core of Brayns, the braynsService application, the CircuitExplorer plugin and the unit tests.

The following cmake options (shown with their default value) can be used during CMake build run to customize the components to build as -DVARIABLE=ON|OFF :

  • BRAYNS_TESTS_ENABLED (Default ON) - Activate unit tests
  • BRAYNS_SERVICE_ENABLED (Default ON) - Activate braynsService app
  • BRAYNS_CIRCUITEXPLORER_ENABLED (Default ON) - Activate CircuitExplorer plugin
  • BRAYNS_DTI_ENABLED (Default OFF) - Activate Diffusion-Tensor Imaging plugin
  • BRAYNS_ATLASEXPLORER_ENABLED - (Default OFF) Activate AtlasExplorer plugin
  • BRAYNS_CYLINDIRCCAMERA_ENABLED - (Default OFF) Activate Cylindric Camera projection plugin
  • BRAYNS_MOLECULEEXPLORER_ENABLED (Default ON) - Activate MoleculeExplorer plugin

Running

Important: All the libraries on which Brayns depends must be reachable through the LD_LIBRARY_PATH environmental variable, including plugin libraries.

braynsService application

To run the braynsService app, execute the following command (The command assumes braynsService executable is available on the system PATH):

$ braynsService --uri 0.0.0.0:5000

The --uri parameter allows to specify an address and a port to bind to. In the example, the service is binding to all available addresses and the port 5000.

This command will launch the braynsService app with only core functionality. To also add the functionality of any plugin, the --plugin option can be used to load plugins:

$ braynsService --uri 0.0.0.0:5000 --plugin braynsCircuitExplorer --plugin braynsMoleculeExplorer

The name that must be used when specifying a plugin will depend on the name of the library of the plugin (stripping the extension .so from it)

Using the Docker image

Brayns is available as a docker image at https://hub.docker.com/r/bluebrain/brayns. The image allows to launch the braynsService application.

It is built with every commit merged into the main repository branch (develop), and deployed into docker hub as brayns:latest. Furthermore, when a new release is made, and a new tag created, an additional image is built and deployed with the same tag.

To get Brayns docker image, you will need to have docker installed. Then execute the following command to download it:

$ docker pull bluebrain/brayns:latest

To run it, simply execute the following command:

$ docker run -ti --rm -p 5000:5000 bluebrain/brayns --uri 0.0.0.0:5000

Additional parameters, such as --plugin, can be specified in a similar fashion as in the braynsService application.

Python and JSON-RPC API

A running instance of braynsService can be monitored using brayns Python package or a websocket client and the JSON-RPC API.

For more details about the client APIs, see the python client doc.

Known Bugs

Please file a Bug Report if you find new issues which have not been reported already. If you find an already reported problem, please update the corresponding issue with your inputs and outputs.

Funding & Acknowledgment

The development of this software was supported by funding to the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss government’s ETH Board of the Swiss Federal Institutes of Technology.

This project has received funding from the European Union’s FP7-ICT programme under Grant Agreement No. 604102 (Human Brain Project RUP).

This project has received funding from the European Union's Horizon 2020 Framework Programme for Research and Innovation under the Specific Grant Agreement No. 720270 (Human Brain Project SGA1).

License

Brayns is licensed under the LGPL, unless noted otherwise, e.g., for external dependencies. See file LICENSE.txt for the full license.

Copyright (c) 2008-2023 Blue Brain Project/EPFL

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

brayns's People

Contributors

adevress avatar adrien4193 avatar chevtche avatar eile avatar favreau avatar jeffamstutz avatar jplanasc avatar karjonas avatar luzpaz avatar matz-e avatar nadirrogue avatar nantille avatar poseclop avatar ppodhajski avatar rolandjitsu avatar speierers avatar timocafe avatar tolokoban avatar tribal-tec 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

brayns's Issues

Brayns build compilation fails on Ubuntu 16.04 with libuv-dev (0.10) installed

In file included from ../uvw/src/uvw/async.hpp:7:0,
from ../uvw/src/uvw.hpp:1,
from ../apps/BraynsService/main.cpp:28:
../uvw/src/uvw/event.hpp: In constructor ‘uvw::ErrorEvent::ErrorEvent(U)’:
../uvw/src/uvw/event.hpp:55:56: error: could not convert ‘((uvw::ErrorEvent*)this)->uvw::ErrorEvent::ec’ from ‘const int’ to ‘uv_err_t {aka uv_err_s}’
: ec{static_cast(val)}, str{uv_strerror(ec)}
^
In file included from ../uvw/src/uvw/resource.hpp:8:0,
from ../uvw/src/uvw/handle.hpp:8,
from ../uvw/src/uvw/async.hpp:8,
from ../uvw/src/uvw.hpp:1,
from ../apps/BraynsService/main.cpp:28:
../uvw/src/uvw/loop.hpp: In static member function ‘static std::shared_ptruvw::Loop uvw::Loop::create()’:
../uvw/src/uvw/loop.hpp:139:41: error: ‘uv_loop_init’ was not declared in this scope
if(uv_loop_init(loop->loop.get())) {
^
In file included from ../uvw/src/uvw/resource.hpp:8:0,
from ../uvw/src/uvw/handle.hpp:8,
from ../uvw/src/uvw/async.hpp:8,
from ../uvw/src/uvw.hpp:1,
from ../apps/BraynsService/main.cpp:28:
../uvw/src/uvw/loop.hpp: In member function ‘void uvw::Loop::close()’:
../uvw/src/uvw/loop.hpp:254:44: error: ‘uv_loop_close’ was not declared in this scope
auto err = uv_loop_close(loop.get());
^
../uvw/src/uvw/loop.hpp:255:41: error: no matching function for call to ‘uvw::ErrorEvent::ErrorEvent()’
if(err) { publish(ErrorEvent{err}); }
^
In file included from ../uvw/src/uvw/async.hpp:7:0,
from ../uvw/src/uvw.hpp:1,
from ../apps/BraynsService/main.cpp:28:
../uvw/src/uvw/event.hpp:54:14: note: candidate: template<class U, class> uvw::ErrorEvent::ErrorEvent(U)
explicit ErrorEvent(U val) noexcept
^
../uvw/src/uvw/event.hpp:54:14: note: template argument deduction/substitution failed:
../uvw/src/uvw/event.hpp:52:8: note: candidate: constexpr uvw::ErrorEvent::ErrorEvent(const uvw::ErrorEvent&)
struct ErrorEvent: Event {
^
../uvw/src/uvw/event.hpp:52:8: note: conversion of argument 1 would be ill-formed:
../uvw/src/uvw/event.hpp:52:8: note: candidate: constexpr uvw::ErrorEvent::ErrorEvent(uvw::ErrorEvent&&)
../uvw/src/uvw/event.hpp:52:8: note: conversion of argument 1 would be ill-formed:
In file included from ../uvw/src/uvw/resource.hpp:8:0,
from ../uvw/src/uvw/handle.hpp:8,
from ../uvw/src/uvw/async.hpp:8,
from ../uvw/src/uvw.hpp:1,
from ../apps/BraynsService/main.cpp:28:
../uvw/src/uvw/loop.hpp: In member function ‘bool uvw::Loop::alive() const’:
../uvw/src/uvw/loop.hpp:288:42: error: ‘uv_loop_alive’ was not declared in this scope
return !(uv_loop_alive(loop.get()) == 0);
^
compilation terminated due to -fmax-errors=5.

Expected: build succeeds, libuv support disabled by CMakeLists if neccessary.

Events from Deflect are not broadcasted via Rockets

Today, only modifications on camera, settings, etc. by braynsViewer are broadcasted in RocketsPlugin. We don't want to that for braynsService as in between the async render, new changes might be received and then they will be send back to the sender.

To cleanly fix this, we probably would need to double-buffer all objects to separate changes for the current and the next frame. As long as braynsViewer does not become asynchronous this is not needed.

As a result, events sent by Deflect are not broadcasted in RocketsPlugin in the braynsService case.

Expose Embree's fast Morton code BVH builder

Embree has a new type of superfast BVH builder using Morton codes since Embree 2.1. It builds lower quality BVHs (slower rendering performance) but they are much faster to build than the SAH BVH: https://embree.github.io

Is there a way Ospray can make use of that?

If the user needs super quick real-time dynamic scenes, we should use this BVH. Once the scene remains static (the user may still interact with the scene such as rotating, zooming, changing materials, render modes and DOF etc, but the scene geometry itself doesn't change), we can replace the BVH with a higher quality version (SAH BVH + spatial splits), hopefully without having to throw away the already accumulated samples.

Snapshot feature as RPC for frontend

Input: resolution and quality (samples per pixel, etc.. maybe provide presets?)
processing: blocking for the time being, unless #286 allows queueing and async processing (does OSPRay allow that? temporary framebuffer etc. is needed for that)
Output: Image (jpg/png/tiff/raw?)

Change in materialLUT does not update rendering

..only if a new simulation frame has been selected.

Scenario:

  • change materialLUT from HTTP (viztools, Sauron)
  • watch no difference in rendered image
  • select another simulation frame
  • watch your new colormap

Add scene management

Make it possible to add, remove and modify "objects" in the scene. By objects, we understands things like circuits, volumes, meshes, point clouds, etc.

  • Define a C++ API
  • Define the pending REST/WS API
  • Make it possible to have several instances of the same object, with different transformations.

Add meshes to scene

Requested by Christian:

"- Ability to add morphologies to an existing scene (ideally, by specifying the path to a file; ability to read .asc would be nice... but not essential)

  • Ability to add meshes to an existing scene (ideally, by specifying the path to a file)"

Lower-level feature request

I hope I am not requesting features that are actually already there. Here are some relatively low-level features (e.g., as compared to calls that manage the visualization of whole circuits from CircuitConfig files) that would really empower the users to use Brayns in daily debugging, investigation, and visualization:

  • Ability to add morphologies to an existing scene (ideally, by specifying the path to a file; ability to read .asc would be nice... but not essential)
  • Ability to add meshes to an existing scene (ideally, by specifying the path to a file)
  • Ability to apply a transformation to scene morphologies and meshes (rotation, translation, scaling)
  • Ability to loop through morphologies of a scene, get their meshing points, apply them a different color, etc.

As a user involved in circuit building, these low level features are in the end more useful to me than more high-level (e.g., single-call visualization of circuits) because I can build high-level features from low-level ones, but I cannot do it the other way around.

JSON RPC support

Enables RPCs in Brayns, next to object/state modifications. Picking, reset-camera and quit application are the first candidates. All websocket messages are using JSON RPC.

Requires JSON RPC from Rockets

RPC for data receive and load

Use case: drag&drop file(s) from the client, send the blob to Brayns and load the blob (mesh, xyz, ...) accordingly

Validate Ospray's path tracing shader

The output from Embree's path tracer example code differs significantly from Ospray's (which looks strange).

  • Check whether Ospray's path tracer implementation is correct
  • Compare to Embree, Blender Cycles or Mitsuba.

assimp

brayns mesh loader requires assimp, but doesn't check for it in cmakefile - simply creates link error after compiling.

Cannot connect to the renderer error

Sauron/Brayns-UI displays the "Cannot connect to the renderer" a lot when running Brayns on my MacBook (connected via Wifi). Sometimes I see a brief glimpse of the default Cornell box before the error occurs, other times it appears straight away.

Restarted Docker a couple of times, but to no avail.

Used: http://brayns.ocp.bbp.epfl.ch/?host=localhost:8200 to run Brayns. Can this address handle multiple users at once?

Validate AO shader

  • slider for ao distance
  • compare ao shader to other renderers e.g. Mitsuba (which has a very nice ao solution) for correctness

Reduce frequency of progress updates

If a lot of morphologies are loaded, it generates a huge load of messages. Maybe in general all message sends should be throttled. Reuse the image stream fps?

Merge the histograms endpoints

Instead of having /simulation-histogram and /volume-histogram we should have a single /histogram endpoint.

If it's necessary to differentiate between the two, we can use the request body/params to do so.

zerobuf used even when disabled

When subproject_zerobuf is disabled, some code still thinks it's enabled, then fails

[ 64%] Building CXX object brayns/common/CMakeFiles/braynsCommon.dir/camera/Camera.cpp.o
/home/wald/Projects/Brayns/brayns/common/camera/Camera.cpp:25:37: fatal error: zerobuf/render/camera.h: No such file or directory
compilation terminated.

Camera manipulation is off

Rotating the camera seems to make the model tilt around the center of rotation. I'm not sure if this is the expected behaviour, but it's a bit odd.

Improve CMake options handling

  • Move all the common_find_package() calls to the top-level CMakeLists. This is needed so that the return() from the common_find_package macro works correctly if a REQUIRED dependency is not found when Brayns is a subproject.
  • Replace all
option(BRAYNS_ENABLE_FOO "Enable Foo support" OFF)
if(BRAYNS_ENABLE_FOO)
  common_find_package(foo)
endif()

with:

common_find_package(foo)
if(FOO_FOUND)
  option(BRAYNS_ENABLE_FOO "Enable Foo support" ON)
endif()

This logic has the advantage of enabling all the options that are found by default and still lets users disable them if need be.

compile error w/ H5cpp.h

cmake ../ -DBRAYNS_BRION_ENABLED=OFF -DBRAYNS_DEFLECT_ENABLED=OFF -DBRAYNS_IMAGEMAGICK_ENABLED=OFF -DBRAYNS_REST_ENABLED=OFF -DSUBPROJECT_Brion=OFF -DSUBPROJECT_Deflect=OFF -DSUBPROJECT_Keyv=OFF -DSUBPROJECT_Lexis=OFF -DSUBPROJECT_Lunchbox=OFF -DSUBPROJECT_MVDTool=OFF -DSUBPROJECT_ZeroBuf=OFF -DSUBPROJECT_ZeroEQ=OFF -DSUBPROJECT_cppnetlib=OFF

gives

[ 51%] Building CXX object brayns/io/CMakeFiles/braynsIO.dir/NESTLoader.cpp.o
/home/wald/Projects/Brayns/brayns/io/NESTLoader.cpp:28:19: fatal error: H5Cpp.h: No such file or directory

(note libhdf5-dev is installed:
wald@luchser:~/Projects/Brayns/bin$ ll /usr/include/hdf5/serial/H5Cpp.h
-rw-r--r-- 1 root root 2.2k Apr 5 2016 /usr/include/hdf5/serial/H5Cpp.h
)

HDR environment lighting

Path tracing feature: Rays that "miss" the scene, but hit the background (an HDRI environment light) illuminate the scene

Decrease update interval when render is converging

AFAIK, the server currently sends an image to the client with each sample. This interval could be progressively decreased (less frequent updates) when the camera is stationary (no user interaction) and samples are accumulated (e.g. once every sample during the first 10 samples, then only once every 10 samples) to save bandwidth.
JPEGs could also be replaced by PNGs after a while.

Impl. smart search

We should have two API endpoints (rpc events):

  • search - returns various data specific info, etc.
  • action - reacts to rpc request with id from search object

Save state

Save state of materials, lights, camera positions and parameters (not scene geometry itself)

Rename /frame endpoint

We should rename /frame to /animation-parameters and follow the same pattern as with the other params endpoints.

Add ZeroEQ as a git-submodule?

Brayns automatically pulled some packages, but ZeroEQ remains as a dependency I have to install manually . Is this intended?

Use subsampling to guarantee smooth interaction

When interacting with the scene (camera rotation, changing lights, materials, DOF, ...), enable subsampling (blocks of 2x2 or 3x3 pixels) when the framerate drops below 15 fps. Revert back to full res rendering and start accumulating samples when there are no more changes.

Check anti-aliasing implementation

It's not clear if AA is being applied in Brayns/Ospray as some aliasing is noticeable (most noticeable on very thin branches such as in the image below), which does not disappear over time.

If the entire area of each pixel is explored randomly, I would expect that even very fine subpixel geometry like distant branches would become clearly visible after enough samples are accumulated. It's also possible that the only way to get rid of the aliasing artefacts is to render at higher resolution and then downsample.

o1_circuit_brayns_brighter

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.