diff --git a/requirements.txt b/requirements.txt index 4a3004d..3615c70 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ ephys-link==0.9.11 myst-parser==2.0.0 sphinx==6.2.1 sphinx-rtd-theme==1.3.0 -oursin==0.4.10 +oursin \ No newline at end of file diff --git a/source/_autosummary/unityneuro.render.rst b/source/_autosummary/unityneuro.render.rst deleted file mode 100644 index 5a8ceee..0000000 --- a/source/_autosummary/unityneuro.render.rst +++ /dev/null @@ -1,91 +0,0 @@ -unityneuro.render -================= - -.. automodule:: unityneuro.render - - - - - - - - .. rubric:: Functions - - .. autosummary:: - :nosignatures: - - change_id - clear - clear_areas - clear_neurons - clear_probes - clear_texts - clear_volumes - close - connect - connected - create_neurons - create_probes - create_text - create_volume - delete_neurons - delete_probes - delete_text - delete_volume - disconnect - load_beryl_areas - load_cosmos_areas - message - set_allen_volume_visibility - set_area_alpha - set_area_color - set_area_colormap - set_area_data - set_area_data_index - set_area_intensity - set_area_material - set_area_visibility - set_camera_pan - set_camera_position - set_camera_rotation - set_camera_target - set_camera_target_area - set_camera_zoom - set_neuron_colors - set_neuron_materials - set_neuron_positions - set_neuron_shapes - set_neuron_sizes - set_probe_angles - set_probe_colors - set_probe_positions - set_probe_size - set_text - set_text_colors - set_text_positions - set_text_sizes - set_volume_colormap - set_volume_data - set_volume_slice_data - set_volume_visibility - setup - - - - - - .. rubric:: Classes - - .. autosummary:: - :nosignatures: - - bcolors - - - - - - - - - diff --git a/source/_static/custom.css b/source/_static/custom.css new file mode 100644 index 0000000..6729bdf --- /dev/null +++ b/source/_static/custom.css @@ -0,0 +1,21 @@ +.collaborator-grid { + display: grid; + grid-template-columns: repeat(3, 1fr); /* Three equal-width columns */ + gap: 20px; /* Adjust the gap between items as needed */ +} + +.collaborator { + text-align: center; +} + +.collaborator img { + max-width: 100%; /* Adjust the image width as needed */ +} + +.collaborator-name { + font-weight: bold; +} + +.collaborator-position { + font-style: italic; +} diff --git a/source/about/overview.md b/source/about/overview.md index d4d1118..229c4d6 100644 --- a/source/about/overview.md +++ b/source/about/overview.md @@ -47,23 +47,40 @@ Selina is piloting new 2-photon integrations in Urchin. ### Collaborators -Mayo Faulkner - -**[Mayo Faulkner, PhD](https://uk.linkedin.com/in/mayo-faulkner-592a8387)** - -User Experience Engineer - International Brain Laboratory - -Cyrille Rossant - -**[Cyrille Rossant, PhD](https://cyrille.rossant.net/about/)** - -Scientific Programmer - International Brain Laboratory - -Yoni Browning - -**[Yoni Browning, PhD](https://www.representations.space/)** - -Scientist - Allen Institute +
+ +
+ Mayo Faulkner +

Mayo Faulkner, PhD

+

UX Engineer - IBL

+
+
+ Cyrille Rossant +

Cyrille Rossant, PhD

+

Scientific Programmer - IBL

+
+
+ Yoni Browning +

Yoni Browning, PhD

+

Scientist - Allen Institute

+
+ + +
*** diff --git a/source/api_reference_tp.rst b/source/api_reference_tp.rst deleted file mode 100644 index 2fed635..0000000 --- a/source/api_reference_tp.rst +++ /dev/null @@ -1,18 +0,0 @@ - -Pinpoint -=============================================== - -.. .. autosummary:: -.. :toctree: _autosummary -.. :template: custom-module-template.rst -.. :recursive: - -.. unityneuro - -.. .. doxygenclass:: UM_Client -.. :project: urchin -.. :members: - -.. .. doxygenclass:: UM_Launch -.. :project: urchin -.. :members: \ No newline at end of file diff --git a/source/api_reference_urn_csharp.rst b/source/api_reference_urn_csharp.rst deleted file mode 100644 index 8f1ca41..0000000 --- a/source/api_reference_urn_csharp.rst +++ /dev/null @@ -1,4 +0,0 @@ -UnityClient -=============================================== - -The Renderer runs as a Unity Client application. Documentation coming soon... diff --git a/source/conf.py b/source/conf.py index 4ead4d5..4099da7 100644 --- a/source/conf.py +++ b/source/conf.py @@ -53,6 +53,9 @@ # html_theme = 'sphinx_rtd_theme' +# Include your custom CSS file +html_css_files = ['custom.css'] + # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". diff --git a/source/development.rst b/source/development.rst new file mode 100644 index 0000000..07e64cc --- /dev/null +++ b/source/development.rst @@ -0,0 +1,13 @@ +================== +Development +================== + +.. toctree:: + :maxdepth: 2 + :caption: Table of Contents + + misc/general + misc/brain_atlas + pinpoint/development + urchin/development + ephys_link/development \ No newline at end of file diff --git a/source/index.rst b/source/index.rst index ab26383..b9047f7 100644 --- a/source/index.rst +++ b/source/index.rst @@ -48,18 +48,6 @@ Please see the individual projects for installation instructions and documentati urchin/tutorial ibl/ibl_tools - -.. toctree:: - :hidden: - :maxdepth: 3 - :caption: Development - - misc/general - misc/brain_atlas - pinpoint/development - urchin/development - ephys_link/development - .. toctree:: :hidden: :maxdepth: 2 @@ -67,6 +55,7 @@ Please see the individual projects for installation instructions and documentati about/overview about/vbl_manual + development about/contract_us .. toctree:: diff --git a/source/urchin/development.md b/source/urchin/development.md index aedd5e6..bd8bc12 100644 --- a/source/urchin/development.md +++ b/source/urchin/development.md @@ -2,11 +2,23 @@ ## Organization -Urchin is organized into three parts. A client, server, and renderer. The only client right now is the Python API, but in the future we may build other APIs (MATLAB, R). The Server is a Node.js server that echoes messages between clients and renderers. The Renderer is a Unity app that can run either as a standalone desktop build or in the browser. +Urchin is organized into three parts. An API, server, and renderer. -### Virtual environment +### API -To develop for Urchin you will need to run a local copy of the client, server, and Unity builds. For the Python API you will need a new virtual environment with `unityneuro` installed in **editable** mode. +The Python API allows users to push and get data to the serverer and to a renderer instance. + +### Server + +The server runs both an HTTP REST endpoint and a Node.js Socket.IO server. The REST endpoints allow users to push new datasets to the server and retrieve them from data buckets, see below. The Socket.IO server acts as a proxy between a client API and the renderer itself, this can be used for testing visualizations without saving the data or for grabbing screenshot or video data back from the renderer. + +### Renderer + +The renderer is a standalone WebGL or Desktop client that displays data alongside anatomical reference atlases. + +## Virtual environment + +To develop for Urchin you will need to run a local copy of the client, server, and Unity builds. For the Python API you will need a new virtual environment with `oursin` installed in **editable** mode. To setup the venv go into the API folder and run: @@ -16,17 +28,27 @@ urchin-venv/Scripts/activate pip install -e . ``` -### Adding new functionality +Updates you make to the code will then be accessible by restarting your Python kernel. + +## Adding new functionality To add a new render function you need three pieces: - 1. Update `API/urchin/renderer.py` to include the new function and add documentation + 1. Add the new API documentation 2. Add the `socket.io` call to the set of calls in `Server/server.js` 3. Add the new functionality to the UnityClient in `Client.cs` and in your manager class -Before deploying you should add a new test script in `Examples/basic` which runs your new functionality and makes sure that it works. +Before deploying you should add a new test script in the [urchin-examples](https://github.com/VirtualBrainLab/urchin-examples) repository which runs your new functionality and makes sure that it works. + +### Schema -#### Urchin (API/unityneuro/render.py) +Schemas are stored in the `Schema/` folder. They have the following pattern: + +``` +? +``` + +### Python (oursin package) The Urchin API has two patterns for inputs, a single object (singular) pattern and a multi-object (plural) pattern. They should in general look like this: @@ -64,11 +86,17 @@ Examples """ ``` -#### Server (Server/server.js) +#### Testing + +Unit tests should test that the functions generate valid JSON and that the sanitizing functions perform their job correctly for a variety of inputs. + +### HTTP REST Server (HTTPServer/?) + +### Socket.IO Server (Server/server.js) The server calls just echo the data from the sender (API) to the receiver (Unity). Copy any of the existing calls and replace the message headers. Please keep the server organized. -#### Unity (Client.cs and your manager code) +### Unity (Client.cs and your manager code) Your code in Unity should be separated into two layers. All socket messages should be received in the `Client.cs` class and then passed on to a `XXManager.cs`. The `Client` handles all socket communication, while the `Manager` handles all of the Unity local content. Keep managers separated by functionality (e.g. `ProbeManager`, `NeuronManager`, `LineRendererManager`, etc). @@ -77,18 +105,17 @@ Your code in Unity should be separated into two layers. All socket messages shou To test your code locally, run the server on your local machine by navigating to the `Server/` folder and running `node server.js`. Then, run client in standalone localhost mode: ``` -urn.setup(localhost=True, standalone=True) +import oursin as urchin +urchin.setup(localhost=True, standalone=True) ``` -You should see the client connect with your username as ID on the server window. - Finally, run the Unity renderer app in the editor. You may need to manually set your username as the ID in the app if it doesn't detect it automatically (either via code in `Client.cs` or by pressing `I` and opening the ID input window). ## Deployment ### Deploying the client -The client is accessed by users in two ways: either through the [web server](http://data.virtualbrainlab.org/UMRenderer/) or through a standalone desktop app which we include in each minor version release. To deploy a new client you need to take a few steps. +The client is accessed by users in two ways: either through the [web server](http://data.virtualbrainlab.org/Urchin/) or through a standalone desktop app which is deployed on Steam. To deploy a new client you need to take a few steps. 1. If you changed the Addressable assets or updated to a new version of Unity you need to re-build the assets. Do this for each build target separately. Then copy the `UnityClient/ServerData` folder to the `htdocs/UMData` subfolder on the server. 2. Build the WebGL target build, then copy this to the `htdocs/UMRenderer` subfolder on the server. @@ -111,4 +138,4 @@ py -m twine upload dist/* #### On Heroku -Every time the github repository is pushed the Heroku server will re-build. You will get back a 503 server response if there are errors in the code running on Heroku. +Every time the github repository is pushed the Heroku server will re-build. You will get back a 503 server response if there are errors in the code running on Heroku. \ No newline at end of file