Skip to content

Commit 62ef4c2

Browse files
committed
feat: update examples
1 parent 2c7193f commit 62ef4c2

File tree

6 files changed

+23
-2
lines changed

6 files changed

+23
-2
lines changed

examples/all_data_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def add_image_layer(state, dtype, **kwargs):
5858

5959
def get_shader():
6060
return """
61-
#uicontrol transferFunction colormap(window=[0,120])
61+
#uicontrol transferFunction colormap
6262
void main() {
6363
emitRGBA(colormap());
6464
}

examples/max_projection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,5 @@ def launch_nglancer():
6060
print("shot 1 taken")
6161

6262
with open("p1.png", "wb") as f:
63+
print(s1.screenshot.resolution_metadata)
6364
f.write(s1.screenshot.image)

examples/minimal_screenshot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def main():
6262
with viewer.txn() as s:
6363
s.layers["image"].volume_rendering_gain = 10.0
6464
s2 = viewer.screenshot(size=[1000, 1000])
65+
print(s2.screenshot.resolutionMetadata.panelResolutionData[0].type)
6566
print(viewer.state.layers["image"].volumeRenderingGain)
6667
print("shot 2 taken")
6768

examples/serve_default_dir.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
from neuroglancer_utils.create_datasets.create_full_cube import create_cube
2+
from neuroglancer_utils.create_datasets.create_full_cube_16 import (
3+
create_cube as create_cube_16,
4+
)
25
from neuroglancer_utils.create_datasets.create_sphere import create_sphere
36
from neuroglancer_utils.create_datasets.create_allen_multi import create_allen_multi
47
from neuroglancer_utils.create_datasets.create_cdf_example import create_cdf_example
58
from neuroglancer_utils.create_datasets.create_border_data import create_border_example
69
from neuroglancer_utils.local_server import create_server
710

811
create_cube()
12+
create_cube_16()
913
create_sphere()
1014
create_allen_multi()
1115
create_cdf_example()

neuroglancer_utils/create_datasets/create_full_cube.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import numpy as np
33

44
def create_cube(output_path="file://datasets/cube"):
5-
rawdata = np.full(shape=(100, 100, 100), fill_value=255.0).astype(np.float32)
5+
rawdata = np.full(shape=(100, 100, 100), fill_value=70.0).astype(np.float32)
66
CloudVolume.from_numpy(
77
rawdata,
88
vol_path=output_path,
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from cloudvolume import CloudVolume
2+
import numpy as np
3+
4+
5+
def create_cube(output_path="file://datasets/cube-sixteen"):
6+
rawdata = np.full(shape=(100, 100, 100), fill_value=70).astype(np.uint32)
7+
CloudVolume.from_numpy(
8+
rawdata,
9+
vol_path=output_path,
10+
resolution=(40, 40, 40),
11+
chunk_size=(100, 100, 100),
12+
layer_type="image",
13+
progress=True,
14+
compress=False,
15+
)

0 commit comments

Comments
 (0)