Skip to content

Commit a73d0ee

Browse files
authored
Merge pull request #86 from acquire-project/dgm_chunking
Updating Tutorials for 0.3.0
2 parents bf81d14 + 9744b73 commit a73d0ee

File tree

17 files changed

+296
-506
lines changed

17 files changed

+296
-506
lines changed

docs/examples/livestream_napari.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,12 @@ def is_not_done() -> bool:
6464
def next_frame(): #-> Optional[npt.NDArray[Any]]:
6565
"""Get the next frame from the current stream."""
6666
if nframes[stream_id] < config.video[stream_id].max_frame_count:
67-
if packet := runtime.get_available_data(stream_id):
68-
n = packet.get_frame_count()
69-
nframes[stream_id] += n
70-
f = next(packet.frames())
71-
return f.data().squeeze().copy()
67+
with runtime.get_available_data(stream_id) as data:
68+
if packet := data:
69+
n = packet.get_frame_count()
70+
nframes[stream_id] += n
71+
f = next(packet.frames())
72+
return f.data().squeeze().copy()
7273
return None
7374

7475
stream = 1

docs/examples/sample_props.json

Lines changed: 178 additions & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -1,200 +1,186 @@
11
{
2-
"video": [
3-
{
4-
"camera": {
5-
"identifier": {
6-
"id": [
7-
0,
8-
1
9-
],
10-
"kind": "Camera",
11-
"name": "simulated: radial sin"
12-
},
13-
"settings": {
14-
"binning": 1,
15-
"exposure_time_us": 0.0,
16-
"input_triggers": {
17-
"acquisition_start": {
18-
"edge": "Rising",
19-
"enable": false,
20-
"kind": "Input",
21-
"line": 0
22-
},
23-
"exposure": {
24-
"edge": "Rising",
25-
"enable": false,
26-
"kind": "Input",
27-
"line": 0
28-
},
29-
"frame_start": {
30-
"edge": "Rising",
31-
"enable": false,
32-
"kind": "Input",
33-
"line": 0
34-
}
35-
},
36-
"line_interval_us": 0.0,
37-
"offset": [
38-
0,
39-
0
40-
],
41-
"output_triggers": {
42-
"exposure": {
43-
"edge": "Rising",
44-
"enable": false,
45-
"kind": "Input",
46-
"line": 0
2+
"video": [
3+
{
4+
"camera": {
5+
"identifier": {
6+
"id": [
7+
0,
8+
1
9+
],
10+
"kind": "Camera",
11+
"name": "simulated: radial sin"
12+
},
13+
"settings": {
14+
"binning": 1,
15+
"exposure_time_us": 0.0,
16+
"input_triggers": {
17+
"acquisition_start": {
18+
"edge": "Rising",
19+
"enable": false,
20+
"kind": "Input",
21+
"line": 0
22+
},
23+
"exposure": {
24+
"edge": "Rising",
25+
"enable": false,
26+
"kind": "Input",
27+
"line": 0
28+
},
29+
"frame_start": {
30+
"edge": "Rising",
31+
"enable": false,
32+
"kind": "Input",
33+
"line": 0
34+
}
35+
},
36+
"line_interval_us": 0.0,
37+
"offset": [
38+
0,
39+
0
40+
],
41+
"output_triggers": {
42+
"exposure": {
43+
"edge": "Rising",
44+
"enable": false,
45+
"kind": "Input",
46+
"line": 0
47+
},
48+
"frame_start": {
49+
"edge": "Rising",
50+
"enable": false,
51+
"kind": "Input",
52+
"line": 0
53+
},
54+
"trigger_wait": {
55+
"edge": "Rising",
56+
"enable": false,
57+
"kind": "Input",
58+
"line": 0
59+
}
60+
},
61+
"pixel_type": "U16",
62+
"readout_direction": "Forward",
63+
"shape": [
64+
1,
65+
1
66+
]
67+
}
4768
},
48-
"frame_start": {
49-
"edge": "Rising",
50-
"enable": false,
51-
"kind": "Input",
52-
"line": 0
53-
},
54-
"trigger_wait": {
55-
"edge": "Rising",
56-
"enable": false,
57-
"kind": "Input",
58-
"line": 0
59-
}
60-
},
61-
"pixel_type": "U16",
62-
"readout_direction": "Forward",
63-
"shape": [
64-
1,
65-
1
66-
]
67-
}
68-
},
69-
"frame_average_count": 0,
70-
"max_frame_count": 18446744073709551615,
71-
"storage": {
72-
"identifier": {
73-
"id": [
74-
0,
75-
0
76-
],
77-
"kind": "NONE",
78-
"name": ""
79-
},
80-
"settings": {
81-
"chunking": {
82-
"max_bytes_per_chunk": 16777216,
83-
"tile": {
84-
"height": 0,
85-
"planes": 0,
86-
"width": 0
69+
"frame_average_count": 0,
70+
"max_frame_count": 18446744073709551615,
71+
"storage": {
72+
"identifier": {
73+
"id": [
74+
0,
75+
5
76+
],
77+
"kind": "Storage",
78+
"name": "trash"
79+
},
80+
"settings": {
81+
"acquisition_dimensions": [],
82+
"enable_multiscale": false,
83+
"external_metadata_json": "",
84+
"filename": "",
85+
"first_frame_id": 0,
86+
"pixel_scale_um": [
87+
0.0,
88+
0.0
89+
]
90+
},
91+
"write_delay_ms": 0.0
8792
}
88-
},
89-
"enable_multiscale": false,
90-
"external_metadata_json": "",
91-
"filename": "",
92-
"first_frame_id": 0,
93-
"pixel_scale_um": [
94-
0.0,
95-
0.0
96-
]
9793
},
98-
"write_delay_ms": 0.0
99-
}
100-
},
101-
{
102-
"camera": {
103-
"identifier": {
104-
"id": [
105-
0,
106-
0
107-
],
108-
"kind": "NONE",
109-
"name": ""
110-
},
111-
"settings": {
112-
"binning": 1,
113-
"exposure_time_us": 0.0,
114-
"input_triggers": {
115-
"acquisition_start": {
116-
"edge": "Rising",
117-
"enable": false,
118-
"kind": "Input",
119-
"line": 0
120-
},
121-
"exposure": {
122-
"edge": "Rising",
123-
"enable": false,
124-
"kind": "Input",
125-
"line": 0
126-
},
127-
"frame_start": {
128-
"edge": "Rising",
129-
"enable": false,
130-
"kind": "Input",
131-
"line": 0
132-
}
133-
},
134-
"line_interval_us": 0.0,
135-
"offset": [
136-
0,
137-
0
138-
],
139-
"output_triggers": {
140-
"exposure": {
141-
"edge": "Rising",
142-
"enable": false,
143-
"kind": "Input",
144-
"line": 0
94+
{
95+
"camera": {
96+
"identifier": {
97+
"id": [
98+
0,
99+
0
100+
],
101+
"kind": "NONE",
102+
"name": ""
103+
},
104+
"settings": {
105+
"binning": 1,
106+
"exposure_time_us": 0.0,
107+
"input_triggers": {
108+
"acquisition_start": {
109+
"edge": "Rising",
110+
"enable": false,
111+
"kind": "Input",
112+
"line": 0
113+
},
114+
"exposure": {
115+
"edge": "Rising",
116+
"enable": false,
117+
"kind": "Input",
118+
"line": 0
119+
},
120+
"frame_start": {
121+
"edge": "Rising",
122+
"enable": false,
123+
"kind": "Input",
124+
"line": 0
125+
}
126+
},
127+
"line_interval_us": 0.0,
128+
"offset": [
129+
0,
130+
0
131+
],
132+
"output_triggers": {
133+
"exposure": {
134+
"edge": "Rising",
135+
"enable": false,
136+
"kind": "Input",
137+
"line": 0
138+
},
139+
"frame_start": {
140+
"edge": "Rising",
141+
"enable": false,
142+
"kind": "Input",
143+
"line": 0
144+
},
145+
"trigger_wait": {
146+
"edge": "Rising",
147+
"enable": false,
148+
"kind": "Input",
149+
"line": 0
150+
}
151+
},
152+
"pixel_type": "U16",
153+
"readout_direction": "Forward",
154+
"shape": [
155+
0,
156+
0
157+
]
158+
}
145159
},
146-
"frame_start": {
147-
"edge": "Rising",
148-
"enable": false,
149-
"kind": "Input",
150-
"line": 0
151-
},
152-
"trigger_wait": {
153-
"edge": "Rising",
154-
"enable": false,
155-
"kind": "Input",
156-
"line": 0
160+
"frame_average_count": 0,
161+
"max_frame_count": 18446744073709551615,
162+
"storage": {
163+
"identifier": {
164+
"id": [
165+
0,
166+
0
167+
],
168+
"kind": "NONE",
169+
"name": ""
170+
},
171+
"settings": {
172+
"acquisition_dimensions": [],
173+
"enable_multiscale": false,
174+
"external_metadata_json": "",
175+
"filename": "",
176+
"first_frame_id": 0,
177+
"pixel_scale_um": [
178+
0.0,
179+
0.0
180+
]
181+
},
182+
"write_delay_ms": 0.0
157183
}
158-
},
159-
"pixel_type": "U16",
160-
"readout_direction": "Forward",
161-
"shape": [
162-
0,
163-
0
164-
]
165184
}
166-
},
167-
"frame_average_count": 0,
168-
"max_frame_count": 18446744073709551615,
169-
"storage": {
170-
"identifier": {
171-
"id": [
172-
0,
173-
0
174-
],
175-
"kind": "NONE",
176-
"name": ""
177-
},
178-
"settings": {
179-
"chunking": {
180-
"max_bytes_per_chunk": 16777216,
181-
"tile": {
182-
"height": 0,
183-
"planes": 0,
184-
"width": 0
185-
}
186-
},
187-
"enable_multiscale": false,
188-
"external_metadata_json": "",
189-
"filename": "",
190-
"first_frame_id": 0,
191-
"pixel_scale_um": [
192-
0.0,
193-
0.0
194-
]
195-
},
196-
"write_delay_ms": 0.0
197-
}
198-
}
199-
]
185+
]
200186
}

0 commit comments

Comments
 (0)