Skip to content

Commit c576ba9

Browse files
committed
examples: draft instrument
1 parent f0154a2 commit c576ba9

1 file changed

Lines changed: 273 additions & 0 deletions

File tree

examples/isi_instrument.py

Lines changed: 273 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,273 @@
1+
"""Generates an example JSON file for an ISI (Intrinsic Signal Imaging) instrument
2+
3+
Based on the ISI Full Rig BOM (AIBS part 0113_000-00, Rev A).
4+
The rig consists of:
5+
- ISI Table Assembly (0113_100-00)
6+
- ISI System Structure (0113_200-00)
7+
- Camera, Stage, and Mount Assembly (0113_300-00)
8+
- Headframe Clamp Assembly (0113_400-00)
9+
- ISI Eye Tracking Assembly (0123_500-00)
10+
- Camera/Lens Assembly (0113_550-00) with tandem Nikon lenses and Andor Zyla sCMOS
11+
- LED Light Ring Assembly (0113_530-00)
12+
"""
13+
14+
import argparse
15+
from datetime import date
16+
17+
from aind_data_schema_models.coordinates import AnatomicalRelative
18+
from aind_data_schema_models.devices import (
19+
CameraChroma,
20+
CameraTarget,
21+
DataInterface,
22+
DetectorType,
23+
FilterType,
24+
)
25+
from aind_data_schema_models.modalities import Modality
26+
from aind_data_schema_models.organizations import Organization
27+
from aind_data_schema_models.units import FrequencyUnit, SizeUnit
28+
29+
from aind_data_schema.components.coordinates import CoordinateSystemLibrary
30+
from aind_data_schema.components.devices import (
31+
Camera,
32+
CameraAssembly,
33+
Computer,
34+
DAQDevice,
35+
Device,
36+
Filter,
37+
Lens,
38+
LightEmittingDiode,
39+
Monitor,
40+
MotorizedStage,
41+
)
42+
from aind_data_schema.core.instrument import Instrument
43+
44+
acquisition_computer = Computer(
45+
name="Acquisition Computer",
46+
notes="3U custom rackmount, Intel Xeon E5-1620v3 3.5GHz, Nvidia GT 730 2GB, Advantech PCIE-1672PC frame grabber, 240GB SSD + 2x1TB HDD. Pogo Linux quote 90846.",
47+
)
48+
49+
stim_computer = Computer(
50+
name="Stim Computer",
51+
notes="Intel Xeon E5-1620v3 3.5GHz, 16GB DDR4 ECC, Western Digital RE4 500GB. Pogo Linux quote 90854.",
52+
)
53+
54+
ni_daq = DAQDevice(
55+
name="NI USB-6008",
56+
manufacturer=Organization.NATIONAL_INSTRUMENTS,
57+
model="USB-6008",
58+
data_interface=DataInterface.USB,
59+
)
60+
61+
newport_linear_stage = MotorizedStage(
62+
name="Newport M-ILS100PP Linear Stage",
63+
manufacturer=Organization.MKS_NEWPORT,
64+
model="M-ILS100PP",
65+
travel=100,
66+
travel_unit=SizeUnit.MM,
67+
notes="High performance linear stage, 100 mm travel, stepper motor, metric. Controlled by Newport SMC100PP.",
68+
)
69+
70+
newport_motor_controller = Device(
71+
name="Newport SMC100PP Motor Controller",
72+
manufacturer=Organization.MKS_NEWPORT,
73+
model="SMC100PP",
74+
notes="Single-axis stepper motor controller/driver for Newport M-ILS100PP stage. USB interface.",
75+
)
76+
77+
isi_camera = Camera(
78+
name="Andor Zyla 5.5 sCMOS",
79+
manufacturer=Organization.OTHER,
80+
model="Zyla 5.5 sCMOS",
81+
detector_type=DetectorType.CAMERA,
82+
data_interface=DataInterface.USB,
83+
chroma=CameraChroma.BW,
84+
notes="Andor Technology Zyla 5.5 sCMOS scientific camera used for intrinsic signal imaging. "
85+
"Vendor part: Zyla 5.5 sCMOS. Manufacturer is Andor (Oxford Instruments).",
86+
)
87+
88+
isi_lens_35mm = Lens(
89+
name="Nikon NIKKOR 35mm f/1.4",
90+
manufacturer=Organization.NIKON,
91+
model="NIKKOR 35mm f/1.4",
92+
notes="Front lens of tandem-lens assembly for ISI. B&H part NI3514.",
93+
)
94+
95+
isi_lens_105mm = Lens(
96+
name="Nikon Micro-NIKKOR 105mm f/2.8",
97+
manufacturer=Organization.NIKON,
98+
model="Micro-NIKKOR 105mm f/2.8",
99+
notes="Rear lens of tandem-lens assembly for ISI, facing the camera. B&H part NI10528M.",
100+
)
101+
102+
isi_bandpass_filter = Filter(
103+
name="Semrock FF01-630/92-50 Bandpass Filter",
104+
manufacturer=Organization.SEMROCK,
105+
model="FF01-630/92-50",
106+
filter_type=FilterType.BANDPASS,
107+
center_wavelength=630,
108+
wavelength_unit=SizeUnit.NM,
109+
notes="630/92 nm BrightLine single-band bandpass filter, 50 mm diameter, housed and mounted.",
110+
)
111+
112+
isi_camera_assembly = CameraAssembly(
113+
name="ISI Brain Camera Assembly",
114+
target=CameraTarget.BRAIN,
115+
relative_position=[AnatomicalRelative.SUPERIOR],
116+
camera=isi_camera,
117+
lens=isi_lens_35mm,
118+
filter=isi_bandpass_filter,
119+
)
120+
121+
eye_tracking_camera = Camera(
122+
name="Allied Vision MAKO G-125C",
123+
manufacturer=Organization.ALLIED,
124+
model="MAKO G-125C",
125+
detector_type=DetectorType.CAMERA,
126+
data_interface=DataInterface.ETH,
127+
chroma=CameraChroma.BW,
128+
notes="Allied Vision Technologies GigE camera, PoE, 1.2 MP, 30 fps. Used for eye tracking. "
129+
"1st Vision part AVT-GK-125C.",
130+
)
131+
132+
eye_tracking_lens = Lens(
133+
name="InfiniStix 130mm W.D. 0.73x",
134+
manufacturer=Organization.INFINITY_PHOTO_OPTICAL,
135+
model="InfiniStix Proximity Series 130mm W.D./0.73x",
136+
notes="Infinity Photo-Optical InfiniStix proximity series lens for eye tracking camera.",
137+
)
138+
139+
eye_tracking_camera_assembly = CameraAssembly(
140+
name="Eye Tracking Camera Assembly",
141+
target=CameraTarget.EYE,
142+
relative_position=[AnatomicalRelative.ANTERIOR],
143+
camera=eye_tracking_camera,
144+
lens=eye_tracking_lens,
145+
)
146+
147+
eye_tracking_dichroic = Filter(
148+
name="Semrock FF750-SDi02-25x36 Dichroic",
149+
manufacturer=Organization.SEMROCK,
150+
model="FF750-SDi02-25x36",
151+
filter_type=FilterType.DICHROIC,
152+
cut_off_wavelength=750,
153+
wavelength_unit=SizeUnit.NM,
154+
notes="Dichroic beamsplitter used in eye tracking light path to separate 850 nm IR illumination.",
155+
)
156+
157+
eye_tracking_ir_led = LightEmittingDiode(
158+
name="Eye Tracking IR LED 850nm",
159+
manufacturer=Organization.OTHER,
160+
model="LZ4-40R608-0000",
161+
wavelength=850,
162+
wavelength_unit=SizeUnit.NM,
163+
notes="LED Engin Inc. (now ams OSRAM) LZ4-40R608-0000 infrared LED for eye tracking illumination. "
164+
"Digikey part 1537-1045-ND.",
165+
)
166+
167+
eye_tracking_collimating_lens = Lens(
168+
name="Thorlabs LB1092-B-ML Bi-Convex Lens",
169+
manufacturer=Organization.THORLABS,
170+
model="LB1092-B-ML",
171+
notes="Mounted N-BK7 bi-convex lens, 1/2 inch diameter, f=15.0 mm, ARC 650-1050 nm. "
172+
"Used in eye tracking IR illumination path.",
173+
)
174+
175+
led_ring_green = LightEmittingDiode(
176+
name="LED Ring Green 527nm",
177+
manufacturer=Organization.OTHER,
178+
model="C503B-GCN-CY0C0791",
179+
wavelength=527,
180+
wavelength_unit=SizeUnit.NM,
181+
notes="Cree Inc. 5mm green clear LED, 527 nm, 30 deg. 19 units in LED light ring assembly (0113_530-00). "
182+
"Digikey part C503B-GCN-CY0C0791-ND.",
183+
)
184+
185+
led_ring_red = LightEmittingDiode(
186+
name="LED Ring Red 635nm",
187+
manufacturer=Organization.OTHER,
188+
model="HLMP-EG08-Y2000",
189+
wavelength=635,
190+
wavelength_unit=SizeUnit.NM,
191+
notes="Avago Technologies 5mm red clear LED, 635 nm. 9 units in LED light ring assembly (0113_530-00). "
192+
"Digikey part 516-1377-ND.",
193+
)
194+
195+
stimulus_monitor = Monitor(
196+
name="ASUS PA248Q Stimulus Monitor",
197+
manufacturer=Organization.ASUS,
198+
model="PA248Q",
199+
refresh_rate=60,
200+
width=1920,
201+
height=1200,
202+
size_unit=SizeUnit.PX,
203+
viewing_distance=15,
204+
viewing_distance_unit=SizeUnit.CM,
205+
relative_position=[AnatomicalRelative.ANTERIOR],
206+
notes="24-inch widescreen LED-backlit LCD monitor used for visual stimulation. "
207+
"2 units per rig. Viewing distance must be set at time of use.",
208+
)
209+
210+
temperature_controller = Device(
211+
name="WPI ATC2000 Animal Temperature Controller",
212+
manufacturer=Organization.OTHER,
213+
model="ATC2000",
214+
notes="World Precision Instruments ATC2000 animal temperature controller. "
215+
"Regulates heating plate temperature during imaging.",
216+
)
217+
218+
somnosuite = Device(
219+
name="Kent Scientific SomnoSuite",
220+
manufacturer=Organization.OTHER,
221+
model="SOMNO",
222+
notes="Kent Scientific SomnoSuite low-flow digital vaporizer for isoflurane anesthesia delivery. "
223+
"Used with low profile facemasks (SOMNO-0801) and induction chamber (SOMNO-0705).",
224+
)
225+
226+
physiosuite = Device(
227+
name="Kent Scientific PhysioSuite",
228+
manufacturer=Organization.OTHER,
229+
model="PS-MSTAT-RT",
230+
notes="Kent Scientific PhysioSuite with MouseSTAT pulse oximeter and heart rate monitor. "
231+
"Includes RightTemp module for temperature monitoring.",
232+
)
233+
234+
inst = Instrument(
235+
location="ISI Full Rig",
236+
instrument_id="ISI1",
237+
modification_date=date(2016, 7, 18),
238+
modalities=[Modality.ISI],
239+
coordinate_system=CoordinateSystemLibrary.BREGMA_ARI,
240+
temperature_control=True,
241+
notes="AIBS Intrinsic Signal Imaging full rig (0113_000-00, Rev A). "
242+
"Tandem-lens ISI camera assembly uses Nikon 35mm f/1.4 (front) face-to-face with Nikon 105mm f/2.8 (rear). "
243+
"Eye tracking arm (0123_500-00) uses 850 nm IR illumination with dichroic beamsplitter. "
244+
"LED light ring contains 19x green (527 nm) and 9x red (635 nm) LEDs for cortical illumination.",
245+
components=[
246+
acquisition_computer,
247+
stim_computer,
248+
ni_daq,
249+
newport_linear_stage,
250+
newport_motor_controller,
251+
isi_camera_assembly,
252+
isi_lens_105mm,
253+
eye_tracking_camera_assembly,
254+
eye_tracking_dichroic,
255+
eye_tracking_ir_led,
256+
eye_tracking_collimating_lens,
257+
led_ring_green,
258+
led_ring_red,
259+
stimulus_monitor,
260+
temperature_controller,
261+
somnosuite,
262+
physiosuite,
263+
],
264+
)
265+
266+
if __name__ == "__main__":
267+
parser = argparse.ArgumentParser()
268+
parser.add_argument("--output-dir", default=None, help="Output directory for generated JSON file")
269+
args = parser.parse_args()
270+
271+
serialized = inst.model_dump_json()
272+
deserialized = Instrument.model_validate_json(serialized)
273+
deserialized.write_standard_file(prefix="isi", output_directory=args.output_dir)

0 commit comments

Comments
 (0)