np_codeocean 0.3.5__py3-none-any.whl → 0.3.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- np_codeocean/__init__.py +1 -1
- np_codeocean/metadata/__init__.py +1 -1
- np_codeocean/metadata/common.py +1 -3
- np_codeocean/metadata/core.py +333 -331
- np_codeocean/metadata/dynamic_routing_task_etl.py +1 -1
- np_codeocean/metadata/model_templates/behavior_box.py +115 -115
- np_codeocean/metadata/model_templates/neuropixels_rig.py +544 -544
- np_codeocean/metadata/np.py +1 -1
- np_codeocean/metadata/rigs.py +1 -1
- np_codeocean/metadata/storage.py +78 -78
- np_codeocean/metadata/update.py +1 -2
- np_codeocean/metadata/utils.py +1 -1
- np_codeocean/np_session_utils.py +462 -385
- np_codeocean/scripts/upload_dynamic_routing_behavior.py +483 -413
- np_codeocean/scripts/upload_dynamic_routing_ecephys.py +279 -217
- np_codeocean/scripts/upload_split_recordings_example.py +39 -33
- np_codeocean/utils.py +671 -563
- {np_codeocean-0.3.5.dist-info → np_codeocean-0.3.7.dist-info}/METADATA +38 -6
- np_codeocean-0.3.7.dist-info/RECORD +23 -0
- {np_codeocean-0.3.5.dist-info → np_codeocean-0.3.7.dist-info}/WHEEL +2 -1
- {np_codeocean-0.3.5.dist-info → np_codeocean-0.3.7.dist-info}/entry_points.txt +0 -3
- np_codeocean-0.3.7.dist-info/top_level.txt +1 -0
- np_codeocean-0.3.5.dist-info/RECORD +0 -22
|
@@ -1,544 +1,544 @@
|
|
|
1
|
-
import datetime
|
|
2
|
-
import logging
|
|
3
|
-
import typing
|
|
4
|
-
|
|
5
|
-
from aind_data_schema.components import coordinates, devices
|
|
6
|
-
from aind_data_schema.core import rig
|
|
7
|
-
from aind_data_schema_models import organizations
|
|
8
|
-
|
|
9
|
-
from np_codeocean.metadata import common, rigs
|
|
10
|
-
|
|
11
|
-
COPA_NOTES = (
|
|
12
|
-
"The rotation matrix is represented as: a,b,c,d,e,f,g,h,i. Wherein a, b, "
|
|
13
|
-
"c correspond to the first row of the matrix. The translation matrix is "
|
|
14
|
-
"represented as: x,y,z."
|
|
15
|
-
)
|
|
16
|
-
DEFAULT_HOSTNAME = "127.0.0.1"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
logger = logging.getLogger(__name__)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def init(
|
|
23
|
-
rig_name: common.RigName,
|
|
24
|
-
modification_date: typing.Optional[datetime.date] = None,
|
|
25
|
-
manipulator_infos: list[common.ManipulatorInfo] = [],
|
|
26
|
-
mon_computer_name: str = DEFAULT_HOSTNAME,
|
|
27
|
-
stim_computer_name: str = DEFAULT_HOSTNAME,
|
|
28
|
-
sync_computer_name: str = DEFAULT_HOSTNAME,
|
|
29
|
-
) -> rig.Rig:
|
|
30
|
-
"""Initializes a rig model for the dynamic routing project.
|
|
31
|
-
|
|
32
|
-
>>> rig_model = init("NP3")
|
|
33
|
-
|
|
34
|
-
Notes
|
|
35
|
-
-----
|
|
36
|
-
- rig_id is expected to be in the format:
|
|
37
|
-
<ROOM NAME>_<RIG NAME>_<MODIFICATION DATE>
|
|
38
|
-
- The DR task does not set the brightness and contrast of the monitor.
|
|
39
|
-
These are hardcoded and assumed to be static.
|
|
40
|
-
"""
|
|
41
|
-
if not modification_date:
|
|
42
|
-
modification_date = datetime.date.today()
|
|
43
|
-
|
|
44
|
-
room_name = rigs.get_rig_room(rig_name)
|
|
45
|
-
mod_date_str = modification_date.strftime(common.MODIFICATION_DATE_FORMAT)
|
|
46
|
-
rig_id = f"{rig_name}_{mod_date_str}"
|
|
47
|
-
if room_name is not None:
|
|
48
|
-
rig_id = f"{room_name}_{rig_id}"
|
|
49
|
-
|
|
50
|
-
shared_camera_props = {
|
|
51
|
-
"detector_type": "Camera",
|
|
52
|
-
"model": "G-032",
|
|
53
|
-
"sensor_width": 7400,
|
|
54
|
-
"sensor_height": 7400,
|
|
55
|
-
"size_unit": devices.SizeUnit.NM,
|
|
56
|
-
"notes": "Max frame rate is at maximum resolution.",
|
|
57
|
-
"cooling": devices.Cooling.NONE,
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
shared_camera_assembly_relative_position_props = {
|
|
61
|
-
"device_origin": (
|
|
62
|
-
"Located on the face of the lens mounting surface at its center, "
|
|
63
|
-
"ie. just ahead of the camera sensor."
|
|
64
|
-
),
|
|
65
|
-
"device_axes": [
|
|
66
|
-
coordinates.Axis(
|
|
67
|
-
name=coordinates.AxisName.X,
|
|
68
|
-
direction=(
|
|
69
|
-
"Positive is from the center of the sensor towards the "
|
|
70
|
-
"left of the assembly, from the subject's perspective."
|
|
71
|
-
),
|
|
72
|
-
),
|
|
73
|
-
coordinates.Axis(
|
|
74
|
-
name=coordinates.AxisName.Y,
|
|
75
|
-
direction=(
|
|
76
|
-
"Positive is from the center of the sensor towards the "
|
|
77
|
-
"bottom of the assembly."
|
|
78
|
-
),
|
|
79
|
-
),
|
|
80
|
-
coordinates.Axis(
|
|
81
|
-
name=coordinates.AxisName.Z,
|
|
82
|
-
direction=("Positive is from the sensor towards the subject."),
|
|
83
|
-
),
|
|
84
|
-
],
|
|
85
|
-
"notes": COPA_NOTES,
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
ephys_assemblies = []
|
|
89
|
-
for assembly_letter in ["A", "B", "C", "D", "E", "F"]:
|
|
90
|
-
serial_number = None
|
|
91
|
-
for manipulator_info in manipulator_infos:
|
|
92
|
-
if manipulator_info.assembly_name == f"Ephys Assembly {assembly_letter}":
|
|
93
|
-
serial_number = manipulator_info.serial_number
|
|
94
|
-
break
|
|
95
|
-
ephys_assemblies.append(
|
|
96
|
-
rig.EphysAssembly(
|
|
97
|
-
name=f"Ephys Assembly {assembly_letter}",
|
|
98
|
-
manipulator=devices.Manipulator(
|
|
99
|
-
name=f"Ephys Assembly {assembly_letter} Manipulator",
|
|
100
|
-
manufacturer=(organizations.Organization.NEW_SCALE_TECHNOLOGIES),
|
|
101
|
-
model="06591-M-0004",
|
|
102
|
-
serial_number=serial_number,
|
|
103
|
-
),
|
|
104
|
-
probes=[
|
|
105
|
-
devices.EphysProbe(
|
|
106
|
-
name=f"Probe{assembly_letter}",
|
|
107
|
-
probe_model="Neuropixels 1.0",
|
|
108
|
-
manufacturer=organizations.Organization.IMEC,
|
|
109
|
-
)
|
|
110
|
-
],
|
|
111
|
-
)
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
model = rig.Rig(
|
|
115
|
-
rig_id=rig_id,
|
|
116
|
-
modification_date=modification_date,
|
|
117
|
-
modalities=[
|
|
118
|
-
rig.Modality.BEHAVIOR_VIDEOS,
|
|
119
|
-
rig.Modality.BEHAVIOR,
|
|
120
|
-
rig.Modality.ECEPHYS,
|
|
121
|
-
],
|
|
122
|
-
mouse_platform=devices.Disc(
|
|
123
|
-
name="Mouse Platform",
|
|
124
|
-
radius="4.69",
|
|
125
|
-
radius_unit="centimeter",
|
|
126
|
-
notes=(
|
|
127
|
-
"Radius is the distance from the center of the wheel to the " "mouse."
|
|
128
|
-
),
|
|
129
|
-
),
|
|
130
|
-
stimulus_devices=[
|
|
131
|
-
devices.Monitor(
|
|
132
|
-
name="Stim",
|
|
133
|
-
model="PA248",
|
|
134
|
-
manufacturer=organizations.Organization.ASUS,
|
|
135
|
-
width=1920,
|
|
136
|
-
height=1200,
|
|
137
|
-
size_unit="pixel",
|
|
138
|
-
viewing_distance=15.3,
|
|
139
|
-
viewing_distance_unit="centimeter",
|
|
140
|
-
refresh_rate=60,
|
|
141
|
-
brightness=43,
|
|
142
|
-
contrast=50,
|
|
143
|
-
position=coordinates.RelativePosition(
|
|
144
|
-
device_position_transformations=[
|
|
145
|
-
coordinates.Rotation3dTransform(
|
|
146
|
-
rotation=[
|
|
147
|
-
-0.80914,
|
|
148
|
-
-0.58761,
|
|
149
|
-
0,
|
|
150
|
-
-0.12391,
|
|
151
|
-
0.17063,
|
|
152
|
-
0.97751,
|
|
153
|
-
0.08751,
|
|
154
|
-
-0.12079,
|
|
155
|
-
0.02298,
|
|
156
|
-
],
|
|
157
|
-
),
|
|
158
|
-
coordinates.Translation3dTransform(
|
|
159
|
-
translation=[0.08751, -0.12079, 0.02298]
|
|
160
|
-
),
|
|
161
|
-
],
|
|
162
|
-
device_origin=(
|
|
163
|
-
"Located at the center of the screen. Right and left "
|
|
164
|
-
"conventions are relative to the screen side of the "
|
|
165
|
-
"monitor, ie. from the subject's perspective."
|
|
166
|
-
),
|
|
167
|
-
device_axes=[
|
|
168
|
-
coordinates.Axis(
|
|
169
|
-
name=coordinates.AxisName.X,
|
|
170
|
-
direction=(
|
|
171
|
-
"Positive is from the center towards the "
|
|
172
|
-
"right of the screen, from the subject's "
|
|
173
|
-
"perspective."
|
|
174
|
-
),
|
|
175
|
-
),
|
|
176
|
-
coordinates.Axis(
|
|
177
|
-
name=coordinates.AxisName.Y,
|
|
178
|
-
direction=(
|
|
179
|
-
"Positive is from the center towards the top "
|
|
180
|
-
"of the screen."
|
|
181
|
-
),
|
|
182
|
-
),
|
|
183
|
-
coordinates.Axis(
|
|
184
|
-
name=coordinates.AxisName.Z,
|
|
185
|
-
direction=(
|
|
186
|
-
"Positive is from the front of the screen "
|
|
187
|
-
"towards the subject."
|
|
188
|
-
),
|
|
189
|
-
),
|
|
190
|
-
],
|
|
191
|
-
notes=COPA_NOTES,
|
|
192
|
-
),
|
|
193
|
-
),
|
|
194
|
-
devices.Speaker(
|
|
195
|
-
name="Speaker",
|
|
196
|
-
manufacturer=organizations.Organization.ISL,
|
|
197
|
-
model="SPK-I-81345",
|
|
198
|
-
position=coordinates.RelativePosition(
|
|
199
|
-
device_position_transformations=[
|
|
200
|
-
coordinates.Rotation3dTransform(
|
|
201
|
-
rotation=[
|
|
202
|
-
-0.82783,
|
|
203
|
-
-0.4837,
|
|
204
|
-
-0.28412,
|
|
205
|
-
-0.55894,
|
|
206
|
-
0.75426,
|
|
207
|
-
0.34449,
|
|
208
|
-
0.04767,
|
|
209
|
-
0.44399,
|
|
210
|
-
-0.89476,
|
|
211
|
-
],
|
|
212
|
-
),
|
|
213
|
-
coordinates.Translation3dTransform(
|
|
214
|
-
translation=[-0.00838, -0.09787, 0.18228]
|
|
215
|
-
),
|
|
216
|
-
],
|
|
217
|
-
device_origin=(
|
|
218
|
-
"Located on the front mounting flange face. Right "
|
|
219
|
-
"and left conventions are relative to the front side "
|
|
220
|
-
"of the speaker, ie. from the subject's perspective."
|
|
221
|
-
),
|
|
222
|
-
device_axes=[
|
|
223
|
-
coordinates.Axis(
|
|
224
|
-
name=coordinates.AxisName.X,
|
|
225
|
-
direction=(
|
|
226
|
-
"Positive is from the center of the speaker "
|
|
227
|
-
"towards the right of the speaker, from the "
|
|
228
|
-
"subject's perspective."
|
|
229
|
-
),
|
|
230
|
-
),
|
|
231
|
-
coordinates.Axis(
|
|
232
|
-
name=coordinates.AxisName.Y,
|
|
233
|
-
direction=(
|
|
234
|
-
"Positive is from the center towards the top "
|
|
235
|
-
"of the speaker."
|
|
236
|
-
),
|
|
237
|
-
),
|
|
238
|
-
coordinates.Axis(
|
|
239
|
-
name=coordinates.AxisName.Z,
|
|
240
|
-
direction=(
|
|
241
|
-
"Positive is from the speaker towards the " "subject."
|
|
242
|
-
),
|
|
243
|
-
),
|
|
244
|
-
],
|
|
245
|
-
notes=COPA_NOTES
|
|
246
|
-
+ (
|
|
247
|
-
" Speaker to be mounted with the X axis pointing to "
|
|
248
|
-
"the right when viewing the speaker along the Z axis"
|
|
249
|
-
),
|
|
250
|
-
),
|
|
251
|
-
),
|
|
252
|
-
devices.RewardDelivery(
|
|
253
|
-
reward_spouts=[
|
|
254
|
-
devices.RewardSpout(
|
|
255
|
-
name="Reward Spout",
|
|
256
|
-
manufacturer=organizations.Organization.HAMILTON,
|
|
257
|
-
model="8649-01 Custom",
|
|
258
|
-
spout_diameter=0.672,
|
|
259
|
-
spout_diameter_unit="millimeter",
|
|
260
|
-
side=devices.SpoutSide.CENTER,
|
|
261
|
-
solenoid_valve=devices.Device(
|
|
262
|
-
name="Solenoid Valve",
|
|
263
|
-
device_type="Solenoid Valve",
|
|
264
|
-
manufacturer=organizations.Organization.NRESEARCH_INC,
|
|
265
|
-
model="161K011",
|
|
266
|
-
notes="Model number is product number.",
|
|
267
|
-
),
|
|
268
|
-
lick_sensor=devices.Device(
|
|
269
|
-
name="Lick Sensor",
|
|
270
|
-
device_type="Lick Sensor",
|
|
271
|
-
manufacturer=organizations.Organization.OTHER,
|
|
272
|
-
),
|
|
273
|
-
lick_sensor_type=devices.LickSensorType.PIEZOELECTIC,
|
|
274
|
-
notes=(
|
|
275
|
-
"Spout diameter is for inner diameter. "
|
|
276
|
-
"Outer diameter is 1.575mm. "
|
|
277
|
-
),
|
|
278
|
-
),
|
|
279
|
-
]
|
|
280
|
-
),
|
|
281
|
-
],
|
|
282
|
-
ephys_assemblies=ephys_assemblies,
|
|
283
|
-
light_sources=[
|
|
284
|
-
devices.LightEmittingDiode(
|
|
285
|
-
manufacturer=organizations.Organization.OTHER,
|
|
286
|
-
name="Face forward LED",
|
|
287
|
-
model="LZ4-40R308-0000",
|
|
288
|
-
wavelength=740,
|
|
289
|
-
wavelength_unit=devices.SizeUnit.NM,
|
|
290
|
-
),
|
|
291
|
-
devices.LightEmittingDiode(
|
|
292
|
-
manufacturer=organizations.Organization.OTHER,
|
|
293
|
-
name="Body LED",
|
|
294
|
-
model="LZ4-40R308-0000",
|
|
295
|
-
wavelength=740,
|
|
296
|
-
wavelength_unit=devices.SizeUnit.NM,
|
|
297
|
-
),
|
|
298
|
-
devices.LightEmittingDiode(
|
|
299
|
-
manufacturer=organizations.Organization.AMS_OSRAM,
|
|
300
|
-
name="Eye LED",
|
|
301
|
-
model="LZ4-40R608-0000",
|
|
302
|
-
wavelength=850,
|
|
303
|
-
wavelength_unit=devices.SizeUnit.NM,
|
|
304
|
-
),
|
|
305
|
-
devices.Laser(
|
|
306
|
-
name="Laser #0",
|
|
307
|
-
manufacturer=organizations.Organization.VORTRAN,
|
|
308
|
-
wavelength=488.0,
|
|
309
|
-
model="Stradus 488-50",
|
|
310
|
-
wavelength_unit="nanometer",
|
|
311
|
-
),
|
|
312
|
-
devices.Laser(
|
|
313
|
-
name="Laser #1",
|
|
314
|
-
manufacturer=organizations.Organization.VORTRAN,
|
|
315
|
-
wavelength=633.0,
|
|
316
|
-
model="Stradus 633-80",
|
|
317
|
-
wavelength_unit="nanometer",
|
|
318
|
-
),
|
|
319
|
-
],
|
|
320
|
-
cameras=[
|
|
321
|
-
devices.CameraAssembly(
|
|
322
|
-
name="Front",
|
|
323
|
-
camera_target="Face forward",
|
|
324
|
-
camera=devices.Camera(
|
|
325
|
-
name="Front camera",
|
|
326
|
-
manufacturer=organizations.Organization.ALLIED,
|
|
327
|
-
chroma="Monochrome",
|
|
328
|
-
data_interface="Ethernet",
|
|
329
|
-
computer_name=mon_computer_name,
|
|
330
|
-
**shared_camera_props,
|
|
331
|
-
),
|
|
332
|
-
filter=devices.Filter(
|
|
333
|
-
name="Front filter",
|
|
334
|
-
manufacturer=organizations.Organization.SEMROCK,
|
|
335
|
-
model="FF01-715_LP-25",
|
|
336
|
-
filter_type=devices.FilterType.LONGPASS,
|
|
337
|
-
),
|
|
338
|
-
lens=devices.Lens(
|
|
339
|
-
name="Front lens",
|
|
340
|
-
manufacturer=organizations.Organization.EDMUND_OPTICS,
|
|
341
|
-
focal_length=8.5,
|
|
342
|
-
focal_length_unit="millimeter",
|
|
343
|
-
model="86604",
|
|
344
|
-
),
|
|
345
|
-
position=coordinates.RelativePosition(
|
|
346
|
-
device_position_transformations=[
|
|
347
|
-
coordinates.Rotation3dTransform(
|
|
348
|
-
rotation=[
|
|
349
|
-
-0.17365,
|
|
350
|
-
0.98481,
|
|
351
|
-
0,
|
|
352
|
-
0.44709,
|
|
353
|
-
0.07883,
|
|
354
|
-
-0.89101,
|
|
355
|
-
-0.87747,
|
|
356
|
-
-0.15472,
|
|
357
|
-
-0.45399,
|
|
358
|
-
]
|
|
359
|
-
),
|
|
360
|
-
coordinates.Translation3dTransform(
|
|
361
|
-
translation=[0.154, 0.03078, 0.06346],
|
|
362
|
-
),
|
|
363
|
-
],
|
|
364
|
-
**shared_camera_assembly_relative_position_props,
|
|
365
|
-
),
|
|
366
|
-
),
|
|
367
|
-
devices.CameraAssembly(
|
|
368
|
-
name="Side",
|
|
369
|
-
camera_target="Body",
|
|
370
|
-
camera=devices.Camera(
|
|
371
|
-
name="Side camera",
|
|
372
|
-
manufacturer=organizations.Organization.ALLIED,
|
|
373
|
-
chroma="Monochrome",
|
|
374
|
-
data_interface="Ethernet",
|
|
375
|
-
computer_name=mon_computer_name,
|
|
376
|
-
**shared_camera_props,
|
|
377
|
-
),
|
|
378
|
-
filter=devices.Filter(
|
|
379
|
-
name="Side filter",
|
|
380
|
-
manufacturer=organizations.Organization.SEMROCK,
|
|
381
|
-
model="FF01-747/33-25",
|
|
382
|
-
filter_type=devices.FilterType.BANDPASS,
|
|
383
|
-
),
|
|
384
|
-
lens=devices.Lens(
|
|
385
|
-
name="Side lens",
|
|
386
|
-
manufacturer=organizations.Organization.NAVITAR,
|
|
387
|
-
focal_length=6.0,
|
|
388
|
-
focal_length_unit="millimeter",
|
|
389
|
-
),
|
|
390
|
-
position=coordinates.RelativePosition(
|
|
391
|
-
device_position_transformations=[
|
|
392
|
-
coordinates.Rotation3dTransform(
|
|
393
|
-
rotation=[-1, 0, 0, 0, 0, -1, 0, -1, 0]
|
|
394
|
-
),
|
|
395
|
-
coordinates.Translation3dTransform(
|
|
396
|
-
translation=[-0.03617, 0.23887, -0.02535],
|
|
397
|
-
),
|
|
398
|
-
],
|
|
399
|
-
**shared_camera_assembly_relative_position_props,
|
|
400
|
-
),
|
|
401
|
-
),
|
|
402
|
-
devices.CameraAssembly(
|
|
403
|
-
name="Eye",
|
|
404
|
-
camera_target="Eye",
|
|
405
|
-
camera=devices.Camera(
|
|
406
|
-
name="Eye camera",
|
|
407
|
-
manufacturer=organizations.Organization.ALLIED,
|
|
408
|
-
chroma="Monochrome",
|
|
409
|
-
data_interface="Ethernet",
|
|
410
|
-
computer_name=mon_computer_name,
|
|
411
|
-
**shared_camera_props,
|
|
412
|
-
),
|
|
413
|
-
filter=devices.Filter(
|
|
414
|
-
name="Eye filter",
|
|
415
|
-
manufacturer=organizations.Organization.SEMROCK,
|
|
416
|
-
model="FF01-850/10-25",
|
|
417
|
-
filter_type=devices.FilterType.BANDPASS,
|
|
418
|
-
),
|
|
419
|
-
lens=devices.Lens(
|
|
420
|
-
name="Eye lens",
|
|
421
|
-
manufacturer=(organizations.Organization.INFINITY_PHOTO_OPTICAL),
|
|
422
|
-
focal_length=6.0,
|
|
423
|
-
focal_length_unit="millimeter",
|
|
424
|
-
model="213073",
|
|
425
|
-
notes="Model number is SKU.",
|
|
426
|
-
),
|
|
427
|
-
position=coordinates.RelativePosition(
|
|
428
|
-
device_position_transformations=[
|
|
429
|
-
coordinates.Rotation3dTransform(
|
|
430
|
-
rotation=[
|
|
431
|
-
-0.5,
|
|
432
|
-
-0.86603,
|
|
433
|
-
0,
|
|
434
|
-
-0.366,
|
|
435
|
-
0.21131,
|
|
436
|
-
-0.90631,
|
|
437
|
-
0.78489,
|
|
438
|
-
-0.45315,
|
|
439
|
-
-0.42262,
|
|
440
|
-
]
|
|
441
|
-
),
|
|
442
|
-
coordinates.Translation3dTransform(
|
|
443
|
-
translation=[-0.14259, 0.06209, 0.09576],
|
|
444
|
-
),
|
|
445
|
-
],
|
|
446
|
-
**shared_camera_assembly_relative_position_props,
|
|
447
|
-
),
|
|
448
|
-
),
|
|
449
|
-
],
|
|
450
|
-
daqs=[
|
|
451
|
-
devices.DAQDevice(
|
|
452
|
-
manufacturer=organizations.Organization.NATIONAL_INSTRUMENTS,
|
|
453
|
-
name="Sync",
|
|
454
|
-
computer_name=sync_computer_name,
|
|
455
|
-
model="NI-6612",
|
|
456
|
-
data_interface=devices.DataInterface.PCIE,
|
|
457
|
-
),
|
|
458
|
-
devices.DAQDevice(
|
|
459
|
-
manufacturer=organizations.Organization.NATIONAL_INSTRUMENTS,
|
|
460
|
-
name="Behavior",
|
|
461
|
-
computer_name=stim_computer_name,
|
|
462
|
-
model="NI-6323",
|
|
463
|
-
data_interface=devices.DataInterface.USB,
|
|
464
|
-
),
|
|
465
|
-
devices.DAQDevice(
|
|
466
|
-
manufacturer=organizations.Organization.NATIONAL_INSTRUMENTS,
|
|
467
|
-
name="BehaviorSync",
|
|
468
|
-
computer_name=stim_computer_name,
|
|
469
|
-
model="NI-6001",
|
|
470
|
-
data_interface=devices.DataInterface.PCIE,
|
|
471
|
-
),
|
|
472
|
-
devices.DAQDevice(
|
|
473
|
-
manufacturer=organizations.Organization.NATIONAL_INSTRUMENTS,
|
|
474
|
-
name="Opto",
|
|
475
|
-
computer_name=stim_computer_name,
|
|
476
|
-
model="NI-9264",
|
|
477
|
-
data_interface=devices.DataInterface.ETH,
|
|
478
|
-
),
|
|
479
|
-
],
|
|
480
|
-
detectors=[
|
|
481
|
-
devices.Detector(
|
|
482
|
-
name="vsync photodiode",
|
|
483
|
-
model="PDA25K",
|
|
484
|
-
manufacturer=organizations.Organization.THORLABS,
|
|
485
|
-
data_interface=devices.DataInterface.OTHER,
|
|
486
|
-
notes="Data interface is unknown.",
|
|
487
|
-
detector_type=devices.DetectorType.OTHER,
|
|
488
|
-
cooling=devices.Cooling.AIR,
|
|
489
|
-
),
|
|
490
|
-
],
|
|
491
|
-
calibrations=[],
|
|
492
|
-
additional_devices=[
|
|
493
|
-
devices.Detector(
|
|
494
|
-
name="microphone",
|
|
495
|
-
manufacturer=organizations.Organization.DODOTRONIC,
|
|
496
|
-
model="MOM",
|
|
497
|
-
data_interface=devices.DataInterface.OTHER,
|
|
498
|
-
notes="Data interface is unknown.",
|
|
499
|
-
detector_type=devices.DetectorType.OTHER,
|
|
500
|
-
cooling=devices.Cooling.AIR,
|
|
501
|
-
),
|
|
502
|
-
devices.AdditionalImagingDevice(
|
|
503
|
-
name="Galvo x",
|
|
504
|
-
imaging_device_type=devices.ImagingDeviceType.GALVO,
|
|
505
|
-
),
|
|
506
|
-
devices.AdditionalImagingDevice(
|
|
507
|
-
name="Galvo y",
|
|
508
|
-
imaging_device_type=devices.ImagingDeviceType.GALVO,
|
|
509
|
-
),
|
|
510
|
-
],
|
|
511
|
-
rig_axes=[
|
|
512
|
-
coordinates.Axis(
|
|
513
|
-
name=coordinates.AxisName.X,
|
|
514
|
-
direction=(
|
|
515
|
-
"The world horizontal. Lays on the Mouse Sagittal Plane. "
|
|
516
|
-
"Positive direction is towards the nose of the mouse. "
|
|
517
|
-
),
|
|
518
|
-
),
|
|
519
|
-
coordinates.Axis(
|
|
520
|
-
name=coordinates.AxisName.Y,
|
|
521
|
-
direction=(
|
|
522
|
-
"Perpendicular to Y. Positive direction is "
|
|
523
|
-
"away from the nose of the mouse. "
|
|
524
|
-
),
|
|
525
|
-
),
|
|
526
|
-
coordinates.Axis(
|
|
527
|
-
name=coordinates.AxisName.Z,
|
|
528
|
-
direction="Positive pointing up.",
|
|
529
|
-
),
|
|
530
|
-
],
|
|
531
|
-
origin=coordinates.Origin.BREGMA,
|
|
532
|
-
patch_cords=[
|
|
533
|
-
devices.Patch(
|
|
534
|
-
name="Patch Cord #1",
|
|
535
|
-
manufacturer=organizations.Organization.THORLABS,
|
|
536
|
-
model="SM450 Custom Length, FC/PC Ends",
|
|
537
|
-
core_diameter=125.0,
|
|
538
|
-
numerical_aperture=0.10,
|
|
539
|
-
notes=("Numerical aperture is approximately between 0.10 and " "0.14."),
|
|
540
|
-
),
|
|
541
|
-
],
|
|
542
|
-
)
|
|
543
|
-
|
|
544
|
-
return rig.Rig.model_validate(model)
|
|
1
|
+
import datetime
|
|
2
|
+
import logging
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from aind_data_schema.components import coordinates, devices
|
|
6
|
+
from aind_data_schema.core import rig
|
|
7
|
+
from aind_data_schema_models import organizations
|
|
8
|
+
|
|
9
|
+
from np_codeocean.metadata import common, rigs
|
|
10
|
+
|
|
11
|
+
COPA_NOTES = (
|
|
12
|
+
"The rotation matrix is represented as: a,b,c,d,e,f,g,h,i. Wherein a, b, "
|
|
13
|
+
"c correspond to the first row of the matrix. The translation matrix is "
|
|
14
|
+
"represented as: x,y,z."
|
|
15
|
+
)
|
|
16
|
+
DEFAULT_HOSTNAME = "127.0.0.1"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
logger = logging.getLogger(__name__)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def init(
|
|
23
|
+
rig_name: common.RigName,
|
|
24
|
+
modification_date: typing.Optional[datetime.date] = None,
|
|
25
|
+
manipulator_infos: list[common.ManipulatorInfo] = [],
|
|
26
|
+
mon_computer_name: str = DEFAULT_HOSTNAME,
|
|
27
|
+
stim_computer_name: str = DEFAULT_HOSTNAME,
|
|
28
|
+
sync_computer_name: str = DEFAULT_HOSTNAME,
|
|
29
|
+
) -> rig.Rig:
|
|
30
|
+
"""Initializes a rig model for the dynamic routing project.
|
|
31
|
+
|
|
32
|
+
>>> rig_model = init("NP3")
|
|
33
|
+
|
|
34
|
+
Notes
|
|
35
|
+
-----
|
|
36
|
+
- rig_id is expected to be in the format:
|
|
37
|
+
<ROOM NAME>_<RIG NAME>_<MODIFICATION DATE>
|
|
38
|
+
- The DR task does not set the brightness and contrast of the monitor.
|
|
39
|
+
These are hardcoded and assumed to be static.
|
|
40
|
+
"""
|
|
41
|
+
if not modification_date:
|
|
42
|
+
modification_date = datetime.date.today()
|
|
43
|
+
|
|
44
|
+
room_name = rigs.get_rig_room(rig_name)
|
|
45
|
+
mod_date_str = modification_date.strftime(common.MODIFICATION_DATE_FORMAT)
|
|
46
|
+
rig_id = f"{rig_name}_{mod_date_str}"
|
|
47
|
+
if room_name is not None:
|
|
48
|
+
rig_id = f"{room_name}_{rig_id}"
|
|
49
|
+
|
|
50
|
+
shared_camera_props = {
|
|
51
|
+
"detector_type": "Camera",
|
|
52
|
+
"model": "G-032",
|
|
53
|
+
"sensor_width": 7400,
|
|
54
|
+
"sensor_height": 7400,
|
|
55
|
+
"size_unit": devices.SizeUnit.NM,
|
|
56
|
+
"notes": "Max frame rate is at maximum resolution.",
|
|
57
|
+
"cooling": devices.Cooling.NONE,
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
shared_camera_assembly_relative_position_props = {
|
|
61
|
+
"device_origin": (
|
|
62
|
+
"Located on the face of the lens mounting surface at its center, "
|
|
63
|
+
"ie. just ahead of the camera sensor."
|
|
64
|
+
),
|
|
65
|
+
"device_axes": [
|
|
66
|
+
coordinates.Axis(
|
|
67
|
+
name=coordinates.AxisName.X,
|
|
68
|
+
direction=(
|
|
69
|
+
"Positive is from the center of the sensor towards the "
|
|
70
|
+
"left of the assembly, from the subject's perspective."
|
|
71
|
+
),
|
|
72
|
+
),
|
|
73
|
+
coordinates.Axis(
|
|
74
|
+
name=coordinates.AxisName.Y,
|
|
75
|
+
direction=(
|
|
76
|
+
"Positive is from the center of the sensor towards the "
|
|
77
|
+
"bottom of the assembly."
|
|
78
|
+
),
|
|
79
|
+
),
|
|
80
|
+
coordinates.Axis(
|
|
81
|
+
name=coordinates.AxisName.Z,
|
|
82
|
+
direction=("Positive is from the sensor towards the subject."),
|
|
83
|
+
),
|
|
84
|
+
],
|
|
85
|
+
"notes": COPA_NOTES,
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
ephys_assemblies = []
|
|
89
|
+
for assembly_letter in ["A", "B", "C", "D", "E", "F"]:
|
|
90
|
+
serial_number = None
|
|
91
|
+
for manipulator_info in manipulator_infos:
|
|
92
|
+
if manipulator_info.assembly_name == f"Ephys Assembly {assembly_letter}":
|
|
93
|
+
serial_number = manipulator_info.serial_number
|
|
94
|
+
break
|
|
95
|
+
ephys_assemblies.append(
|
|
96
|
+
rig.EphysAssembly(
|
|
97
|
+
name=f"Ephys Assembly {assembly_letter}",
|
|
98
|
+
manipulator=devices.Manipulator(
|
|
99
|
+
name=f"Ephys Assembly {assembly_letter} Manipulator",
|
|
100
|
+
manufacturer=(organizations.Organization.NEW_SCALE_TECHNOLOGIES),
|
|
101
|
+
model="06591-M-0004",
|
|
102
|
+
serial_number=serial_number,
|
|
103
|
+
),
|
|
104
|
+
probes=[
|
|
105
|
+
devices.EphysProbe(
|
|
106
|
+
name=f"Probe{assembly_letter}",
|
|
107
|
+
probe_model="Neuropixels 1.0",
|
|
108
|
+
manufacturer=organizations.Organization.IMEC,
|
|
109
|
+
)
|
|
110
|
+
],
|
|
111
|
+
)
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
model = rig.Rig(
|
|
115
|
+
rig_id=rig_id,
|
|
116
|
+
modification_date=modification_date,
|
|
117
|
+
modalities=[
|
|
118
|
+
rig.Modality.BEHAVIOR_VIDEOS,
|
|
119
|
+
rig.Modality.BEHAVIOR,
|
|
120
|
+
rig.Modality.ECEPHYS,
|
|
121
|
+
],
|
|
122
|
+
mouse_platform=devices.Disc(
|
|
123
|
+
name="Mouse Platform",
|
|
124
|
+
radius="4.69",
|
|
125
|
+
radius_unit="centimeter",
|
|
126
|
+
notes=(
|
|
127
|
+
"Radius is the distance from the center of the wheel to the " "mouse."
|
|
128
|
+
),
|
|
129
|
+
),
|
|
130
|
+
stimulus_devices=[
|
|
131
|
+
devices.Monitor(
|
|
132
|
+
name="Stim",
|
|
133
|
+
model="PA248",
|
|
134
|
+
manufacturer=organizations.Organization.ASUS,
|
|
135
|
+
width=1920,
|
|
136
|
+
height=1200,
|
|
137
|
+
size_unit="pixel",
|
|
138
|
+
viewing_distance=15.3,
|
|
139
|
+
viewing_distance_unit="centimeter",
|
|
140
|
+
refresh_rate=60,
|
|
141
|
+
brightness=43,
|
|
142
|
+
contrast=50,
|
|
143
|
+
position=coordinates.RelativePosition(
|
|
144
|
+
device_position_transformations=[
|
|
145
|
+
coordinates.Rotation3dTransform(
|
|
146
|
+
rotation=[
|
|
147
|
+
-0.80914,
|
|
148
|
+
-0.58761,
|
|
149
|
+
0,
|
|
150
|
+
-0.12391,
|
|
151
|
+
0.17063,
|
|
152
|
+
0.97751,
|
|
153
|
+
0.08751,
|
|
154
|
+
-0.12079,
|
|
155
|
+
0.02298,
|
|
156
|
+
],
|
|
157
|
+
),
|
|
158
|
+
coordinates.Translation3dTransform(
|
|
159
|
+
translation=[0.08751, -0.12079, 0.02298]
|
|
160
|
+
),
|
|
161
|
+
],
|
|
162
|
+
device_origin=(
|
|
163
|
+
"Located at the center of the screen. Right and left "
|
|
164
|
+
"conventions are relative to the screen side of the "
|
|
165
|
+
"monitor, ie. from the subject's perspective."
|
|
166
|
+
),
|
|
167
|
+
device_axes=[
|
|
168
|
+
coordinates.Axis(
|
|
169
|
+
name=coordinates.AxisName.X,
|
|
170
|
+
direction=(
|
|
171
|
+
"Positive is from the center towards the "
|
|
172
|
+
"right of the screen, from the subject's "
|
|
173
|
+
"perspective."
|
|
174
|
+
),
|
|
175
|
+
),
|
|
176
|
+
coordinates.Axis(
|
|
177
|
+
name=coordinates.AxisName.Y,
|
|
178
|
+
direction=(
|
|
179
|
+
"Positive is from the center towards the top "
|
|
180
|
+
"of the screen."
|
|
181
|
+
),
|
|
182
|
+
),
|
|
183
|
+
coordinates.Axis(
|
|
184
|
+
name=coordinates.AxisName.Z,
|
|
185
|
+
direction=(
|
|
186
|
+
"Positive is from the front of the screen "
|
|
187
|
+
"towards the subject."
|
|
188
|
+
),
|
|
189
|
+
),
|
|
190
|
+
],
|
|
191
|
+
notes=COPA_NOTES,
|
|
192
|
+
),
|
|
193
|
+
),
|
|
194
|
+
devices.Speaker(
|
|
195
|
+
name="Speaker",
|
|
196
|
+
manufacturer=organizations.Organization.ISL,
|
|
197
|
+
model="SPK-I-81345",
|
|
198
|
+
position=coordinates.RelativePosition(
|
|
199
|
+
device_position_transformations=[
|
|
200
|
+
coordinates.Rotation3dTransform(
|
|
201
|
+
rotation=[
|
|
202
|
+
-0.82783,
|
|
203
|
+
-0.4837,
|
|
204
|
+
-0.28412,
|
|
205
|
+
-0.55894,
|
|
206
|
+
0.75426,
|
|
207
|
+
0.34449,
|
|
208
|
+
0.04767,
|
|
209
|
+
0.44399,
|
|
210
|
+
-0.89476,
|
|
211
|
+
],
|
|
212
|
+
),
|
|
213
|
+
coordinates.Translation3dTransform(
|
|
214
|
+
translation=[-0.00838, -0.09787, 0.18228]
|
|
215
|
+
),
|
|
216
|
+
],
|
|
217
|
+
device_origin=(
|
|
218
|
+
"Located on the front mounting flange face. Right "
|
|
219
|
+
"and left conventions are relative to the front side "
|
|
220
|
+
"of the speaker, ie. from the subject's perspective."
|
|
221
|
+
),
|
|
222
|
+
device_axes=[
|
|
223
|
+
coordinates.Axis(
|
|
224
|
+
name=coordinates.AxisName.X,
|
|
225
|
+
direction=(
|
|
226
|
+
"Positive is from the center of the speaker "
|
|
227
|
+
"towards the right of the speaker, from the "
|
|
228
|
+
"subject's perspective."
|
|
229
|
+
),
|
|
230
|
+
),
|
|
231
|
+
coordinates.Axis(
|
|
232
|
+
name=coordinates.AxisName.Y,
|
|
233
|
+
direction=(
|
|
234
|
+
"Positive is from the center towards the top "
|
|
235
|
+
"of the speaker."
|
|
236
|
+
),
|
|
237
|
+
),
|
|
238
|
+
coordinates.Axis(
|
|
239
|
+
name=coordinates.AxisName.Z,
|
|
240
|
+
direction=(
|
|
241
|
+
"Positive is from the speaker towards the " "subject."
|
|
242
|
+
),
|
|
243
|
+
),
|
|
244
|
+
],
|
|
245
|
+
notes=COPA_NOTES
|
|
246
|
+
+ (
|
|
247
|
+
" Speaker to be mounted with the X axis pointing to "
|
|
248
|
+
"the right when viewing the speaker along the Z axis"
|
|
249
|
+
),
|
|
250
|
+
),
|
|
251
|
+
),
|
|
252
|
+
devices.RewardDelivery(
|
|
253
|
+
reward_spouts=[
|
|
254
|
+
devices.RewardSpout(
|
|
255
|
+
name="Reward Spout",
|
|
256
|
+
manufacturer=organizations.Organization.HAMILTON,
|
|
257
|
+
model="8649-01 Custom",
|
|
258
|
+
spout_diameter=0.672,
|
|
259
|
+
spout_diameter_unit="millimeter",
|
|
260
|
+
side=devices.SpoutSide.CENTER,
|
|
261
|
+
solenoid_valve=devices.Device(
|
|
262
|
+
name="Solenoid Valve",
|
|
263
|
+
device_type="Solenoid Valve",
|
|
264
|
+
manufacturer=organizations.Organization.NRESEARCH_INC,
|
|
265
|
+
model="161K011",
|
|
266
|
+
notes="Model number is product number.",
|
|
267
|
+
),
|
|
268
|
+
lick_sensor=devices.Device(
|
|
269
|
+
name="Lick Sensor",
|
|
270
|
+
device_type="Lick Sensor",
|
|
271
|
+
manufacturer=organizations.Organization.OTHER,
|
|
272
|
+
),
|
|
273
|
+
lick_sensor_type=devices.LickSensorType.PIEZOELECTIC,
|
|
274
|
+
notes=(
|
|
275
|
+
"Spout diameter is for inner diameter. "
|
|
276
|
+
"Outer diameter is 1.575mm. "
|
|
277
|
+
),
|
|
278
|
+
),
|
|
279
|
+
]
|
|
280
|
+
),
|
|
281
|
+
],
|
|
282
|
+
ephys_assemblies=ephys_assemblies,
|
|
283
|
+
light_sources=[
|
|
284
|
+
devices.LightEmittingDiode(
|
|
285
|
+
manufacturer=organizations.Organization.OTHER,
|
|
286
|
+
name="Face forward LED",
|
|
287
|
+
model="LZ4-40R308-0000",
|
|
288
|
+
wavelength=740,
|
|
289
|
+
wavelength_unit=devices.SizeUnit.NM,
|
|
290
|
+
),
|
|
291
|
+
devices.LightEmittingDiode(
|
|
292
|
+
manufacturer=organizations.Organization.OTHER,
|
|
293
|
+
name="Body LED",
|
|
294
|
+
model="LZ4-40R308-0000",
|
|
295
|
+
wavelength=740,
|
|
296
|
+
wavelength_unit=devices.SizeUnit.NM,
|
|
297
|
+
),
|
|
298
|
+
devices.LightEmittingDiode(
|
|
299
|
+
manufacturer=organizations.Organization.AMS_OSRAM,
|
|
300
|
+
name="Eye LED",
|
|
301
|
+
model="LZ4-40R608-0000",
|
|
302
|
+
wavelength=850,
|
|
303
|
+
wavelength_unit=devices.SizeUnit.NM,
|
|
304
|
+
),
|
|
305
|
+
devices.Laser(
|
|
306
|
+
name="Laser #0",
|
|
307
|
+
manufacturer=organizations.Organization.VORTRAN,
|
|
308
|
+
wavelength=488.0,
|
|
309
|
+
model="Stradus 488-50",
|
|
310
|
+
wavelength_unit="nanometer",
|
|
311
|
+
),
|
|
312
|
+
devices.Laser(
|
|
313
|
+
name="Laser #1",
|
|
314
|
+
manufacturer=organizations.Organization.VORTRAN,
|
|
315
|
+
wavelength=633.0,
|
|
316
|
+
model="Stradus 633-80",
|
|
317
|
+
wavelength_unit="nanometer",
|
|
318
|
+
),
|
|
319
|
+
],
|
|
320
|
+
cameras=[
|
|
321
|
+
devices.CameraAssembly(
|
|
322
|
+
name="Front",
|
|
323
|
+
camera_target="Face forward",
|
|
324
|
+
camera=devices.Camera(
|
|
325
|
+
name="Front camera",
|
|
326
|
+
manufacturer=organizations.Organization.ALLIED,
|
|
327
|
+
chroma="Monochrome",
|
|
328
|
+
data_interface="Ethernet",
|
|
329
|
+
computer_name=mon_computer_name,
|
|
330
|
+
**shared_camera_props,
|
|
331
|
+
),
|
|
332
|
+
filter=devices.Filter(
|
|
333
|
+
name="Front filter",
|
|
334
|
+
manufacturer=organizations.Organization.SEMROCK,
|
|
335
|
+
model="FF01-715_LP-25",
|
|
336
|
+
filter_type=devices.FilterType.LONGPASS,
|
|
337
|
+
),
|
|
338
|
+
lens=devices.Lens(
|
|
339
|
+
name="Front lens",
|
|
340
|
+
manufacturer=organizations.Organization.EDMUND_OPTICS,
|
|
341
|
+
focal_length=8.5,
|
|
342
|
+
focal_length_unit="millimeter",
|
|
343
|
+
model="86604",
|
|
344
|
+
),
|
|
345
|
+
position=coordinates.RelativePosition(
|
|
346
|
+
device_position_transformations=[
|
|
347
|
+
coordinates.Rotation3dTransform(
|
|
348
|
+
rotation=[
|
|
349
|
+
-0.17365,
|
|
350
|
+
0.98481,
|
|
351
|
+
0,
|
|
352
|
+
0.44709,
|
|
353
|
+
0.07883,
|
|
354
|
+
-0.89101,
|
|
355
|
+
-0.87747,
|
|
356
|
+
-0.15472,
|
|
357
|
+
-0.45399,
|
|
358
|
+
]
|
|
359
|
+
),
|
|
360
|
+
coordinates.Translation3dTransform(
|
|
361
|
+
translation=[0.154, 0.03078, 0.06346],
|
|
362
|
+
),
|
|
363
|
+
],
|
|
364
|
+
**shared_camera_assembly_relative_position_props,
|
|
365
|
+
),
|
|
366
|
+
),
|
|
367
|
+
devices.CameraAssembly(
|
|
368
|
+
name="Side",
|
|
369
|
+
camera_target="Body",
|
|
370
|
+
camera=devices.Camera(
|
|
371
|
+
name="Side camera",
|
|
372
|
+
manufacturer=organizations.Organization.ALLIED,
|
|
373
|
+
chroma="Monochrome",
|
|
374
|
+
data_interface="Ethernet",
|
|
375
|
+
computer_name=mon_computer_name,
|
|
376
|
+
**shared_camera_props,
|
|
377
|
+
),
|
|
378
|
+
filter=devices.Filter(
|
|
379
|
+
name="Side filter",
|
|
380
|
+
manufacturer=organizations.Organization.SEMROCK,
|
|
381
|
+
model="FF01-747/33-25",
|
|
382
|
+
filter_type=devices.FilterType.BANDPASS,
|
|
383
|
+
),
|
|
384
|
+
lens=devices.Lens(
|
|
385
|
+
name="Side lens",
|
|
386
|
+
manufacturer=organizations.Organization.NAVITAR,
|
|
387
|
+
focal_length=6.0,
|
|
388
|
+
focal_length_unit="millimeter",
|
|
389
|
+
),
|
|
390
|
+
position=coordinates.RelativePosition(
|
|
391
|
+
device_position_transformations=[
|
|
392
|
+
coordinates.Rotation3dTransform(
|
|
393
|
+
rotation=[-1, 0, 0, 0, 0, -1, 0, -1, 0]
|
|
394
|
+
),
|
|
395
|
+
coordinates.Translation3dTransform(
|
|
396
|
+
translation=[-0.03617, 0.23887, -0.02535],
|
|
397
|
+
),
|
|
398
|
+
],
|
|
399
|
+
**shared_camera_assembly_relative_position_props,
|
|
400
|
+
),
|
|
401
|
+
),
|
|
402
|
+
devices.CameraAssembly(
|
|
403
|
+
name="Eye",
|
|
404
|
+
camera_target="Eye",
|
|
405
|
+
camera=devices.Camera(
|
|
406
|
+
name="Eye camera",
|
|
407
|
+
manufacturer=organizations.Organization.ALLIED,
|
|
408
|
+
chroma="Monochrome",
|
|
409
|
+
data_interface="Ethernet",
|
|
410
|
+
computer_name=mon_computer_name,
|
|
411
|
+
**shared_camera_props,
|
|
412
|
+
),
|
|
413
|
+
filter=devices.Filter(
|
|
414
|
+
name="Eye filter",
|
|
415
|
+
manufacturer=organizations.Organization.SEMROCK,
|
|
416
|
+
model="FF01-850/10-25",
|
|
417
|
+
filter_type=devices.FilterType.BANDPASS,
|
|
418
|
+
),
|
|
419
|
+
lens=devices.Lens(
|
|
420
|
+
name="Eye lens",
|
|
421
|
+
manufacturer=(organizations.Organization.INFINITY_PHOTO_OPTICAL),
|
|
422
|
+
focal_length=6.0,
|
|
423
|
+
focal_length_unit="millimeter",
|
|
424
|
+
model="213073",
|
|
425
|
+
notes="Model number is SKU.",
|
|
426
|
+
),
|
|
427
|
+
position=coordinates.RelativePosition(
|
|
428
|
+
device_position_transformations=[
|
|
429
|
+
coordinates.Rotation3dTransform(
|
|
430
|
+
rotation=[
|
|
431
|
+
-0.5,
|
|
432
|
+
-0.86603,
|
|
433
|
+
0,
|
|
434
|
+
-0.366,
|
|
435
|
+
0.21131,
|
|
436
|
+
-0.90631,
|
|
437
|
+
0.78489,
|
|
438
|
+
-0.45315,
|
|
439
|
+
-0.42262,
|
|
440
|
+
]
|
|
441
|
+
),
|
|
442
|
+
coordinates.Translation3dTransform(
|
|
443
|
+
translation=[-0.14259, 0.06209, 0.09576],
|
|
444
|
+
),
|
|
445
|
+
],
|
|
446
|
+
**shared_camera_assembly_relative_position_props,
|
|
447
|
+
),
|
|
448
|
+
),
|
|
449
|
+
],
|
|
450
|
+
daqs=[
|
|
451
|
+
devices.DAQDevice(
|
|
452
|
+
manufacturer=organizations.Organization.NATIONAL_INSTRUMENTS,
|
|
453
|
+
name="Sync",
|
|
454
|
+
computer_name=sync_computer_name,
|
|
455
|
+
model="NI-6612",
|
|
456
|
+
data_interface=devices.DataInterface.PCIE,
|
|
457
|
+
),
|
|
458
|
+
devices.DAQDevice(
|
|
459
|
+
manufacturer=organizations.Organization.NATIONAL_INSTRUMENTS,
|
|
460
|
+
name="Behavior",
|
|
461
|
+
computer_name=stim_computer_name,
|
|
462
|
+
model="NI-6323",
|
|
463
|
+
data_interface=devices.DataInterface.USB,
|
|
464
|
+
),
|
|
465
|
+
devices.DAQDevice(
|
|
466
|
+
manufacturer=organizations.Organization.NATIONAL_INSTRUMENTS,
|
|
467
|
+
name="BehaviorSync",
|
|
468
|
+
computer_name=stim_computer_name,
|
|
469
|
+
model="NI-6001",
|
|
470
|
+
data_interface=devices.DataInterface.PCIE,
|
|
471
|
+
),
|
|
472
|
+
devices.DAQDevice(
|
|
473
|
+
manufacturer=organizations.Organization.NATIONAL_INSTRUMENTS,
|
|
474
|
+
name="Opto",
|
|
475
|
+
computer_name=stim_computer_name,
|
|
476
|
+
model="NI-9264",
|
|
477
|
+
data_interface=devices.DataInterface.ETH,
|
|
478
|
+
),
|
|
479
|
+
],
|
|
480
|
+
detectors=[
|
|
481
|
+
devices.Detector(
|
|
482
|
+
name="vsync photodiode",
|
|
483
|
+
model="PDA25K",
|
|
484
|
+
manufacturer=organizations.Organization.THORLABS,
|
|
485
|
+
data_interface=devices.DataInterface.OTHER,
|
|
486
|
+
notes="Data interface is unknown.",
|
|
487
|
+
detector_type=devices.DetectorType.OTHER,
|
|
488
|
+
cooling=devices.Cooling.AIR,
|
|
489
|
+
),
|
|
490
|
+
],
|
|
491
|
+
calibrations=[],
|
|
492
|
+
additional_devices=[
|
|
493
|
+
devices.Detector(
|
|
494
|
+
name="microphone",
|
|
495
|
+
manufacturer=organizations.Organization.DODOTRONIC,
|
|
496
|
+
model="MOM",
|
|
497
|
+
data_interface=devices.DataInterface.OTHER,
|
|
498
|
+
notes="Data interface is unknown.",
|
|
499
|
+
detector_type=devices.DetectorType.OTHER,
|
|
500
|
+
cooling=devices.Cooling.AIR,
|
|
501
|
+
),
|
|
502
|
+
devices.AdditionalImagingDevice(
|
|
503
|
+
name="Galvo x",
|
|
504
|
+
imaging_device_type=devices.ImagingDeviceType.GALVO,
|
|
505
|
+
),
|
|
506
|
+
devices.AdditionalImagingDevice(
|
|
507
|
+
name="Galvo y",
|
|
508
|
+
imaging_device_type=devices.ImagingDeviceType.GALVO,
|
|
509
|
+
),
|
|
510
|
+
],
|
|
511
|
+
rig_axes=[
|
|
512
|
+
coordinates.Axis(
|
|
513
|
+
name=coordinates.AxisName.X,
|
|
514
|
+
direction=(
|
|
515
|
+
"The world horizontal. Lays on the Mouse Sagittal Plane. "
|
|
516
|
+
"Positive direction is towards the nose of the mouse. "
|
|
517
|
+
),
|
|
518
|
+
),
|
|
519
|
+
coordinates.Axis(
|
|
520
|
+
name=coordinates.AxisName.Y,
|
|
521
|
+
direction=(
|
|
522
|
+
"Perpendicular to Y. Positive direction is "
|
|
523
|
+
"away from the nose of the mouse. "
|
|
524
|
+
),
|
|
525
|
+
),
|
|
526
|
+
coordinates.Axis(
|
|
527
|
+
name=coordinates.AxisName.Z,
|
|
528
|
+
direction="Positive pointing up.",
|
|
529
|
+
),
|
|
530
|
+
],
|
|
531
|
+
origin=coordinates.Origin.BREGMA,
|
|
532
|
+
patch_cords=[
|
|
533
|
+
devices.Patch(
|
|
534
|
+
name="Patch Cord #1",
|
|
535
|
+
manufacturer=organizations.Organization.THORLABS,
|
|
536
|
+
model="SM450 Custom Length, FC/PC Ends",
|
|
537
|
+
core_diameter=125.0,
|
|
538
|
+
numerical_aperture=0.10,
|
|
539
|
+
notes=("Numerical aperture is approximately between 0.10 and " "0.14."),
|
|
540
|
+
),
|
|
541
|
+
],
|
|
542
|
+
)
|
|
543
|
+
|
|
544
|
+
return rig.Rig.model_validate(model)
|