diff --git a/examples/multiplane_ophys_rig.json b/examples/multiplane_ophys_rig.json new file mode 100644 index 00000000..6728bf25 --- /dev/null +++ b/examples/multiplane_ophys_rig.json @@ -0,0 +1,657 @@ +{ + "describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/rig.py", + "schema_version": "0.3.3", + "rig_id": "MESO.2", + "modification_date": "2024-04-02", + "mouse_platform": { + "device_type": "Disc", + "name": "MindScope Running Disk", + "serial_number": null, + "manufacturer": { + "name": "Allen Institute", + "abbreviation": "AI", + "registry": { + "name": "Research Organization Registry", + "abbreviation": "ROR" + }, + "registry_identifier": "03cpe7c52" + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "surface_material": "Kittrich Magic Cover Solid Grip Liner", + "date_surface_replaced": null, + "radius": "8.255", + "radius_unit": "centimeter", + "output": "Digital Output", + "encoder": "CUI Devices AMT102-V 0000 Dip Switch 2048 ppr", + "decoder": "LS7366R", + "encoder_firmware": { + "name": "ls7366r_quadrature_counter", + "version": "0.1.6", + "url": "https://eng-gitlab/hardware/ls7366r_quadrature_counter", + "parameters": {} + } + }, + "stimulus_devices": [ + { + "device_type": "Monitor", + "name": "Stimulus Screen", + "serial_number": null, + "manufacturer": { + "name": "ASUS", + "abbreviation": null, + "registry": { + "name": "Research Organization Registry", + "abbreviation": "ROR" + }, + "registry_identifier": "00bxkz165" + }, + "model": "PA248Q", + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": "viewing distance is from screen normal to bregma", + "refresh_rate": 60, + "width": 1920, + "height": 1200, + "size_unit": "pixel", + "viewing_distance": "15.5", + "viewing_distance_unit": "centimeter", + "position": { + "device_position_transformations": [ + { + "type": "rotation", + "rotation": [ + "-0.80914", + "-0.58761", + "0", + "-0.12391", + "0.17063", + "0.97751", + "-0.5744", + "0.79095", + "-0.21087" + ] + }, + { + "type": "translation", + "translation": [ + "0.08751", + "-0.12079", + "0.02298" + ] + } + ], + "device_origin": "Center of Screen on Face", + "device_axes": [ + { + "name": "Z", + "direction": "Away from screen" + }, + { + "name": "Y", + "direction": "Pointing to the top of the screen" + }, + { + "name": "X", + "direction": "Oriented parallel to the long edge of the screen" + } + ], + "notes": null + }, + "contrast": null, + "brightness": null + } + ], + "cameras": [ + { + "name": "Behavior Camera", + "camera_target": "Body", + "camera": { + "device_type": "Detector", + "name": "Behavior Camera", + "serial_number": null, + "manufacturer": { + "name": "Allied", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": "Mako G-32B", + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "detector_type": "Camera", + "data_interface": "Ethernet", + "cooling": "None", + "computer_name": "Video Monitor", + "max_frame_rate": "60", + "frame_rate_unit": "hertz", + "immersion": null, + "chroma": "Monochrome", + "sensor_width": 658, + "sensor_height": 492, + "size_unit": "inch", + "sensor_format": "1/3", + "sensor_format_unit": "inch", + "bit_depth": 8, + "bin_mode": "None", + "bin_width": null, + "bin_height": null, + "bin_unit": "pixel", + "gain": "4", + "crop_width": null, + "crop_height": null, + "crop_unit": "pixel", + "recording_software": { + "name": "MultiVideoRecorder", + "version": "1.1.7", + "url": null, + "parameters": {} + }, + "driver": "Vimba", + "driver_version": "Vimba GigE Transport Layer 1.6.0" + }, + "lens": { + "device_type": "Lens", + "name": "Behavior Camera Lens", + "serial_number": null, + "manufacturer": { + "name": "Thorlabs", + "abbreviation": null, + "registry": { + "name": "Research Organization Registry", + "abbreviation": "ROR" + }, + "registry_identifier": "04gsnvb07" + }, + "model": "MVL6WA", + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "focal_length": "6", + "focal_length_unit": "millimeter", + "size": null, + "lens_size_unit": "inch", + "optimized_wavelength_range": null, + "wavelength_unit": "nanometer", + "max_aperture": "f/1.4" + }, + "filter": { + "device_type": "Filter", + "name": "Behavior Camera Filter", + "serial_number": null, + "manufacturer": { + "name": "Semrock", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": "FF01-747/33-25", + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "filter_type": "Band pass", + "diameter": null, + "width": null, + "height": null, + "size_unit": "millimeter", + "thickness": null, + "thickness_unit": "millimeter", + "filter_wheel_index": null, + "cut_off_wavelength": 780, + "cut_on_wavelength": 714, + "center_wavelength": 747, + "wavelength_unit": "nanometer", + "description": null + }, + "position": { + "device_position_transformations": [ + { + "type": "rotation", + "rotation": [ + "-1", + "0", + "0", + "0", + "0", + "-1", + "0", + "-3", + "0" + ] + }, + { + "type": "translation", + "translation": [ + "-0.03617", + "0.23887", + "-0.02535" + ] + } + ], + "device_origin": "Located on face of the lens mounting surface in its center", + "device_axes": [ + { + "name": "Z", + "direction": "moving away from the sensor towards the object" + }, + { + "name": "Y", + "direction": "pointing to the bottom edge of the sensor" + }, + { + "name": "X", + "direction": "parallel to the bottom edge of the sensor" + } + ], + "notes": null + } + }, + { + "name": "Eye Camera", + "camera_target": "Eye", + "camera": { + "device_type": "Detector", + "name": "Eye Camera", + "serial_number": null, + "manufacturer": { + "name": "Allied", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": "Mako G-32B", + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "detector_type": "Camera", + "data_interface": "Ethernet", + "cooling": "None", + "computer_name": "Video Monitor", + "max_frame_rate": "60", + "frame_rate_unit": "hertz", + "immersion": null, + "chroma": "Monochrome", + "sensor_width": 658, + "sensor_height": 492, + "size_unit": "inch", + "sensor_format": "1/3", + "sensor_format_unit": "inch", + "bit_depth": 8, + "bin_mode": "None", + "bin_width": null, + "bin_height": null, + "bin_unit": "pixel", + "gain": "4", + "crop_width": null, + "crop_height": null, + "crop_unit": "pixel", + "recording_software": { + "name": "MultiVideoRecorder", + "version": "1.1.7", + "url": null, + "parameters": {} + }, + "driver": "Vimba", + "driver_version": "Vimba GigE Transport Layer 1.6.0" + }, + "lens": { + "device_type": "Lens", + "name": "Eye Camera Lens", + "serial_number": null, + "manufacturer": { + "name": "Infinity Photo-Optical", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": "213073", + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "focal_length": null, + "focal_length_unit": "millimeter", + "size": null, + "lens_size_unit": "inch", + "optimized_wavelength_range": null, + "wavelength_unit": "nanometer", + "max_aperture": null + }, + "filter": { + "device_type": "Filter", + "name": "Eye Camera Filter", + "serial_number": null, + "manufacturer": { + "name": "Semrock", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": "FF01-850/10-25", + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "filter_type": "Band pass", + "diameter": null, + "width": null, + "height": null, + "size_unit": "millimeter", + "thickness": null, + "thickness_unit": "millimeter", + "filter_wheel_index": null, + "cut_off_wavelength": 860, + "cut_on_wavelength": 840, + "center_wavelength": 850, + "wavelength_unit": "nanometer", + "description": null + }, + "position": { + "device_position_transformations": [ + { + "type": "rotation", + "rotation": [ + "-0.5", + "-0.86603", + "0", + "-0.366", + "0.21131", + "-0.90631", + "0.78489", + "-0.45315", + "-0.42262" + ] + }, + { + "type": "translation", + "translation": [ + "-0.14259", + "0.06209", + "-0.09576" + ] + } + ], + "device_origin": "Located on face of the lens mounting surface in its center", + "device_axes": [ + { + "name": "Z", + "direction": "moving away from the sensor towards the object" + }, + { + "name": "Y", + "direction": "pointing to the bottom edge of the sensor" + }, + { + "name": "X", + "direction": "parallel to the bottom edge of the sensor" + } + ], + "notes": null + } + }, + { + "name": "Face Camera", + "camera_target": "Face forward", + "camera": { + "device_type": "Detector", + "name": "Face Camera", + "serial_number": null, + "manufacturer": { + "name": "Allied", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": "Mako G-32B", + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "detector_type": "Camera", + "data_interface": "Ethernet", + "cooling": "None", + "computer_name": "Video Monitor", + "max_frame_rate": "60", + "frame_rate_unit": "hertz", + "immersion": null, + "chroma": "Monochrome", + "sensor_width": 658, + "sensor_height": 492, + "size_unit": "inch", + "sensor_format": "1/3", + "sensor_format_unit": "inch", + "bit_depth": 8, + "bin_mode": "None", + "bin_width": null, + "bin_height": null, + "bin_unit": "pixel", + "gain": "4", + "crop_width": null, + "crop_height": null, + "crop_unit": "pixel", + "recording_software": { + "name": "MultiVideoRecorder", + "version": "1.1.7", + "url": null, + "parameters": {} + }, + "driver": "Vimba", + "driver_version": "Vimba GigE Transport Layer 1.6.0" + }, + "lens": { + "device_type": "Lens", + "name": "Face Camera Lens", + "serial_number": null, + "manufacturer": { + "name": "Edmund Optics", + "abbreviation": null, + "registry": { + "name": "Research Organization Registry", + "abbreviation": "ROR" + }, + "registry_identifier": "01j1gwp17" + }, + "model": "86-604", + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "focal_length": "8.5", + "focal_length_unit": "millimeter", + "size": null, + "lens_size_unit": "inch", + "optimized_wavelength_range": null, + "wavelength_unit": "nanometer", + "max_aperture": "f/8" + }, + "filter": { + "device_type": "Filter", + "name": "Face Camera Filter", + "serial_number": null, + "manufacturer": { + "name": "Semrock", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": "FF01-715/LP-25", + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "filter_type": "Long pass", + "diameter": null, + "width": null, + "height": null, + "size_unit": "millimeter", + "thickness": null, + "thickness_unit": "millimeter", + "filter_wheel_index": null, + "cut_off_wavelength": null, + "cut_on_wavelength": 715, + "center_wavelength": null, + "wavelength_unit": "nanometer", + "description": null + }, + "position": { + "device_position_transformations": [ + { + "type": "rotation", + "rotation": [ + "-0.17365", + "0.98481", + "0", + "0.44709", + "0.07883", + "-0.89101", + "-0.87747", + "-0.15472", + "-0.45399" + ] + }, + { + "type": "translation", + "translation": [ + "0.154", + "0.03078", + "0.06346" + ] + } + ], + "device_origin": "Located on face of the lens mounting surface in its center", + "device_axes": [ + { + "name": "Z", + "direction": "moving away from the sensor towards the object" + }, + { + "name": "Y", + "direction": "pointing to the bottom edge of the sensor" + }, + { + "name": "X", + "direction": "parallel to the bottom edge of the sensor" + } + ], + "notes": null + } + } + ], + "enclosure": null, + "ephys_assemblies": [], + "fiber_assemblies": [], + "stick_microscopes": [], + "laser_assemblies": [], + "patch_cords": [], + "light_sources": [], + "detectors": [], + "objectives": [], + "filters": [], + "lenses": [], + "digital_micromirror_devices": [], + "polygonal_scanners": [], + "pockels_cells": [], + "additional_devices": [], + "daqs": [ + { + "device_type": "DAQ Device", + "name": "VBEB DAQ", + "serial_number": null, + "manufacturer": { + "name": "National Instruments", + "abbreviation": null, + "registry": { + "name": "Research Organization Registry", + "abbreviation": "ROR" + }, + "registry_identifier": "026exqw73" + }, + "model": "USB-6001", + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "data_interface": "USB", + "computer_name": "STIM", + "channels": [], + "firmware_version": null, + "hardware_version": null + }, + { + "device_type": "DAQ Device", + "name": "SYNC DAQ", + "serial_number": null, + "manufacturer": { + "name": "National Instruments", + "abbreviation": null, + "registry": { + "name": "Research Organization Registry", + "abbreviation": "ROR" + }, + "registry_identifier": "026exqw73" + }, + "model": "PCIe-6612", + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "data_interface": "PCIe", + "computer_name": "SYNC", + "channels": [], + "firmware_version": null, + "hardware_version": null + }, + { + "device_type": "DAQ Device", + "name": "STIM DAQ", + "serial_number": null, + "manufacturer": { + "name": "National Instruments", + "abbreviation": null, + "registry": { + "name": "Research Organization Registry", + "abbreviation": "ROR" + }, + "registry_identifier": "026exqw73" + }, + "model": "PCIe-6321", + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "data_interface": "PCIe", + "computer_name": "STIM", + "channels": [], + "firmware_version": null, + "hardware_version": null + } + ], + "calibrations": [], + "ccf_coordinate_transform": null, + "origin": "Bregma", + "rig_axes": [ + { + "name": "X", + "direction": "lays on the Mouse Sagittal Plane, Positive direction is towards the nose of the mouse" + }, + { + "name": "Z", + "direction": "positive pointing UP opposite the direction from the force of gravity" + }, + { + "name": "Y", + "direction": "defined by the right hand rule and the other two axis" + } + ], + "modalities": [], + "notes": null +} \ No newline at end of file diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py new file mode 100644 index 00000000..511bea70 --- /dev/null +++ b/examples/multiplane_ophys_rig.py @@ -0,0 +1,711 @@ +"""Generates an example rig JSON for a multiplane-ophys session""" + +from datetime import date +from decimal import Decimal + +from aind_data_schema_models.organizations import ( + AllenInstitute, + Allied, + Asus, + CoherentScientific, + Conoptics, + EdmundOptics, + Hamamatsu, + InfinityPhotoOptical, + LumenDynamics, + NationalInstruments, + Semrock, + Thorlabs, +) +from aind_data_schema_models.registry import ResearchOrganizationRegistry +from aind_data_schema_models.units import FrequencyUnit, SizeUnit + +from aind_data_schema.base import AindGeneric +from aind_data_schema.components.coordinates import Axis, RelativePosition, Rotation3dTransform, Translation3dTransform +from aind_data_schema.components.devices import ( + BinMode, + Camera, + CameraAssembly, + Cooling, + DataInterface, + Detector, + Disc, + Filter, + LightEmittingDiode, + Laser, + Lens, + PockelsCell, + Software, +) +from aind_data_schema.core.instrument import DAQDevice +from aind_data_schema.core.rig import Monitor, Rig + +rig = Rig( + describedBy="https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/rig.py", # noqa + schema_version="0.5.3", + rig_id="429-mesoscope-2022321", + modification_date=date(2022, 3, 21), + mouse_platform=Disc( + device_type="Disc", + name="MindScope Running Disk", + serial_number=None, + manufacturer=AllenInstitute( + name="Allen Institute", + abbreviation="AI", + registry=ResearchOrganizationRegistry( + name="Research Organization Registry", abbreviation="ROR" + ), + registry_identifier="03cpe7c52", + ), + model=None, + path_to_cad=None, + port_index=None, + additional_settings=AindGeneric(), + notes=None, + surface_material="Kittrich Magic Cover Solid Grip Liner", + date_surface_replaced=None, + radius=Decimal("8.255"), + radius_unit="centimeter", + output="Digital Output", + encoder="CUI Devices AMT102-V 0000 Dip Switch 2048 ppr", + decoder="LS7366R", + encoder_firmware=Software( + name="ls7366r_quadrature_counter", + version="0.1.6", + url="https://eng-gitlab/hardware/ls7366r_quadrature_counter", + parameters=AindGeneric(), + ), + ), + stimulus_devices=[ + Monitor( + device_type="Monitor", + name="Stimulus Screen", + serial_number=None, + manufacturer=Asus( + name="ASUS", + abbreviation=None, + registry=ResearchOrganizationRegistry( + name="Research Organization Registry", abbreviation="ROR" + ), + registry_identifier="00bxkz165", + ), + model="PA248Q", + path_to_cad=None, + port_index=None, + additional_settings=AindGeneric(), + notes="viewing distance is from screen normal to bregma", + refresh_rate=60, + width=1920, + height=1200, + size_unit="pixel", + viewing_distance=Decimal("15.5"), + viewing_distance_unit="centimeter", + position=RelativePosition( + device_position_transformations=[ + Rotation3dTransform( + type="rotation", + rotation=[ + Decimal("-0.80914"), + Decimal("-0.58761"), + Decimal("0"), + Decimal("-0.12391"), + Decimal("0.17063"), + Decimal("0.97751"), + Decimal("-0.5744"), + Decimal("0.79095"), + Decimal("-0.21087"), + ], + ), + Translation3dTransform( + type="translation", + translation=[ + Decimal("0.08751"), + Decimal("-0.12079"), + Decimal("0.02298"), + ], + ), + ], + device_origin="Center of Screen on Face", + device_axes=[ + Axis(name="Z", direction="Away from screen"), + Axis(name="Y", direction="Pointing to the top of the screen"), + Axis( + name="X", + direction="Oriented parallel to the long edge of the screen", + ), + ], + notes=None, + ), + contrast=None, + brightness=None, + ) + ], + cameras=[ + CameraAssembly( + name="Behavior Camera", + camera_target="Body", + camera=Camera( + device_type="Detector", + name="Behavior Camera", + serial_number=None, + manufacturer=Allied( + name="Allied", + abbreviation=None, + registry=None, + registry_identifier=None, + ), + model="Mako G-32B", + path_to_cad=None, + port_index=None, + additional_settings=AindGeneric(), + notes=None, + detector_type="Camera", + data_interface="Ethernet", + cooling=Cooling.NONE, + computer_name="Video Monitor", + frame_rate=Decimal("60"), + frame_rate_unit=FrequencyUnit.HZ, + immersion=None, + chroma="Monochrome", + sensor_width=658, + sensor_height=492, + size_unit=SizeUnit.IN, + sensor_format="1/3", + sensor_format_unit=SizeUnit.IN, + bit_depth=8, + bin_mode=BinMode.NONE, + bin_width=None, + bin_height=None, + bin_unit=SizeUnit.PX, + gain=Decimal("4"), + crop_width=None, + crop_height=None, + crop_unit=SizeUnit.PX, + recording_software=Software( + name="MultiVideoRecorder", + version="1.1.7", + url=None, + parameters=AindGeneric(), + ), + driver="Vimba", + driver_version="Vimba GigE Transport Layer 1.6.0", + ), + lens=Lens( + device_type="Lens", + name="Behavior Camera Lens", + serial_number=None, + manufacturer=Thorlabs( + name="Thorlabs", + abbreviation=None, + registry=ResearchOrganizationRegistry( + name="Research Organization Registry", abbreviation="ROR" + ), + registry_identifier="04gsnvb07", + ), + model="MVL6WA", + path_to_cad=None, + port_index=None, + additional_settings=AindGeneric(), + notes=None, + focal_length=Decimal("6"), + focal_length_unit=SizeUnit.MM, + size=None, + lens_size_unit=SizeUnit.IN, + optimized_wavelength_range=None, + wavelength_unit=SizeUnit.NM, + max_aperture="f/1.4", + ), + filter=Filter( + device_type="Filter", + name="Behavior Camera Filter", + serial_number=None, + manufacturer=Semrock( + name="Semrock", + abbreviation=None, + registry=None, + registry_identifier=None, + ), + model="FF01-747/33-25", + path_to_cad=None, + port_index=None, + additional_settings=AindGeneric(), + notes=None, + filter_type="Band pass", + diameter=None, + width=None, + height=None, + size_unit=SizeUnit.MM, + thickness=None, + thickness_unit=SizeUnit.MM, + filter_wheel_index=None, + cut_off_wavelength=780, + cut_on_wavelength=714, + center_wavelength=747, + wavelength_unit=SizeUnit.NM, + description=None, + ), + position=RelativePosition( + device_position_transformations=[ + Rotation3dTransform( + type="rotation", + rotation=[ + Decimal("-1"), + Decimal("0"), + Decimal("0"), + Decimal("0"), + Decimal("0"), + Decimal("-1"), + Decimal("0"), + Decimal("-3"), + Decimal("0"), + ], + ), + Translation3dTransform( + type="translation", + translation=[ + Decimal("-0.03617"), + Decimal("0.23887"), + Decimal("-0.02535"), + ], + ), + ], + device_origin="Located on face of the lens mounting surface in its center", + device_axes=[ + Axis( + name="Z", + direction="moving away from the sensor towards the object", + ), + Axis(name="Y", direction="pointing to the bottom edge of the sensor"), + Axis(name="X", direction="parallel to the bottom edge of the sensor"), + ], + notes=None, + ), + ), + CameraAssembly( + name="Eye Camera", + camera_target="Eye", + camera=Camera( + device_type="Detector", + name="Eye Camera", + serial_number=None, + manufacturer=Allied( + name="Allied", + abbreviation=None, + registry=None, + registry_identifier=None, + ), + model="Mako G-32B", + path_to_cad=None, + port_index=None, + additional_settings=AindGeneric(), + notes=None, + detector_type="Camera", + data_interface="Ethernet", + cooling=Cooling.NONE, + computer_name="Video Monitor", + frame_rate=Decimal("60"), + frame_rate_unit=FrequencyUnit.HZ, + immersion=None, + chroma="Monochrome", + sensor_width=658, + sensor_height=492, + size_unit=SizeUnit.IN, + sensor_format="1/3", + sensor_format_unit=SizeUnit.IN, + bit_depth=8, + bin_mode=BinMode.NONE, + bin_width=None, + bin_height=None, + bin_unit=SizeUnit.PX, + gain=Decimal("4"), + crop_width=None, + crop_height=None, + crop_unit=SizeUnit.PX, + recording_software=Software( + name="MultiVideoRecorder", + version="1.1.7", + url=None, + parameters=AindGeneric(), + ), + driver="Vimba", + driver_version="Vimba GigE Transport Layer 1.6.0", + ), + lens=Lens( + device_type="Lens", + name="Eye Camera Lens", + serial_number=None, + manufacturer=InfinityPhotoOptical( + name="Infinity Photo-Optical", + abbreviation=None, + registry=None, + registry_identifier=None, + ), + model="213073", + path_to_cad=None, + port_index=None, + additional_settings=AindGeneric(), + notes=None, + focal_length=None, + focal_length_unit=SizeUnit.MM, + size=None, + lens_size_unit=SizeUnit.IN, + optimized_wavelength_range=None, + wavelength_unit=SizeUnit.NM, + max_aperture=None, + ), + filter=Filter( + device_type="Filter", + name="Eye Camera Filter", + serial_number=None, + manufacturer=Semrock( + name="Semrock", + abbreviation=None, + registry=None, + registry_identifier=None, + ), + model="FF01-850/10-25", + path_to_cad=None, + port_index=None, + additional_settings=AindGeneric(), + notes=None, + filter_type="Band pass", + diameter=None, + width=None, + height=None, + size_unit=SizeUnit.MM, + thickness=None, + thickness_unit=SizeUnit.MM, + filter_wheel_index=None, + cut_off_wavelength=860, + cut_on_wavelength=840, + center_wavelength=850, + wavelength_unit=SizeUnit.NM, + description=None, + ), + position=RelativePosition( + device_position_transformations=[ + Rotation3dTransform( + type="rotation", + rotation=[ + Decimal("-0.5"), + Decimal("-0.86603"), + Decimal("0"), + Decimal("-0.366"), + Decimal("0.21131"), + Decimal("-0.90631"), + Decimal("0.78489"), + Decimal("-0.45315"), + Decimal("-0.42262"), + ], + ), + Translation3dTransform( + type="translation", + translation=[ + Decimal("-0.14259"), + Decimal("0.06209"), + Decimal("-0.09576"), + ], + ), + ], + device_origin="Located on face of the lens mounting surface in its center", + device_axes=[ + Axis( + name="Z", + direction="moving away from the sensor towards the object", + ), + Axis(name="Y", direction="pointing to the bottom edge of the sensor"), + Axis(name="X", direction="parallel to the bottom edge of the sensor"), + ], + notes=None, + ), + ), + CameraAssembly( + name="Face Camera", + camera_target="Face forward", + camera=Camera( + device_type="Detector", + name="Face Camera", + serial_number=None, + manufacturer=Allied( + name="Allied", + abbreviation=None, + registry=None, + registry_identifier=None, + ), + model="Mako G-32B", + path_to_cad=None, + port_index=None, + additional_settings=AindGeneric(), + notes=None, + detector_type="Camera", + data_interface="Ethernet", + cooling=Cooling.NONE, + computer_name="Video Monitor", + frame_rate=Decimal("60"), + frame_rate_unit=FrequencyUnit.HZ, + immersion=None, + chroma="Monochrome", + sensor_width=658, + sensor_height=492, + size_unit=SizeUnit.IN, + sensor_format="1/3", + sensor_format_unit=SizeUnit.IN, + bit_depth=8, + bin_mode=BinMode.NONE, + bin_width=None, + bin_height=None, + bin_unit=SizeUnit.PX, + gain=Decimal("4"), + crop_width=None, + crop_height=None, + crop_unit=SizeUnit.PX, + recording_software=Software( + name="MultiVideoRecorder", + version="1.1.7", + url=None, + parameters=AindGeneric(), + ), + driver="Vimba", + driver_version="Vimba GigE Transport Layer 1.6.0", + ), + lens=Lens( + device_type="Lens", + name="Face Camera Lens", + serial_number=None, + manufacturer=EdmundOptics( + name="Edmund Optics", + abbreviation=None, + registry=ResearchOrganizationRegistry( + name="Research Organization Registry", abbreviation="ROR" + ), + registry_identifier="01j1gwp17", + ), + model="86-604", + path_to_cad=None, + port_index=None, + additional_settings=AindGeneric(), + notes=None, + focal_length=Decimal("8.5"), + focal_length_unit=SizeUnit.MM, + size=None, + lens_size_unit=SizeUnit.IN, + optimized_wavelength_range=None, + wavelength_unit=SizeUnit.NM, + max_aperture="f/8", + ), + filter=Filter( + device_type="Filter", + name="Face Camera Filter", + serial_number=None, + manufacturer=Semrock( + name="Semrock", + abbreviation=None, + registry=None, + registry_identifier=None, + ), + model="FF01-715/LP-25", + path_to_cad=None, + port_index=None, + additional_settings=AindGeneric(), + notes=None, + filter_type="Long pass", + diameter=None, + width=None, + height=None, + size_unit=SizeUnit.MM, + thickness=None, + thickness_unit=SizeUnit.MM, + filter_wheel_index=None, + cut_off_wavelength=None, + cut_on_wavelength=715, + center_wavelength=None, + wavelength_unit=SizeUnit.NM, + description=None, + ), + position=RelativePosition( + device_position_transformations=[ + Rotation3dTransform( + type="rotation", + rotation=[ + Decimal("-0.17365"), + Decimal("0.98481"), + Decimal("0"), + Decimal("0.44709"), + Decimal("0.07883"), + Decimal("-0.89101"), + Decimal("-0.87747"), + Decimal("-0.15472"), + Decimal("-0.45399"), + ], + ), + Translation3dTransform( + type="translation", + translation=[ + Decimal("0.154"), + Decimal("0.03078"), + Decimal("0.06346"), + ], + ), + ], + device_origin="Located on face of the lens mounting surface in its center", + device_axes=[ + Axis( + name="Z", + direction="moving away from the sensor towards the object", + ), + Axis(name="Y", direction="pointing to the bottom edge of the sensor"), + Axis(name="X", direction="parallel to the bottom edge of the sensor"), + ], + notes=None, + ), + ), + ], + enclosure=None, + ephys_assemblies=[], + fiber_assemblies=[], + stick_microscopes=[], + laser_assemblies=[], + patch_cords=[], + light_sources=[ + Laser( + device_type="Laser", + name="Laser", + wavelength=920, + wavelength_unit=SizeUnit.NM, + serial_number="GDP.100H.1332", + manufacturer=CoherentScientific(name="Coherent Scientific"), + ), + LightEmittingDiode( + name="Epi lamp", + wavelength_max=600, + wavelength_min=350, + wavelength_unit=SizeUnit.NM, + manufacturer=LumenDynamics(name="Lumen Dynamics"), + ), + ], + detectors=[ + Detector( + name="PMT", + detector_type="Photomultiplier Tube", + manufacturer=Hamamatsu(name="Hamamatsu"), + data_interface=DataInterface.PCIE, + ) + ], + objectives=[], + filters=[], + lenses=[], + digital_micromirror_devices=[], + polygonal_scanners=[], + pockels_cells=[ + PockelsCell( + name="Pockels Cell 1", + polygonal_scanner="no polygon scanner", + on_time=12.0, + off_time=13.0, + manufacturer=Conoptics(name="Conoptics"), + model="530-80", + serial_number="354699BK", + ), + PockelsCell( + name="Pockels Cell 2", + manufacturer=Conoptics(name="Conoptics"), + polygonal_scanner="no polygon scanner", + on_time=12.0, + off_time=13.0, + model="530-80", + serial_number="353414BK", + ), + ], + additional_devices=[], + daqs=[ + DAQDevice( + device_type="DAQ Device", + name="VBEB DAQ", + serial_number=None, + manufacturer=NationalInstruments( + name="National Instruments", + abbreviation=None, + registry=ResearchOrganizationRegistry( + name="Research Organization Registry", abbreviation="ROR" + ), + registry_identifier="026exqw73", + ), + model="USB-6001", + path_to_cad=None, + port_index=None, + additional_settings=AindGeneric(), + notes=None, + data_interface="USB", + computer_name="STIM", + channels=[], + firmware_version=None, + hardware_version=None, + ), + DAQDevice( + device_type="DAQ Device", + name="SYNC DAQ", + serial_number=None, + manufacturer=NationalInstruments( + name="National Instruments", + abbreviation=None, + registry=ResearchOrganizationRegistry( + name="Research Organization Registry", abbreviation="ROR" + ), + registry_identifier="026exqw73", + ), + model="PCIe-6612", + path_to_cad=None, + port_index=None, + additional_settings=AindGeneric(), + notes=None, + data_interface="PCIe", + computer_name="SYNC", + channels=[], + firmware_version=None, + hardware_version=None, + ), + DAQDevice( + device_type="DAQ Device", + name="STIM DAQ", + serial_number=None, + manufacturer=NationalInstruments( + name="National Instruments", + abbreviation=None, + registry=ResearchOrganizationRegistry( + name="Research Organization Registry", abbreviation="ROR" + ), + registry_identifier="026exqw73", + ), + model="PCIe-6321", + path_to_cad=None, + port_index=None, + additional_settings=AindGeneric(), + notes=None, + data_interface="PCIe", + computer_name="STIM", + channels=[], + firmware_version=None, + hardware_version=None, + ), + ], + calibrations=[], + ccf_coordinate_transform=None, + origin="Bregma", + rig_axes=[ + Axis( + name="X", + direction="lays on the Mouse Sagittal Plane, Positive direction is towards the nose of the mouse", + ), + Axis( + name="Z", + direction="positive pointing UP opposite the direction from the force of gravity", + ), + Axis(name="Y", direction="defined by the right hand rule and the other two axis"), + ], + modalities=set("ophys"), + notes=None, +) + +serialized = rig.model_dump_json() +deserialized = Rig.model_validate_json(serialized) +deserialized.write_standard_file(prefix="mesoscope_ophys") diff --git a/examples/multiplane_ophys_session.py b/examples/multiplane_ophys_session.py index 493c197c..27088182 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -2,9 +2,12 @@ from datetime import datetime, timezone -from aind_data_schema_models.modalities import Modality -from aind_data_schema_models.units import PowerUnit, SizeUnit - +from aind_data_schema.core.session import FieldOfView, LaserConfig, Session, Stream +from aind_data_schema.models.units import PowerUnit, SizeUnit +from aind_data_schema.models.modalities import Modality +from aind_data_schema.models.units import PowerUnit, SizeUnit +from aind_data_schema.models.devices import Detector, DetectorType +from aind_data_schema.models.organizations import Hamamatsu from aind_data_schema.core.session import FieldOfView, LaserConfig, Session, Stream # If a timezone isn't specified, the timezone of the computer running this @@ -18,7 +21,7 @@ subject_id="12345", session_type="Mesoscope", iacuc_protocol="12345", - rig_id="MESO.1", + rig_id="429-mesoscope-2022321", mouse_platform_name="disc", active_mouse_platform=True, data_streams=[ @@ -35,7 +38,7 @@ ], light_sources=[ LaserConfig( - name="Laser A", + name="Chameleon laser", wavelength=920, wavelength_unit="nanometer", excitation_power=10,