Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
Merge Google's master branch into ndmaster and resolve conflicts (#23)
Browse files Browse the repository at this point in the history
* feat: add state saving/sharing ui allowing users to send their state to a server that accepts a json encoded version of the neuroglancer state. the "state server" is expected to return a url that will respond that same json string

* feat(zarr): support dimension_separator in .zarray file

This implements the spec change described here:
zarr-developers/zarr-python#715

This also adds a query string parameter by the same name.

Fixes google#241.

* feat(multiscale mesh): add additional debugging checks

* fix(multiscale mesh): turn off multiscale mesh fragment debugging by default

This was mistakenly left on by default.

* simplified state sharing code. replaced dialog with a state server config file and a select element if there is more than 1 server

* moved state share code out of viewer into separate file, renamed state key for the selected state server

* feat(ui): add support for configurable side panels

Previously, only two side panels were supported, the layer side panel
and the selection details side panel.  Only a static configuration was
supported, a single column on the right, with the layer side panel on
top and the selection details below, and the vertical height divided
equally.

This commit adds support for an arbitrary number of side panels, to
the left/right/top/bottom of the main data panels.  Panels can be
moved via drag and drop, and the size can also be adjusted.  The side
panels for multiple layers can now be shown at once, and individual
tabs of side panels can also be dragged to separate panels.

* feat: add layer list panel and support for "archived" layers

Archived layers are shown only in the new layer list panel; they are
not visible and are not shown in the layer bar.  They may be useful in
the case where there are a large number of layers that would otherwise
clutter up the layer bar.

This commit also improves the visual feedback during layer and drop
operations.

* feat(python): add ConfigState options for additional panel buttons

* fix(python): fix ManagedLayer.visible property

* fix(annotation): only bind properties actually referenced by the shader

Annotation rendering maps properties to shader vertex attributes, and
WebGL implementations limit the number of attributes to ~16.
Furthermore, previously all properties were bound even if not
referenced.  With this commit, only properties actually referenced by
the shader are bound.  This allows annotation layers to support data
sources with a large number of properties, provided that only a small
number are actually referenced by the shader at once.

* fix(annotation): fix rendering tab to better handle a large number of properties

* fix(annotation): prevent collapse of annotation property list

* fix(perspective_panel): eliminate separate transparentPickEnabled behavior

Segmentation layers have a "pick" boolean option that previously
controlled two things:

1. When off, double clicking does not select/deselect segments in the
layer.

2. When on, picking of transparent meshes behaves exactly the same as
if the mesh were opaque --- i.e. it is not possible to pick objects
behind/inside the mesh.  When off, picking of transparent meshes has
lower precendence than opaque objects behind.

In practice, the picking behavior for transparent objects with
"picking on", which made it impossible to pick opaque objects behind,
is not very useful.

With this change, the second behavior change no longer applies:
transparent objects now always have lower picking precendence than
opaque objects, making it possible to pick opaque objects behind
transparent objects.

* fix(ui/side_panel): only allow dragging from title bar

This allows slider controls in the body of side panels to work correctly.

Also disables auto-select on focus behavior for the name input field
of the layer side panels.  The previous auto-select on focus behavior
meant that attempting to start a drag from the text area (which takes
up most of the title bar and is the most natural place to drag from)
worked, but showed the text itself being dragged rather than the
entire panel.

Co-authored-by: Chris Jordan <jordanchriss@gmail.com>
Co-authored-by: Jeremy Maitin-Shepard <jbms@google.com>
Co-authored-by: Hannah Gooden <hannah.gooden@jhuapl.edu>
  • Loading branch information
4 people committed Apr 30, 2021
1 parent 3c3dd0b commit 2ff8d53
Show file tree
Hide file tree
Showing 50 changed files with 3,303 additions and 1,036 deletions.
97 changes: 72 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
"gl-matrix": "^3.1.0",
"glsl-editor": "^1.0.0",
"glsl-strip-comments-loader": "^1.1.0",
"ikonate": "^1.1.1",
"json-loader": "^0.5.4",
"keycloak-js": "^11.0.0",
"ikonate": "mikolajdobrucki/ikonate#a86b4107c6ec717e7877f880a930d1ccf0b59d89",
"lodash": "^4.17.20",
"nifti-reader-js": "^0.5.4",
"numcodecs": "^0.1.1",
Expand Down
39 changes: 39 additions & 0 deletions python/examples/example_layer_side_panels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import argparse
import webbrowser

import neuroglancer
import neuroglancer.cli

if __name__ == '__main__':
ap = argparse.ArgumentParser()
neuroglancer.cli.add_server_arguments(ap)
args = ap.parse_args()
neuroglancer.cli.handle_server_arguments(args)
viewer = neuroglancer.Viewer()

with viewer.txn() as s:
s.layers['image'] = neuroglancer.ImageLayer(
source='precomputed://gs://neuroglancer-public-data/flyem_fib-25/image',
panels=[
neuroglancer.LayerSidePanelState(
side='left',
col = 0,
row = 0,
tab='render',
tabs=['source', 'rendering'],
),
neuroglancer.LayerSidePanelState(
side='left',
col = 0,
row=1,
tab='render',
tabs=['annotations'],
),
],
)
s.layers['ground_truth'] = neuroglancer.SegmentationLayer(
source='precomputed://gs://neuroglancer-public-data/flyem_fib-25/ground_truth',
)
print(viewer.state)
print(viewer)
webbrowser.open_new(viewer.get_viewer_url())
3 changes: 3 additions & 0 deletions python/neuroglancer/viewer_config_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ class ConfigState(JsonObjectWrapper):
show_location = showLocation = wrapped_property('showLocation', optional(bool, True))
show_layer_panel = showLayerPanel = wrapped_property('showLayerPanel', optional(bool, True))
show_help_button = showHelpButton = wrapped_property('showHelpButton', optional(bool, True))
show_layer_side_panel_button = showLayerSidePanelButton = wrapped_property('showLayerSidePanelButton', optional(bool, True))
show_layer_list_panel_button = showLayerListPanelButton = wrapped_property('showLayerListPanelButton', optional(bool, True))
show_selection_panel_button = showSelectionPanelButton = wrapped_property('showSelectionPanelButton', optional(bool, True))
show_panel_borders = showPanelBorders = wrapped_property('showPanelBorders',
optional(bool, True))
scale_bar_options = scaleBarOptions = wrapped_property('scaleBarOptions', ScaleBarOptions)
Expand Down
Loading

0 comments on commit 2ff8d53

Please sign in to comment.