-
Notifications
You must be signed in to change notification settings - Fork 312
/
Copy pathexample_grid_layout.py
39 lines (36 loc) · 1.34 KB
/
example_grid_layout.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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",
)
s.layers["ground_truth"] = neuroglancer.SegmentationLayer(
source="precomputed://gs://neuroglancer-public-data/flyem_fib-25/ground_truth",
)
s.layout = neuroglancer.row_layout(
[
neuroglancer.column_layout(
[
neuroglancer.LayerGroupViewer(layers=["image", "ground_truth"]),
neuroglancer.LayerGroupViewer(layers=["image", "ground_truth"]),
]
),
neuroglancer.column_layout(
[
neuroglancer.LayerGroupViewer(layers=["ground_truth"]),
neuroglancer.LayerGroupViewer(layers=["ground_truth"]),
]
),
]
)
print(viewer.state)
print(viewer)
webbrowser.open_new(viewer.get_viewer_url())