Skip to content

Commit f539a04

Browse files
fip mapper for new standard (#376)
* Add FIP (Fiber Photometry) mapper - Implements FIPMapper class for transforming intermediate FIP metadata to Acquisition schema - Follows SmartSPIM mapper pattern: extract → transform → save - Maps FIP hardware configs (LEDs, cameras, patch cords, fibers) to schema objects - Zero-indexed naming: ROI N → Patch Cord N → Fiber N (implanted) - Includes comprehensive TODO documentation for future enhancements - Adds unit tests with 100% passing coverage - Includes working example script and sample acquisition.json output Key features: - Transforms session metadata (times, experimenter, subject, rig) - Builds Channel objects with detectors and emission wavelengths - Creates PatchCordConfig for each ROI/fiber pair - Includes implanted fiber identifiers in active devices - Handles timezone-aware timestamps - Validates against aind-data-schema v2.0+
1 parent 4915721 commit f539a04

14 files changed

Lines changed: 2800 additions & 18 deletions
Lines changed: 290 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,290 @@
1+
{
2+
"object_type": "Acquisition",
3+
"describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/acquisition.py",
4+
"schema_version": "2.2.0",
5+
"subject_id": "804434",
6+
"specimen_id": null,
7+
"acquisition_start_time": "2025-11-05T01:40:24.283379Z",
8+
"acquisition_end_time": "2025-11-05T01:50:37.774668Z",
9+
"experimenters": [
10+
"jason.lee"
11+
],
12+
"protocol_id": [
13+
"https://www.protocols.io/view/modified-frame-projected-independent-fiber-photome-kxygx3e6wg8j/v1",
14+
"https://www.protocols.io/view/modified-frame-projected-independent-fiber-photome-261ge39edl47/v2"
15+
],
16+
"ethics_review_id": [
17+
"2414"
18+
],
19+
"instrument_id": "13A",
20+
"acquisition_type": "AindVrForaging",
21+
"notes": "",
22+
"coordinate_system": null,
23+
"calibrations": [],
24+
"maintenance": [],
25+
"data_streams": [
26+
{
27+
"object_type": "Data stream",
28+
"stream_start_time": "2025-11-05T01:40:24.283379Z",
29+
"stream_end_time": "2025-11-05T01:50:37.774668Z",
30+
"modalities": [
31+
{
32+
"name": "Fiber photometry",
33+
"abbreviation": "fib"
34+
}
35+
],
36+
"code": [
37+
{
38+
"object_type": "Code",
39+
"url": "https://github.com/AllenNeuralDynamics/Aind.Experiment.VrForaging-Fip",
40+
"name": null,
41+
"version": "6dc3fd137fa3c97e4e9cbeeaa304ab34736fe3fe",
42+
"container": null,
43+
"run_script": null,
44+
"language": null,
45+
"language_version": null,
46+
"input_data": null,
47+
"parameters": null,
48+
"core_dependency": null
49+
}
50+
],
51+
"notes": null,
52+
"active_devices": [
53+
"415nm LED",
54+
"470nm LED",
55+
"560nm LED",
56+
"Green CMOS",
57+
"Red CMOS",
58+
"Patch Cord 0",
59+
"Fiber 0",
60+
"Patch Cord 1",
61+
"Fiber 1",
62+
"cuTTLefishFip"
63+
],
64+
"configurations": [
65+
{
66+
"object_type": "Light emitting diode config",
67+
"device_name": "415nm LED",
68+
"power": 20.0,
69+
"power_unit": "percent",
70+
"power_measured_at": null
71+
},
72+
{
73+
"object_type": "Light emitting diode config",
74+
"device_name": "470nm LED",
75+
"power": 20.0,
76+
"power_unit": "percent",
77+
"power_measured_at": null
78+
},
79+
{
80+
"object_type": "Light emitting diode config",
81+
"device_name": "560nm LED",
82+
"power": 20.0,
83+
"power_unit": "percent",
84+
"power_measured_at": null
85+
},
86+
{
87+
"object_type": "Patch cord config",
88+
"device_name": "Patch Cord 0",
89+
"channels": [
90+
{
91+
"object_type": "Channel",
92+
"channel_name": "Fiber_0_Green",
93+
"intended_measurement": "calcium",
94+
"detector": {
95+
"object_type": "Detector config",
96+
"device_name": "Green CMOS",
97+
"exposure_time": 15.65,
98+
"exposure_time_unit": "millisecond",
99+
"trigger_type": "Internal",
100+
"compression": null
101+
},
102+
"additional_device_names": null,
103+
"light_sources": [
104+
{
105+
"object_type": "Light emitting diode config",
106+
"device_name": "470nm LED",
107+
"power": 20.0,
108+
"power_unit": "percent",
109+
"power_measured_at": null
110+
}
111+
],
112+
"variable_power": false,
113+
"excitation_filters": [],
114+
"emission_filters": [],
115+
"emission_wavelength": 520,
116+
"emission_wavelength_unit": "nanometer"
117+
},
118+
{
119+
"object_type": "Channel",
120+
"channel_name": "Fiber_0_Isosbestic",
121+
"intended_measurement": null,
122+
"detector": {
123+
"object_type": "Detector config",
124+
"device_name": "Green CMOS",
125+
"exposure_time": 15.65,
126+
"exposure_time_unit": "millisecond",
127+
"trigger_type": "Internal",
128+
"compression": null
129+
},
130+
"additional_device_names": null,
131+
"light_sources": [
132+
{
133+
"object_type": "Light emitting diode config",
134+
"device_name": "415nm LED",
135+
"power": 20.0,
136+
"power_unit": "percent",
137+
"power_measured_at": null
138+
}
139+
],
140+
"variable_power": false,
141+
"excitation_filters": [],
142+
"emission_filters": [],
143+
"emission_wavelength": 520,
144+
"emission_wavelength_unit": "nanometer"
145+
},
146+
{
147+
"object_type": "Channel",
148+
"channel_name": "Fiber_0_Red",
149+
"intended_measurement": "serotonin",
150+
"detector": {
151+
"object_type": "Detector config",
152+
"device_name": "Red CMOS",
153+
"exposure_time": 15.65,
154+
"exposure_time_unit": "millisecond",
155+
"trigger_type": "Internal",
156+
"compression": null
157+
},
158+
"additional_device_names": null,
159+
"light_sources": [
160+
{
161+
"object_type": "Light emitting diode config",
162+
"device_name": "560nm LED",
163+
"power": 20.0,
164+
"power_unit": "percent",
165+
"power_measured_at": null
166+
}
167+
],
168+
"variable_power": false,
169+
"excitation_filters": [],
170+
"emission_filters": [],
171+
"emission_wavelength": 590,
172+
"emission_wavelength_unit": "nanometer"
173+
}
174+
]
175+
},
176+
{
177+
"object_type": "Patch cord config",
178+
"device_name": "Patch Cord 1",
179+
"channels": [
180+
{
181+
"object_type": "Channel",
182+
"channel_name": "Fiber_1_Green",
183+
"intended_measurement": "calcium",
184+
"detector": {
185+
"object_type": "Detector config",
186+
"device_name": "Green CMOS",
187+
"exposure_time": 15.65,
188+
"exposure_time_unit": "millisecond",
189+
"trigger_type": "Internal",
190+
"compression": null
191+
},
192+
"additional_device_names": null,
193+
"light_sources": [
194+
{
195+
"object_type": "Light emitting diode config",
196+
"device_name": "470nm LED",
197+
"power": 20.0,
198+
"power_unit": "percent",
199+
"power_measured_at": null
200+
}
201+
],
202+
"variable_power": false,
203+
"excitation_filters": [],
204+
"emission_filters": [],
205+
"emission_wavelength": 520,
206+
"emission_wavelength_unit": "nanometer"
207+
},
208+
{
209+
"object_type": "Channel",
210+
"channel_name": "Fiber_1_Isosbestic",
211+
"intended_measurement": null,
212+
"detector": {
213+
"object_type": "Detector config",
214+
"device_name": "Green CMOS",
215+
"exposure_time": 15.65,
216+
"exposure_time_unit": "millisecond",
217+
"trigger_type": "Internal",
218+
"compression": null
219+
},
220+
"additional_device_names": null,
221+
"light_sources": [
222+
{
223+
"object_type": "Light emitting diode config",
224+
"device_name": "415nm LED",
225+
"power": 20.0,
226+
"power_unit": "percent",
227+
"power_measured_at": null
228+
}
229+
],
230+
"variable_power": false,
231+
"excitation_filters": [],
232+
"emission_filters": [],
233+
"emission_wavelength": 520,
234+
"emission_wavelength_unit": "nanometer"
235+
},
236+
{
237+
"object_type": "Channel",
238+
"channel_name": "Fiber_1_Red",
239+
"intended_measurement": "serotonin",
240+
"detector": {
241+
"object_type": "Detector config",
242+
"device_name": "Red CMOS",
243+
"exposure_time": 15.65,
244+
"exposure_time_unit": "millisecond",
245+
"trigger_type": "Internal",
246+
"compression": null
247+
},
248+
"additional_device_names": null,
249+
"light_sources": [
250+
{
251+
"object_type": "Light emitting diode config",
252+
"device_name": "560nm LED",
253+
"power": 20.0,
254+
"power_unit": "percent",
255+
"power_measured_at": null
256+
}
257+
],
258+
"variable_power": false,
259+
"excitation_filters": [],
260+
"emission_filters": [],
261+
"emission_wavelength": 590,
262+
"emission_wavelength_unit": "nanometer"
263+
}
264+
]
265+
}
266+
],
267+
"connections": [
268+
{
269+
"object_type": "Connection",
270+
"source_device": "Patch Cord 0",
271+
"source_port": null,
272+
"target_device": "Fiber 0",
273+
"target_port": null,
274+
"send_and_receive": false
275+
},
276+
{
277+
"object_type": "Connection",
278+
"source_device": "Patch Cord 1",
279+
"source_port": null,
280+
"target_device": "Fiber 1",
281+
"target_port": null,
282+
"send_and_receive": false
283+
}
284+
]
285+
}
286+
],
287+
"stimulus_epochs": [],
288+
"manipulations": [],
289+
"subject_details": null
290+
}

0 commit comments

Comments
 (0)