|
| 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 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 | +) |
| 47 | + |
| 48 | +stim_computer = Computer( |
| 49 | + name="Stim Computer", |
| 50 | +) |
| 51 | + |
| 52 | +ni_daq = DAQDevice( |
| 53 | + name="DAQ", |
| 54 | + manufacturer=Organization.NATIONAL_INSTRUMENTS, |
| 55 | + model="USB-6008", |
| 56 | + data_interface=DataInterface.USB, |
| 57 | +) |
| 58 | + |
| 59 | +newport_linear_stage = MotorizedStage( |
| 60 | + name="Linear Stage", |
| 61 | + manufacturer=Organization.MKS_NEWPORT, |
| 62 | + model="M-ILS100PP", |
| 63 | + travel=100, |
| 64 | + travel_unit=SizeUnit.MM, |
| 65 | + notes="Controlled by Newport SMC100PP.", |
| 66 | +) |
| 67 | + |
| 68 | +newport_motor_controller = Device( |
| 69 | + name="Motor Controller", |
| 70 | + manufacturer=Organization.MKS_NEWPORT, |
| 71 | + model="SMC100PP", |
| 72 | +) |
| 73 | + |
| 74 | +isi_camera = Camera( |
| 75 | + name="ISI Camera", |
| 76 | + manufacturer=Organization.OXFORD_INSTRUMENTS, |
| 77 | + model="Zyla 5.5 sCMOS", |
| 78 | + detector_type=DetectorType.CAMERA, |
| 79 | + data_interface=DataInterface.USB, |
| 80 | + chroma=CameraChroma.BW, |
| 81 | +) |
| 82 | + |
| 83 | +isi_lens_35mm = Lens( |
| 84 | + name="Front Lens", |
| 85 | + manufacturer=Organization.NIKON, |
| 86 | + model="NIKKOR 35mm f/1.4", |
| 87 | + notes="Front lens of tandem-lens assembly.", |
| 88 | +) |
| 89 | + |
| 90 | +isi_lens_105mm = Lens( |
| 91 | + name="Rear Lens", |
| 92 | + manufacturer=Organization.NIKON, |
| 93 | + model="Micro-NIKKOR 105mm f/2.8", |
| 94 | + notes="Rear lens of tandem-lens assembly, facing the camera.", |
| 95 | +) |
| 96 | + |
| 97 | +isi_bandpass_filter = Filter( |
| 98 | + name="Bandpass Filter", |
| 99 | + manufacturer=Organization.SEMROCK, |
| 100 | + model="FF01-630/92-50", |
| 101 | + filter_type=FilterType.BANDPASS, |
| 102 | + center_wavelength=630, |
| 103 | + wavelength_unit=SizeUnit.NM, |
| 104 | +) |
| 105 | + |
| 106 | +isi_camera_assembly = CameraAssembly( |
| 107 | + name="ISI Brain Camera Assembly", |
| 108 | + target=CameraTarget.BRAIN, |
| 109 | + relative_position=[AnatomicalRelative.SUPERIOR], |
| 110 | + camera=isi_camera, |
| 111 | + lens=isi_lens_35mm, |
| 112 | + filter=isi_bandpass_filter, |
| 113 | +) |
| 114 | + |
| 115 | +eye_tracking_camera = Camera( |
| 116 | + name="Eye Tracking Camera", |
| 117 | + manufacturer=Organization.ALLIED, |
| 118 | + model="MAKO G-125C", |
| 119 | + detector_type=DetectorType.CAMERA, |
| 120 | + data_interface=DataInterface.ETH, |
| 121 | + chroma=CameraChroma.BW, |
| 122 | +) |
| 123 | + |
| 124 | +eye_tracking_lens = Lens( |
| 125 | + name="Eye Tracking Lens", |
| 126 | + manufacturer=Organization.INFINITY_PHOTO_OPTICAL, |
| 127 | + model="Proximity Series 130mm W.D./0.73x", |
| 128 | +) |
| 129 | + |
| 130 | +eye_tracking_camera_assembly = CameraAssembly( |
| 131 | + name="Eye Tracking Camera Assembly", |
| 132 | + target=CameraTarget.EYE, |
| 133 | + relative_position=[AnatomicalRelative.ANTERIOR], |
| 134 | + camera=eye_tracking_camera, |
| 135 | + lens=eye_tracking_lens, |
| 136 | +) |
| 137 | + |
| 138 | +eye_tracking_dichroic = Filter( |
| 139 | + name="Dichroic Filter", |
| 140 | + manufacturer=Organization.SEMROCK, |
| 141 | + model="FF750-SDi02-25x36", |
| 142 | + filter_type=FilterType.DICHROIC, |
| 143 | + cut_off_wavelength=750, |
| 144 | + wavelength_unit=SizeUnit.NM, |
| 145 | + notes="Separates 850 nm IR illumination for eye tracking.", |
| 146 | +) |
| 147 | + |
| 148 | +eye_tracking_ir_led = LightEmittingDiode( |
| 149 | + name="Eye Tracking IR LED", |
| 150 | + manufacturer=Organization.AMS_OSRAM, |
| 151 | + model="LZ4-40R608-0000", |
| 152 | + wavelength=850, |
| 153 | + wavelength_unit=SizeUnit.NM, |
| 154 | +) |
| 155 | + |
| 156 | +eye_tracking_collimating_lens = Lens( |
| 157 | + name="Collimating Lens", |
| 158 | + manufacturer=Organization.THORLABS, |
| 159 | + model="LB1092-B-ML", |
| 160 | +) |
| 161 | + |
| 162 | +led_ring_green = LightEmittingDiode( |
| 163 | + name="LED Ring Green", |
| 164 | + manufacturer=Organization.OTHER, |
| 165 | + model="C503B-GCN-CY0C0791", |
| 166 | + wavelength=527, |
| 167 | + wavelength_unit=SizeUnit.NM, |
| 168 | + notes="19 units in LED light ring assembly (0113_530-00).", |
| 169 | +) |
| 170 | + |
| 171 | +led_ring_red = LightEmittingDiode( |
| 172 | + name="LED Ring Red", |
| 173 | + manufacturer=Organization.OTHER, |
| 174 | + model="HLMP-EG08-Y2000", |
| 175 | + wavelength=635, |
| 176 | + wavelength_unit=SizeUnit.NM, |
| 177 | + notes="9 units in LED light ring assembly (0113_530-00).", |
| 178 | +) |
| 179 | + |
| 180 | +stimulus_monitor = Monitor( |
| 181 | + name="Stimulus Monitor", |
| 182 | + manufacturer=Organization.ASUS, |
| 183 | + model="PA248Q", |
| 184 | + refresh_rate=60, |
| 185 | + width=1920, |
| 186 | + height=1200, |
| 187 | + size_unit=SizeUnit.PX, |
| 188 | + viewing_distance=15, |
| 189 | + viewing_distance_unit=SizeUnit.CM, |
| 190 | + relative_position=[AnatomicalRelative.ANTERIOR], |
| 191 | +) |
| 192 | + |
| 193 | +temperature_controller = Device( |
| 194 | + name="Temperature Controller", |
| 195 | + manufacturer=Organization.WPI, |
| 196 | + model="ATC2000", |
| 197 | +) |
| 198 | + |
| 199 | +somnosuite = Device( |
| 200 | + name="SomnoSuite", |
| 201 | + manufacturer=Organization.KENT_SCIENTIFIC_CORPORATION, |
| 202 | + model="SOMNO", |
| 203 | + notes="Used with accessory facemasks (SOMNO-0801) and induction chamber (SOMNO-0705).", |
| 204 | +) |
| 205 | + |
| 206 | +physiosuite = Device( |
| 207 | + name="PhysioSuite", |
| 208 | + manufacturer=Organization.KENT_SCIENTIFIC_CORPORATION, |
| 209 | + model="PS-MSTAT-RT", |
| 210 | +) |
| 211 | + |
| 212 | +inst = Instrument( |
| 213 | + location="", |
| 214 | + instrument_id="ISIV.1", |
| 215 | + modification_date=date(2026, 5, 15), |
| 216 | + modalities=[Modality.ISI], |
| 217 | + coordinate_system=CoordinateSystemLibrary.BREGMA_ARI, |
| 218 | + temperature_control=True, |
| 219 | + notes="", |
| 220 | + components=[ |
| 221 | + acquisition_computer, |
| 222 | + stim_computer, |
| 223 | + ni_daq, |
| 224 | + newport_linear_stage, |
| 225 | + newport_motor_controller, |
| 226 | + isi_camera_assembly, |
| 227 | + isi_lens_105mm, |
| 228 | + eye_tracking_camera_assembly, |
| 229 | + eye_tracking_dichroic, |
| 230 | + eye_tracking_ir_led, |
| 231 | + eye_tracking_collimating_lens, |
| 232 | + led_ring_green, |
| 233 | + led_ring_red, |
| 234 | + stimulus_monitor, |
| 235 | + temperature_controller, |
| 236 | + somnosuite, |
| 237 | + physiosuite, |
| 238 | + ], |
| 239 | +) |
| 240 | + |
| 241 | +if __name__ == "__main__": |
| 242 | + parser = argparse.ArgumentParser() |
| 243 | + parser.add_argument("--output-dir", default=None, help="Output directory for generated JSON file") |
| 244 | + args = parser.parse_args() |
| 245 | + |
| 246 | + serialized = inst.model_dump_json() |
| 247 | + deserialized = Instrument.model_validate_json(serialized) |
| 248 | + deserialized.write_standard_file(prefix="isi", output_directory=args.output_dir) |
0 commit comments