diff --git a/examples/multiplane_ophys_rig.json b/examples/multiplane_ophys_rig.json new file mode 100644 index 000000000..9cf76a16c --- /dev/null +++ b/examples/multiplane_ophys_rig.json @@ -0,0 +1,824 @@ +{ + "describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/rig.py", + "schema_version": "1.0.4", + "rig_id": "429_mesoscope_20220321", + "modification_date": "2024-10-16", + "mouse_platform": { + "device_type": "Disc", + "name": "MindScope Running Disc", + "serial_number": null, + "manufacturer": { + "name": "Allen Institute for Neural Dynamics", + "abbreviation": "AIND", + "registry": { + "name": "Research Organization Registry", + "abbreviation": "ROR" + }, + "registry_identifier": "04szwah67" + }, + "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", + "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_offset_x": null, + "crop_offset_y": null, + "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", + "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": "22", + "crop_offset_x": null, + "crop_offset_y": null, + "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", + "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": "13", + "crop_offset_x": null, + "crop_offset_y": null, + "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": [ + { + "device_type": "Laser", + "name": "Axon 920-2 TPC", + "serial_number": "GDP.1007S.3490", + "manufacturer": { + "name": "Coherent Scientific", + "abbreviation": null, + "registry": { + "name": "Research Organization Registry", + "abbreviation": "ROR" + }, + "registry_identifier": "031tysd23" + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "wavelength": 920, + "wavelength_unit": "nanometer", + "maximum_power": null, + "power_unit": "milliwatt", + "coupling": null, + "coupling_efficiency": null, + "coupling_efficiency_unit": "percent", + "item_number": null + } + ], + "detectors": [ + { + "device_type": "Detector", + "name": "H11706-40", + "serial_number": null, + "manufacturer": { + "name": "Hamamatsu", + "abbreviation": null, + "registry": { + "name": "Research Organization Registry", + "abbreviation": "ROR" + }, + "registry_identifier": "03natb733" + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "detector_type": "Photomultiplier Tube", + "data_interface": "PCIe", + "cooling": "None", + "computer_name": null, + "frame_rate": null, + "frame_rate_unit": "hertz", + "immersion": null, + "chroma": null, + "sensor_width": null, + "sensor_height": null, + "size_unit": "pixel", + "sensor_format": null, + "sensor_format_unit": null, + "bit_depth": null, + "bin_mode": "None", + "bin_width": null, + "bin_height": null, + "bin_unit": "pixel", + "gain": null, + "crop_offset_x": null, + "crop_offset_y": null, + "crop_width": null, + "crop_height": null, + "crop_unit": "pixel", + "recording_software": null, + "driver": null, + "driver_version": null + } + ], + "objectives": [ + { + "device_type": "Objective", + "name": "Mesoscope JenOptik Objective", + "serial_number": "110", + "manufacturer": { + "name": "Thorlabs", + "abbreviation": null, + "registry": { + "name": "Research Organization Registry", + "abbreviation": "ROR" + }, + "registry_identifier": "04gsnvb07" + }, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": "Part from JenOptik: 14163000", + "numerical_aperture": "0.8", + "magnification": "3.6", + "immersion": "water", + "objective_type": null + } + ], + "filters": [], + "lenses": [], + "digital_micromirror_devices": [], + "polygonal_scanners": [], + "pockels_cells": [ + { + "device_type": "Pockels cell", + "name": "Pockels Cell 1", + "serial_number": "354683BK", + "manufacturer": { + "name": "Conoptics", + "abbreviation": null, + "registry": null, + "registry_identifier": null + }, + "model": "350-80", + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null, + "polygonal_scanner": "", + "on_time": "12.0", + "off_time": "13.0", + "time_setting_unit": "fraction of cycle", + "beam_modulation": null, + "beam_modulation_unit": "Volts" + } + ], + "additional_devices": [ + { + "device_type": "Computer", + "name": "MESO1STIM", + "serial_number": null, + "manufacturer": null, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null + }, + { + "device_type": "Computer", + "name": "MESO1SYNC", + "serial_number": null, + "manufacturer": null, + "model": null, + "path_to_cad": null, + "port_index": null, + "additional_settings": {}, + "notes": null + } + ], + "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": [ + { + "channel_name": "P0.3", + "device_name": "MESO1STIM", + "channel_type": "Digital Input", + "port": 0, + "channel_index": 3, + "sample_rate": "100.0", + "sample_rate_unit": "kilohertz", + "event_based_sampling": null + } + ], + "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": [ + { + "name": "Planar optical physiology", + "abbreviation": "pophys" + } + ], + "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 000000000..18b585f81 --- /dev/null +++ b/examples/multiplane_ophys_rig.py @@ -0,0 +1,624 @@ +"""Generates an example rig JSON for a multiplane-ophys session""" + +from datetime import date +from decimal import Decimal + +from aind_data_schema_models.modalities import Modality +from aind_data_schema_models.organizations import Organization +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, + DAQChannel, + DaqChannelType, + DAQDevice, + DataInterface, + Detector, + Device, + Disc, + Filter, + Laser, + Lens, + PockelsCell, + Software, +) +from aind_data_schema.core.instrument import Objective +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="1.0.1", + rig_id="429_mesoscope_20220321", + modification_date=date(2024, 10, 16), + mouse_platform=Disc( + device_type="Disc", + name="MindScope Running Disc", + serial_number=None, + manufacturer=Organization.AIND, + 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=Organization.ASUS, + 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=Organization.ALLIED, + 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=Organization.THORLABS, + 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=Organization.SEMROCK, + 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=Organization.ALLIED, + 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("22"), + 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=Organization.INFINITY_PHOTO_OPTICAL, + 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=Organization.SEMROCK, + 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=Organization.ALLIED, + 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("13"), + 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=Organization.EDMUND_OPTICS, + 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=Organization.SEMROCK, + 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="Axon 920-2 TPC", + wavelength=920, + wavelength_unit=SizeUnit.NM, + serial_number="GDP.1007S.3490", + manufacturer=Organization.COHERENT_SCIENTIFIC, + ), + ], + detectors=[ + Detector( + name="H11706-40", + detector_type="Photomultiplier Tube", + manufacturer=Organization.HAMAMATSU, + data_interface=DataInterface.PCIE, + ) + ], + objectives=[ + Objective( + name="Mesoscope JenOptik Objective", + numerical_aperture=0.8, + magnification=3.6, + manufacturer=Organization.THORLABS, + immersion="water", + notes="Part from JenOptik: 14163000", + serial_number="110", + ) + ], + filters=[], + lenses=[], + digital_micromirror_devices=[], + polygonal_scanners=[], + pockels_cells=[ + PockelsCell( + name="Pockels Cell 1", + polygonal_scanner="", + on_time=12.0, + off_time=13.0, + manufacturer=Organization.CONOPTICS, + model="350-80", + serial_number="354683BK", + ) + ], + additional_devices=[ + Device(device_type="Computer", name="MESO1STIM"), + Device(device_type="Computer", name="MESO1SYNC"), + ], + daqs=[ + DAQDevice( + device_type="DAQ Device", + name="VBEB DAQ", + serial_number=None, + manufacturer=Organization.NATIONAL_INSTRUMENTS, + channels=[], + model="USB-6001", + path_to_cad=None, + port_index=None, + additional_settings=AindGeneric(), + notes=None, + data_interface="USB", + computer_name="STIM", + firmware_version=None, + hardware_version=None, + ), + DAQDevice( + device_type="DAQ Device", + name="SYNC DAQ", + serial_number=None, + manufacturer=Organization.NATIONAL_INSTRUMENTS, + model="PCIe-6612", + path_to_cad=None, + port_index=None, + additional_settings=AindGeneric(), + notes=None, + data_interface="PCIe", + computer_name="SYNC", + channels=[ + DAQChannel( + channel_name="P0.3", + device_name="MESO1STIM", + channel_type=DaqChannelType.DI, + port=0, + channel_index=3, + sample_rate=100.0, + sample_rate_unit=FrequencyUnit.KHZ, + ) + ], + firmware_version=None, + hardware_version=None, + ), + DAQDevice( + device_type="DAQ Device", + name="STIM DAQ", + serial_number=None, + manufacturer=Organization.NATIONAL_INSTRUMENTS, + 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=[Modality.POPHYS], + notes=None, +) + +serialized = rig.model_dump_json() +deserialized = Rig.model_validate_json(serialized) +deserialized.write_standard_file(prefix="multiplane_ophys") diff --git a/examples/multiplane_ophys_session.json b/examples/multiplane_ophys_session.json index e18ea8031..c79fd9e75 100644 --- a/examples/multiplane_ophys_session.json +++ b/examples/multiplane_ophys_session.json @@ -1,6 +1,6 @@ { "describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/session.py", - "schema_version": "0.3.3", + "schema_version": "1.0.3", "protocol_id": [], "experimenter_full_name": [ "John Doe" @@ -9,7 +9,7 @@ "session_end_time": "2022-07-12T07:00:00Z", "session_type": "Mesoscope", "iacuc_protocol": "12345", - "rig_id": "MESO.1", + "rig_id": "429_mesoscope_20220321", "calibrations": [], "maintenance": [], "subject_id": "12345", @@ -21,18 +21,20 @@ { "stream_start_time": "2022-07-12T07:00:00Z", "stream_end_time": "2022-07-12T07:00:00Z", - "daq_names": [], + "daq_names": [ + "SYNC DAQ", + "STIM DAQ", + "VBEB DAQ" + ], "camera_names": [ - "Mesoscope", - "Eye", - "Face", - "Behavior", - "Vasculature" + "Behavior Camera", + "Eye Camera", + "Face Camera" ], "light_sources": [ { "device_type": "Laser", - "name": "Laser A", + "name": "Axon 920-2 TPC", "wavelength": 920, "wavelength_unit": "nanometer", "excitation_power": "10", @@ -255,21 +257,17 @@ "notes": null } ], - "slap_fovs": null, + "slap_fovs": [], "stack_parameters": null, "mri_scans": [], "stream_modalities": [ { "name": "Planar optical physiology", - "abbreviation": "ophys" + "abbreviation": "pophys" }, { "name": "Behavior videos", "abbreviation": "behavior-videos" - }, - { - "name": "Confocal microscopy", - "abbreviation": "confocal" } ], "software": [], @@ -277,11 +275,11 @@ } ], "stimulus_epochs": [], - "mouse_platform_name": "disc", + "mouse_platform_name": "MindScope Running Disc", "active_mouse_platform": true, "headframe_registration": null, "reward_delivery": null, "reward_consumed_total": null, - "reward_consumed_unit": "microliter", + "reward_consumed_unit": "milliliter", "notes": null } \ No newline at end of file diff --git a/examples/multiplane_ophys_session.py b/examples/multiplane_ophys_session.py index 493c197cb..06a34e131 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -18,24 +18,26 @@ subject_id="12345", session_type="Mesoscope", iacuc_protocol="12345", - rig_id="MESO.1", - mouse_platform_name="disc", + rig_id="429_mesoscope_20220321", + mouse_platform_name="MindScope Running Disc", active_mouse_platform=True, data_streams=[ Stream( stream_start_time=t, stream_end_time=t, - stream_modalities=[Modality.POPHYS, Modality.BEHAVIOR_VIDEOS, Modality.CONFOCAL], + stream_modalities=[ + Modality.POPHYS, + Modality.BEHAVIOR_VIDEOS, + ], + daq_names=["SYNC DAQ", "STIM DAQ", "VBEB DAQ"], camera_names=[ - "Mesoscope", - "Eye", - "Face", - "Behavior", - "Vasculature", + "Behavior Camera", + "Eye Camera", + "Face Camera", ], light_sources=[ LaserConfig( - name="Laser A", + name="Axon 920-2 TPC", wavelength=920, wavelength_unit="nanometer", excitation_power=10,