Skip to content

Commit 5aff9c8

Browse files
committed
feat: make co-ord space examples
1 parent 424d638 commit 5aff9c8

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

examples/make_coordinate_space.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import json
2+
3+
old_space_str = r'{"x": [6.000000000000001e-9, "m"],"y": [6.000000000000001e-9,"m"], "z": [3.0000000000000004e-8, "m"]}'
4+
5+
old_space = json.loads(old_space_str)
6+
print(old_space)
7+
8+
new_space_str = r'[{"name": "x", "scale": [6.000000000000001e-9, "m"]}, {"name": "y", "scale": [6.000000000000001e-9, "m"]}, {"name": "z", "scale": [3.0000000000000004e-8, "m"]}]'
9+
10+
new_space = json.loads(new_space_str)
11+
print(new_space)
12+
13+
from neuroglancer import CoordinateSpace
14+
15+
old_coordinate_space = CoordinateSpace(old_space)
16+
print(old_coordinate_space)
17+
18+
new_coordinate_space = CoordinateSpace(new_space)
19+
print(new_coordinate_space)
20+
21+
co_ordinate_array_space = [
22+
{
23+
"name": "x",
24+
"coordinates": [0, 1, 2, 3, 4],
25+
"labels": ["a", "b", "c", "d", "e"],
26+
}
27+
]
28+
29+
coordinate_space = CoordinateSpace(co_ordinate_array_space)
30+
print(coordinate_space)

0 commit comments

Comments
 (0)