Skip to content

Commit 5854f05

Browse files
committed
feat: small props update
1 parent 3afd209 commit 5854f05

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

examples/write_points_with_properties.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def write_some_annotations(
2323
id="size",
2424
description="Size of the annotation",
2525
type="float32",
26-
default=10,
2726
),
2827
neuroglancer.AnnotationPropertySpec(
2928
id="p_int8",
@@ -65,6 +64,14 @@ def write_some_annotations(
6564
"Three",
6665
],
6766
),
67+
neuroglancer.AnnotationPropertySpec(
68+
id="p_boola",
69+
type="uint16",
70+
default=1,
71+
description="A boolean property",
72+
enum_values=[0, 1],
73+
enum_labels=["False", "True"],
74+
),
6875
]
6976

7077
writer = neuroglancer.write_annotations.AnnotationWriter(
@@ -94,14 +101,15 @@ def write_some_annotations(
94101
p_fnum32=2.6,
95102
)
96103
writer.add_point(
97-
[40, 50, 52],
98-
color=(0, 0, 255), # RGB color
104+
[40, 50, 20],
105+
color="#0000ff", # RGB color
99106
size=20,
100107
p_int8=3,
101108
p_uint8=4,
102109
rgba_color=(0, 200, 255, 14), # RGBA color with part opacity
103110
p_enum1=3,
104111
p_fnum32=3.0,
112+
p_boola=0,
105113
)
106114
writer.add_point([40, 50, 52])
107115
writer.write(os.path.join(output_dir, "point"))

0 commit comments

Comments
 (0)