From 6f4f16afe7ca88be4e4f5e44749f63670876ac32 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 24 Apr 2024 16:34:57 -0700 Subject: [PATCH 01/41] testing on runner --- examples/mesoscope_ophys_rig.json | 657 ++++++++++++++++++++++++++++ examples/mesoscope_ophys_rig.py | 693 ++++++++++++++++++++++++++++++ 2 files changed, 1350 insertions(+) create mode 100644 examples/mesoscope_ophys_rig.json create mode 100644 examples/mesoscope_ophys_rig.py diff --git a/examples/mesoscope_ophys_rig.json b/examples/mesoscope_ophys_rig.json new file mode 100644 index 000000000..6728bf25c --- /dev/null +++ b/examples/mesoscope_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/mesoscope_ophys_rig.py b/examples/mesoscope_ophys_rig.py new file mode 100644 index 000000000..8cd824c00 --- /dev/null +++ b/examples/mesoscope_ophys_rig.py @@ -0,0 +1,693 @@ +from datetime import date +from decimal import Decimal + +from aind_data_schema.core.rig import ( + Rig, + Monitor +) +from aind_data_schema.core.instrument import DAQDevice +from aind_data_schema.models.organizations import ( + AllenInstitute, + Asus, + Allied, + Thorlabs, + Semrock, + InfinityPhotoOptical, + EdmundOptics, + NationalInstruments +) +from aind_data_schema.models.devices import ( + Camera, + CameraAssembly, + Disc, + Software, + Lens, + Filter, + Cooling, + BinMode +) +from aind_data_schema.models.coordinates import ( + RelativePosition, + Rotation3dTransform, + Translation3dTransform, + Axis +) +from aind_data_schema.models.units import ( + SizeUnit, + FrequencyUnit +) +from aind_data_schema.models.registry import ResearchOrganizationRegistry +from aind_data_schema.base import AindGeneric + + +rig = Rig( + 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=date(2024, 4, 2), + 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', + max_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', + max_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', + max_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=[], + detectors=[], + objectives=[], + filters=[], + lenses=[], + digital_micromirror_devices=[], + polygonal_scanners=[], + pockels_cells=[], + 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(), + notes=None + ) + +serialized = rig.model_dump_json() +deserialized = Rig.model_validate_json(serialized) +deserialized.write_standard_file(prefix="mesoscope_ophys") \ No newline at end of file From 3d67a51bfe3f39362b84e833666aa02c820c39b5 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 24 Apr 2024 16:41:07 -0700 Subject: [PATCH 02/41] ran linters --- examples/mesoscope_ophys_rig.py | 1288 +++++++++++++++---------------- 1 file changed, 629 insertions(+), 659 deletions(-) diff --git a/examples/mesoscope_ophys_rig.py b/examples/mesoscope_ophys_rig.py index 8cd824c00..378dbeb5f 100644 --- a/examples/mesoscope_ophys_rig.py +++ b/examples/mesoscope_ophys_rig.py @@ -1,20 +1,17 @@ from datetime import date from decimal import Decimal -from aind_data_schema.core.rig import ( - Rig, - Monitor -) +from aind_data_schema.core.rig import Rig, Monitor from aind_data_schema.core.instrument import DAQDevice from aind_data_schema.models.organizations import ( - AllenInstitute, + AllenInstitute, Asus, Allied, Thorlabs, Semrock, InfinityPhotoOptical, EdmundOptics, - NationalInstruments + NationalInstruments, ) from aind_data_schema.models.devices import ( Camera, @@ -24,670 +21,643 @@ Lens, Filter, Cooling, - BinMode + BinMode, ) from aind_data_schema.models.coordinates import ( RelativePosition, Rotation3dTransform, Translation3dTransform, - Axis -) -from aind_data_schema.models.units import ( - SizeUnit, - FrequencyUnit + Axis, ) +from aind_data_schema.models.units import SizeUnit, FrequencyUnit from aind_data_schema.models.registry import ResearchOrganizationRegistry -from aind_data_schema.base import AindGeneric +from aind_data_schema.base import AindGeneric rig = Rig( - 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=date(2024, 4, 2), - mouse_platform=Disc( - device_type='Disc', - name='MindScope Running Disk', - serial_number=None, - manufacturer=AllenInstitute( - name='Allen Institute', - abbreviation='AI', + 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=date(2024, 4, 2), + 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", + max_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", + max_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", + max_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=[], + detectors=[], + objectives=[], + filters=[], + lenses=[], + digital_micromirror_devices=[], + polygonal_scanners=[], + pockels_cells=[], + 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='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', - max_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', - max_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', - max_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=[], - detectors=[], - objectives=[], - filters=[], - lenses=[], - digital_micromirror_devices=[], - polygonal_scanners=[], - pockels_cells=[], - 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(), - notes=None - ) + 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(), + notes=None, +) serialized = rig.model_dump_json() deserialized = Rig.model_validate_json(serialized) -deserialized.write_standard_file(prefix="mesoscope_ophys") \ No newline at end of file +deserialized.write_standard_file(prefix="mesoscope_ophys") From 693757dfe426b055b267b85f62cf1aacc89a2d22 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 24 Apr 2024 16:42:35 -0700 Subject: [PATCH 03/41] noqa --- examples/mesoscope_ophys_rig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mesoscope_ophys_rig.py b/examples/mesoscope_ophys_rig.py index 378dbeb5f..c4a4b6eae 100644 --- a/examples/mesoscope_ophys_rig.py +++ b/examples/mesoscope_ophys_rig.py @@ -35,7 +35,7 @@ rig = Rig( - describedBy="https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/rig.py", + describedBy="https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/rig.py",# noqa schema_version="0.3.3", rig_id="MESO.2", modification_date=date(2024, 4, 2), From fa705161160681c3939566a899a97bd7bc7db8ac Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 24 Apr 2024 16:54:12 -0700 Subject: [PATCH 04/41] adding docstring: --- examples/mesoscope_ophys_rig.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/mesoscope_ophys_rig.py b/examples/mesoscope_ophys_rig.py index c4a4b6eae..982e64e12 100644 --- a/examples/mesoscope_ophys_rig.py +++ b/examples/mesoscope_ophys_rig.py @@ -1,3 +1,5 @@ +"""Generates an example rig JSON for a multiplane-ophys session""" + from datetime import date from decimal import Decimal From 12ec3d3058107c7cf6e493bc7b0c6a0f3667042b Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Mon, 10 Jun 2024 13:45:10 -0700 Subject: [PATCH 05/41] adding laser --- examples/multiplane_ophys_session.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/multiplane_ophys_session.py b/examples/multiplane_ophys_session.py index 4ecc71a43..9524224f1 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -2,7 +2,7 @@ from datetime import datetime, timezone -from aind_data_schema.core.session import FieldOfView, LaserConfig, Session, Stream +from aind_data_schema.core.session import FieldOfView, LaserConfig, Session, Stream, DetectorConfig from aind_data_schema.models.modalities import Modality from aind_data_schema.models.units import PowerUnit, SizeUnit @@ -34,7 +34,7 @@ ], light_sources=[ LaserConfig( - name="Laser A", + name="Chameleon laser", wavelength=920, wavelength_unit="nanometer", excitation_power=10, From 1df2ae197f57ba1631cbe47bc3ab913be798047a Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Mon, 10 Jun 2024 15:51:04 -0700 Subject: [PATCH 06/41] pulling from latest version and adding components: --- examples/mesoscope_ophys_rig.py | 73 +++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 8 deletions(-) diff --git a/examples/mesoscope_ophys_rig.py b/examples/mesoscope_ophys_rig.py index 982e64e12..db871030e 100644 --- a/examples/mesoscope_ophys_rig.py +++ b/examples/mesoscope_ophys_rig.py @@ -5,7 +5,7 @@ from aind_data_schema.core.rig import Rig, Monitor from aind_data_schema.core.instrument import DAQDevice -from aind_data_schema.models.organizations import ( +from aind_data_schema_models.organizations import ( AllenInstitute, Asus, Allied, @@ -14,8 +14,12 @@ InfinityPhotoOptical, EdmundOptics, NationalInstruments, + Hamamatsu, + Conoptics + LumenDynamics, + Chameleon ) -from aind_data_schema.models.devices import ( +from aind_data_schema.components.devices import ( Camera, CameraAssembly, Disc, @@ -24,15 +28,21 @@ Filter, Cooling, BinMode, + DetectorType, + Detector, + PockelsCell, + Laser, + DataInterface, + Lamp ) -from aind_data_schema.models.coordinates import ( +from aind_data_schema.components.coordinates import ( RelativePosition, Rotation3dTransform, Translation3dTransform, Axis, ) -from aind_data_schema.models.units import SizeUnit, FrequencyUnit -from aind_data_schema.models.registry import ResearchOrganizationRegistry +from aind_data_schema_models.units import SizeUnit, FrequencyUnit +from aind_data_schema_models.registry import ResearchOrganizationRegistry from aind_data_schema.base import AindGeneric @@ -72,6 +82,16 @@ parameters=AindGeneric(), ), ), + detectors=[ + Detector( + device_type="Detector", + detector_type=DetectorType.PMT, + name="PMT", + manufacturer=Hamamatsu( + name="Hamamatsu" + ) + ) + ], stimulus_devices=[ Monitor( device_type="Monitor", @@ -562,14 +582,51 @@ stick_microscopes=[], laser_assemblies=[], patch_cords=[], - light_sources=[], - detectors=[], + light_sources=[ + Laser( + device_type="Laser", + name=CHAMELEON, + wavelength=920, + wavelength_unit="nanometer", + excitation_power=10, + excitation_power_unit="milliwatt", + serial_number="GDP.100H.1332", + manufacturer="Chameleon" + ), + Lamp( + name="Epi lamp", + manufacturer="Lumen Dynamics (Excelitas Technologies)", + wavelength_max=600, + wavelength_min=350, + wavelength_unit=SizeUnit.NM + ) + ], + detectors=[ + Detector( + name="PMT", + manufacturer=Hamamatsu, + data_interface=DataInterface.PCIE + ) + ], objectives=[], filters=[], lenses=[], digital_micromirror_devices=[], polygonal_scanners=[], - pockels_cells=[], + pockels_cells=[ + PockelsCell( + name="Pockels Cell 1", + manufacturer=Conoptics, + model="530-80", + serial_number="354699BK" + ), + PockelsCell( + name="Pockels Cell 2", + manufacturer=Conoptics, + model="530-80", + serial_number="353414BK" + ) + ], additional_devices=[], daqs=[ DAQDevice( From 1bc0679223ff0ef0dce9c9e7697a6c6cb9565a7d Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Mon, 10 Jun 2024 16:15:39 -0700 Subject: [PATCH 07/41] renaming for consistency --- ...hys_rig.json => multiplane_ophys_rig.json} | 0 ...e_ophys_rig.py => multiplane_ophys_rig.py} | 106 ++++++++---------- 2 files changed, 48 insertions(+), 58 deletions(-) rename examples/{mesoscope_ophys_rig.json => multiplane_ophys_rig.json} (100%) rename examples/{mesoscope_ophys_rig.py => multiplane_ophys_rig.py} (94%) diff --git a/examples/mesoscope_ophys_rig.json b/examples/multiplane_ophys_rig.json similarity index 100% rename from examples/mesoscope_ophys_rig.json rename to examples/multiplane_ophys_rig.json diff --git a/examples/mesoscope_ophys_rig.py b/examples/multiplane_ophys_rig.py similarity index 94% rename from examples/mesoscope_ophys_rig.py rename to examples/multiplane_ophys_rig.py index db871030e..5c567d41a 100644 --- a/examples/mesoscope_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -3,52 +3,47 @@ from datetime import date from decimal import Decimal -from aind_data_schema.core.rig import Rig, Monitor -from aind_data_schema.core.instrument import DAQDevice from aind_data_schema_models.organizations import ( AllenInstitute, - Asus, Allied, - Thorlabs, - Semrock, - InfinityPhotoOptical, + Asus, + Chameleon, + Conoptics, EdmundOptics, - NationalInstruments, Hamamatsu, - Conoptics + InfinityPhotoOptical, LumenDynamics, - Chameleon + 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, - Disc, - Software, - Lens, - Filter, Cooling, - BinMode, - DetectorType, + DataInterface, Detector, - PockelsCell, + DetectorType, + Disc, + Filter, + Lamp, Laser, - DataInterface, - Lamp -) -from aind_data_schema.components.coordinates import ( - RelativePosition, - Rotation3dTransform, - Translation3dTransform, - Axis, + Lens, + PockelsCell, + Software, ) -from aind_data_schema_models.units import SizeUnit, FrequencyUnit -from aind_data_schema_models.registry import ResearchOrganizationRegistry -from aind_data_schema.base import AindGeneric - +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.3.3", + 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="MESO.2", modification_date=date(2024, 4, 2), mouse_platform=Disc( @@ -82,16 +77,6 @@ parameters=AindGeneric(), ), ), - detectors=[ - Detector( - device_type="Detector", - detector_type=DetectorType.PMT, - name="PMT", - manufacturer=Hamamatsu( - name="Hamamatsu" - ) - ) - ], stimulus_devices=[ Monitor( device_type="Monitor", @@ -179,7 +164,7 @@ data_interface="Ethernet", cooling=Cooling.NONE, computer_name="Video Monitor", - max_frame_rate=Decimal("60"), + frame_rate=Decimal("60"), frame_rate_unit=FrequencyUnit.HZ, immersion=None, chroma="Monochrome", @@ -319,7 +304,7 @@ data_interface="Ethernet", cooling=Cooling.NONE, computer_name="Video Monitor", - max_frame_rate=Decimal("60"), + frame_rate=Decimal("60"), frame_rate_unit=FrequencyUnit.HZ, immersion=None, chroma="Monochrome", @@ -457,7 +442,7 @@ data_interface="Ethernet", cooling=Cooling.NONE, computer_name="Video Monitor", - max_frame_rate=Decimal("60"), + frame_rate=Decimal("60"), frame_rate_unit=FrequencyUnit.HZ, immersion=None, chroma="Monochrome", @@ -585,27 +570,26 @@ light_sources=[ Laser( device_type="Laser", - name=CHAMELEON, + name="Laser", wavelength=920, - wavelength_unit="nanometer", - excitation_power=10, - excitation_power_unit="milliwatt", + wavelength_unit=SizeUnit.NM, serial_number="GDP.100H.1332", - manufacturer="Chameleon" + manufacturer=Chameleon(name="Chameleon"), ), Lamp( name="Epi lamp", - manufacturer="Lumen Dynamics (Excelitas Technologies)", wavelength_max=600, wavelength_min=350, - wavelength_unit=SizeUnit.NM - ) + wavelength_unit=SizeUnit.NM, + manufacturer=LumenDynamics(name="Lumen Dynamics"), + ), ], detectors=[ Detector( name="PMT", - manufacturer=Hamamatsu, - data_interface=DataInterface.PCIE + detector_type="Photomultiplier Tube", + manufacturer=Hamamatsu(name="Hamamatsu"), + data_interface=DataInterface.PCIE, ) ], objectives=[], @@ -616,16 +600,22 @@ pockels_cells=[ PockelsCell( name="Pockels Cell 1", - manufacturer=Conoptics, + polygonal_scanner="something", + on_time=12.0, + off_time=13.0, + manufacturer=Conoptics(name="Conoptics"), model="530-80", - serial_number="354699BK" + serial_number="354699BK", ), PockelsCell( name="Pockels Cell 2", - manufacturer=Conoptics, + manufacturer=Conoptics(name="Conoptics"), + polygonal_scanner="something", + on_time=12.0, + off_time=13.0, model="530-80", - serial_number="353414BK" - ) + serial_number="353414BK", + ), ], additional_devices=[], daqs=[ From 953cf27461570eb7abe2528ad300afa9bfad13c1 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Thu, 25 Jul 2024 10:27:05 -0700 Subject: [PATCH 08/41] update to rigid format --- examples/multiplane_ophys_session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/multiplane_ophys_session.py b/examples/multiplane_ophys_session.py index 03ff292b1..270881826 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -21,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=[ From f0414cc3c003ac32b888b15d90d7fe7dfe79f2ba Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Thu, 25 Jul 2024 11:11:26 -0700 Subject: [PATCH 09/41] adding modality --- examples/multiplane_ophys_rig.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py index 5c567d41a..fabdbcd9e 100644 --- a/examples/multiplane_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -7,7 +7,7 @@ AllenInstitute, Allied, Asus, - Chameleon, + CoherentScientific, Conoptics, EdmundOptics, Hamamatsu, @@ -29,10 +29,9 @@ Cooling, DataInterface, Detector, - DetectorType, Disc, Filter, - Lamp, + LightEmittingDiode, Laser, Lens, PockelsCell, @@ -44,8 +43,8 @@ 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="MESO.2", - modification_date=date(2024, 4, 2), + rig_id="429-mesoscope-2022321", + modification_date=date(2022, 3, 21), mouse_platform=Disc( device_type="Disc", name="MindScope Running Disk", @@ -574,9 +573,9 @@ wavelength=920, wavelength_unit=SizeUnit.NM, serial_number="GDP.100H.1332", - manufacturer=Chameleon(name="Chameleon"), + manufacturer=CoherentScientific(name="Coherent Scientific"), ), - Lamp( + LightEmittingDiode( name="Epi lamp", wavelength_max=600, wavelength_min=350, @@ -703,7 +702,7 @@ ), Axis(name="Y", direction="defined by the right hand rule and the other two axis"), ], - modalities=set(), + modalities=set("ophys"), notes=None, ) From 7eb6a1891af68917c8e000bbe2b4eafe747feda1 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Thu, 25 Jul 2024 11:16:05 -0700 Subject: [PATCH 10/41] noting absence of polygon scanner --- examples/multiplane_ophys_rig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py index fabdbcd9e..511bea707 100644 --- a/examples/multiplane_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -599,7 +599,7 @@ pockels_cells=[ PockelsCell( name="Pockels Cell 1", - polygonal_scanner="something", + polygonal_scanner="no polygon scanner", on_time=12.0, off_time=13.0, manufacturer=Conoptics(name="Conoptics"), @@ -609,7 +609,7 @@ PockelsCell( name="Pockels Cell 2", manufacturer=Conoptics(name="Conoptics"), - polygonal_scanner="something", + polygonal_scanner="no polygon scanner", on_time=12.0, off_time=13.0, model="530-80", From 1bfd91ee6446650fb8a216c2e1d5bd10b7295aeb Mon Sep 17 00:00:00 2001 From: Jerome Lecoq Date: Wed, 16 Oct 2024 18:31:32 -0700 Subject: [PATCH 11/41] obj pmt laser pockels for Meso.1 --- examples/multiplane_ophys_rig.json | 145 ++++++++++++++++++++++++++--- examples/multiplane_ophys_rig.py | 57 ++++++------ 2 files changed, 164 insertions(+), 38 deletions(-) diff --git a/examples/multiplane_ophys_rig.json b/examples/multiplane_ophys_rig.json index 6728bf25c..44be43e24 100644 --- a/examples/multiplane_ophys_rig.json +++ b/examples/multiplane_ophys_rig.json @@ -1,8 +1,8 @@ { "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", + "schema_version": "0.5.3", + "rig_id": "429-mesoscope-2022321", + "modification_date": "2024-10-16", "mouse_platform": { "device_type": "Disc", "name": "MindScope Running Disk", @@ -129,7 +129,7 @@ "data_interface": "Ethernet", "cooling": "None", "computer_name": "Video Monitor", - "max_frame_rate": "60", + "frame_rate": "60", "frame_rate_unit": "hertz", "immersion": null, "chroma": "Monochrome", @@ -276,7 +276,7 @@ "data_interface": "Ethernet", "cooling": "None", "computer_name": "Video Monitor", - "max_frame_rate": "60", + "frame_rate": "60", "frame_rate_unit": "hertz", "immersion": null, "chroma": "Monochrome", @@ -420,7 +420,7 @@ "data_interface": "Ethernet", "cooling": "None", "computer_name": "Video Monitor", - "max_frame_rate": "60", + "frame_rate": "60", "frame_rate_unit": "hertz", "immersion": null, "chroma": "Monochrome", @@ -552,14 +552,132 @@ "stick_microscopes": [], "laser_assemblies": [], "patch_cords": [], - "light_sources": [], - "detectors": [], - "objectives": [], + "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_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": [], + "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": "no polygon scanner", + "on_time": "12.0", + "off_time": "13.0", + "time_setting_unit": "fraction of cycle" + } + ], "additional_devices": [], "daqs": [ { @@ -652,6 +770,11 @@ "direction": "defined by the right hand rule and the other two axis" } ], - "modalities": [], + "modalities": [ + { + "name": "Planar optical physiology", + "abbreviation": "ophys" + } + ], "notes": null } \ No newline at end of file diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py index 511bea707..14991c0a0 100644 --- a/examples/multiplane_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -12,7 +12,6 @@ EdmundOptics, Hamamatsu, InfinityPhotoOptical, - LumenDynamics, NationalInstruments, Semrock, Thorlabs, @@ -39,12 +38,13 @@ ) from aind_data_schema.core.instrument import DAQDevice from aind_data_schema.core.rig import Monitor, Rig +from aind_data_schema.core.instrument import Objective 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), + modification_date=date(2024, 10, 16), mouse_platform=Disc( device_type="Disc", name="MindScope Running Disk", @@ -569,29 +569,39 @@ light_sources=[ Laser( device_type="Laser", - name="Laser", + name="Axon 920-2 TPC", wavelength=920, wavelength_unit=SizeUnit.NM, - serial_number="GDP.100H.1332", + serial_number="GDP.1007S.3490", 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", + name="H11706-40", detector_type="Photomultiplier Tube", manufacturer=Hamamatsu(name="Hamamatsu"), data_interface=DataInterface.PCIE, ) ], - objectives=[], + objectives=[ + Objective( + name="Mesoscope JenOptik Objective", + numerical_aperture=0.8, + magnification=3.6, + manufacturer=Thorlabs( + name="Thorlabs", + abbreviation=None, + registry=ResearchOrganizationRegistry( + name="Research Organization Registry", abbreviation="ROR" + ), + registry_identifier="04gsnvb07", + ), + immersion="water", + notes="Part from JenOptik: 14163000", + serial_number="110", + ) + ], filters=[], lenses=[], digital_micromirror_devices=[], @@ -603,18 +613,9 @@ 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", - ), + model="350-80", + serial_number="354683BK", + ) ], additional_devices=[], daqs=[ @@ -702,10 +703,12 @@ ), Axis(name="Y", direction="defined by the right hand rule and the other two axis"), ], - modalities=set("ophys"), + modalities=[ + {"name": "Planar optical physiology"} + ], notes=None, ) serialized = rig.model_dump_json() deserialized = Rig.model_validate_json(serialized) -deserialized.write_standard_file(prefix="mesoscope_ophys") +deserialized.write_standard_file(prefix="multiplane_ophys") From cf892fa4b3f475cbf887148ce04ec3e24132e6ec Mon Sep 17 00:00:00 2001 From: Jerome Lecoq Date: Thu, 17 Oct 2024 10:29:28 -0700 Subject: [PATCH 12/41] Linting --- examples/multiplane_ophys_rig.py | 3 +- examples/multiplane_ophys_session.py | 3 -- status | 49 ++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 status diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py index 14991c0a0..93a4e7b4a 100644 --- a/examples/multiplane_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -30,7 +30,6 @@ Detector, Disc, Filter, - LightEmittingDiode, Laser, Lens, PockelsCell, @@ -598,7 +597,7 @@ registry_identifier="04gsnvb07", ), immersion="water", - notes="Part from JenOptik: 14163000", + notes="Part from JenOptik: 14163000", serial_number="110", ) ], diff --git a/examples/multiplane_ophys_session.py b/examples/multiplane_ophys_session.py index 270881826..147b21591 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -5,9 +5,6 @@ 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 diff --git a/status b/status new file mode 100644 index 000000000..41b74b3ef --- /dev/null +++ b/status @@ -0,0 +1,49 @@ +COMMAND_MODE=unix2003 +HOME=/Users/jerome.lecoq +LOGNAME=jerome.lecoq +MallocNanoZone=0 +ORIGINAL_XDG_CURRENT_DESKTOP=undefined +PATH=/Users/jerome.lecoq/.docker/bin:/Users/jerome.lecoq/opt/miniconda3/envs/aind-metadata/bin:/Users/jerome.lecoq/opt/miniconda3/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin +SHELL=/bin/zsh +SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.D4G3tDCvrF/Listeners +TMPDIR=/var/folders/j7/xydwnhrs6v9848qxgh69ygmw0000gp/T/ +USER=jerome.lecoq +XPC_FLAGS=0x0 +XPC_SERVICE_NAME=0 +__CFBundleIdentifier=com.microsoft.VSCode +__CF_USER_TEXT_ENCODING=0x1F6:0x0:0x0 +TERM_PROGRAM=vscode +TERM_PROGRAM_VERSION=1.94.2 +LANG=en_US.UTF-8 +COLORTERM=truecolor +GIT_ASKPASS=/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass.sh +VSCODE_GIT_ASKPASS_NODE=/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) +VSCODE_GIT_ASKPASS_EXTRA_ARGS= +VSCODE_GIT_ASKPASS_MAIN=/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass-main.js +VSCODE_GIT_IPC_HANDLE=/var/folders/j7/xydwnhrs6v9848qxgh69ygmw0000gp/T/vscode-git-07f21e107e.sock +VSCODE_INJECTION=1 +ZDOTDIR=/Users/jerome.lecoq +USER_ZDOTDIR=/Users/jerome.lecoq +PWD=/Users/jerome.lecoq/Documents/Work documents/Allen Institute/Projects/2P_pipeline/public_repo/metadata/aind-data-schema +TERM=xterm-256color +SHLVL=1 +OLDPWD=/Users/jerome.lecoq/Documents/Work documents/Allen Institute/Projects/2P_pipeline/public_repo/metadata/aind-data-schema +HOMEBREW_PREFIX=/opt/homebrew +HOMEBREW_CELLAR=/opt/homebrew/Cellar +HOMEBREW_REPOSITORY=/opt/homebrew +MANPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/share/man:/Library/Developer/CommandLineTools/usr/share/man:/Library/Developer/CommandLineTools/Toolchains/XcodeDefault.xctoolchain/usr/share/man:/opt/homebrew/share/man:: +INFOPATH=/opt/homebrew/share/info: +JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.0.5.jdk/Contents/Home +CONDA_EXE=/Users/jerome.lecoq/opt/miniconda3/bin/conda +_CE_M= +_CE_CONDA= +CONDA_PYTHON_EXE=/Users/jerome.lecoq/opt/miniconda3/bin/python +CONDA_SHLVL=2 +CONDA_PREFIX=/Users/jerome.lecoq/opt/miniconda3/envs/aind-metadata +CONDA_DEFAULT_ENV=aind-metadata +CONDA_PROMPT_MODIFIER=(aind-metadata) +CONDA_PREFIX_1=/Users/jerome.lecoq/opt/miniconda3 +_=/usr/bin/python3 +SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk +CPATH=/usr/local/include +LIBRARY_PATH=/usr/local/lib From d4326ce69884cd1681c824947ef6d70cada65b09 Mon Sep 17 00:00:00 2001 From: Jerome Lecoq Date: Thu, 17 Oct 2024 10:31:00 -0700 Subject: [PATCH 13/41] Linting --- examples/multiplane_ophys_session.py | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/multiplane_ophys_session.py b/examples/multiplane_ophys_session.py index 147b21591..cf35b9193 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -5,7 +5,6 @@ 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.core.session import FieldOfView, LaserConfig, Session, Stream # If a timezone isn't specified, the timezone of the computer running this # script will be used as default From 9ceb6af10f1f0a8865023eb225669883ff6c374e Mon Sep 17 00:00:00 2001 From: Jerome Lecoq Date: Thu, 17 Oct 2024 10:35:26 -0700 Subject: [PATCH 14/41] Move packages --- examples/multiplane_ophys_session.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/multiplane_ophys_session.py b/examples/multiplane_ophys_session.py index cf35b9193..6c5411012 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -3,8 +3,8 @@ from datetime import datetime, timezone 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.modalities import Modality # If a timezone isn't specified, the timezone of the computer running this # script will be used as default From 8b2bef459d2a4d24185fb00a1a3998bc640058e1 Mon Sep 17 00:00:00 2001 From: Jerome Lecoq Date: Thu, 17 Oct 2024 10:54:06 -0700 Subject: [PATCH 15/41] moving to all caps org --- examples/multiplane_ophys_rig.py | 58 ++++++++++++++++---------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py index 93a4e7b4a..a9a4ac879 100644 --- a/examples/multiplane_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -4,17 +4,17 @@ from decimal import Decimal from aind_data_schema_models.organizations import ( - AllenInstitute, - Allied, - Asus, - CoherentScientific, - Conoptics, - EdmundOptics, - Hamamatsu, - InfinityPhotoOptical, - NationalInstruments, - Semrock, - Thorlabs, + AIND, + ALLIED, + ASUS, + COHERENT_SCIENTIFIC, + CONOPTICS, + EDMUMD_OPTICS, + HAMAMATSU, + INFINITY_PHOTO_OPTICAL, + NATIONAL_INSTRUMENTS, + SEMROCK, + THORLABS ) from aind_data_schema_models.registry import ResearchOrganizationRegistry from aind_data_schema_models.units import FrequencyUnit, SizeUnit @@ -48,7 +48,7 @@ device_type="Disc", name="MindScope Running Disk", serial_number=None, - manufacturer=AllenInstitute( + manufacturer=AIND( name="Allen Institute", abbreviation="AI", registry=ResearchOrganizationRegistry( @@ -80,7 +80,7 @@ device_type="Monitor", name="Stimulus Screen", serial_number=None, - manufacturer=Asus( + manufacturer=ASUS( name="ASUS", abbreviation=None, registry=ResearchOrganizationRegistry( @@ -147,7 +147,7 @@ device_type="Detector", name="Behavior Camera", serial_number=None, - manufacturer=Allied( + manufacturer=ALLIED( name="Allied", abbreviation=None, registry=None, @@ -193,7 +193,7 @@ device_type="Lens", name="Behavior Camera Lens", serial_number=None, - manufacturer=Thorlabs( + manufacturer=THORLABS( name="Thorlabs", abbreviation=None, registry=ResearchOrganizationRegistry( @@ -218,7 +218,7 @@ device_type="Filter", name="Behavior Camera Filter", serial_number=None, - manufacturer=Semrock( + manufacturer=SEMROCK( name="Semrock", abbreviation=None, registry=None, @@ -287,7 +287,7 @@ device_type="Detector", name="Eye Camera", serial_number=None, - manufacturer=Allied( + manufacturer=ALLIED( name="Allied", abbreviation=None, registry=None, @@ -333,7 +333,7 @@ device_type="Lens", name="Eye Camera Lens", serial_number=None, - manufacturer=InfinityPhotoOptical( + manufacturer=INFINITY_PHOTO_OPTICAL( name="Infinity Photo-Optical", abbreviation=None, registry=None, @@ -356,7 +356,7 @@ device_type="Filter", name="Eye Camera Filter", serial_number=None, - manufacturer=Semrock( + manufacturer=SEMROCK( name="Semrock", abbreviation=None, registry=None, @@ -425,7 +425,7 @@ device_type="Detector", name="Face Camera", serial_number=None, - manufacturer=Allied( + manufacturer=ALLIED( name="Allied", abbreviation=None, registry=None, @@ -471,7 +471,7 @@ device_type="Lens", name="Face Camera Lens", serial_number=None, - manufacturer=EdmundOptics( + manufacturer=EDMUMD_OPTICS( name="Edmund Optics", abbreviation=None, registry=ResearchOrganizationRegistry( @@ -496,7 +496,7 @@ device_type="Filter", name="Face Camera Filter", serial_number=None, - manufacturer=Semrock( + manufacturer=SEMROCK( name="Semrock", abbreviation=None, registry=None, @@ -572,14 +572,14 @@ wavelength=920, wavelength_unit=SizeUnit.NM, serial_number="GDP.1007S.3490", - manufacturer=CoherentScientific(name="Coherent Scientific"), + manufacturer=COHERENT_SCIENTIFIC(name="Coherent Scientific"), ), ], detectors=[ Detector( name="H11706-40", detector_type="Photomultiplier Tube", - manufacturer=Hamamatsu(name="Hamamatsu"), + manufacturer=HAMAMATSU(name="Hamamatsu"), data_interface=DataInterface.PCIE, ) ], @@ -588,7 +588,7 @@ name="Mesoscope JenOptik Objective", numerical_aperture=0.8, magnification=3.6, - manufacturer=Thorlabs( + manufacturer=THORLABS( name="Thorlabs", abbreviation=None, registry=ResearchOrganizationRegistry( @@ -611,7 +611,7 @@ polygonal_scanner="no polygon scanner", on_time=12.0, off_time=13.0, - manufacturer=Conoptics(name="Conoptics"), + manufacturer=CONOPTICS(name="Conoptics"), model="350-80", serial_number="354683BK", ) @@ -622,7 +622,7 @@ device_type="DAQ Device", name="VBEB DAQ", serial_number=None, - manufacturer=NationalInstruments( + manufacturer=NATIONAL_INSTRUMENTS( name="National Instruments", abbreviation=None, registry=ResearchOrganizationRegistry( @@ -645,7 +645,7 @@ device_type="DAQ Device", name="SYNC DAQ", serial_number=None, - manufacturer=NationalInstruments( + manufacturer=NATIONAL_INSTRUMENTS( name="National Instruments", abbreviation=None, registry=ResearchOrganizationRegistry( @@ -668,7 +668,7 @@ device_type="DAQ Device", name="STIM DAQ", serial_number=None, - manufacturer=NationalInstruments( + manufacturer=NATIONAL_INSTRUMENTS( name="National Instruments", abbreviation=None, registry=ResearchOrganizationRegistry( From cbeb1dd1e511aa831b72c0a108d51504894ae51d Mon Sep 17 00:00:00 2001 From: Jerome Lecoq Date: Thu, 17 Oct 2024 13:49:05 -0700 Subject: [PATCH 16/41] up schema version --- examples/multiplane_ophys_rig.py | 151 +++++-------------------------- 1 file changed, 23 insertions(+), 128 deletions(-) diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py index a9a4ac879..26b32e1c1 100644 --- a/examples/multiplane_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -3,21 +3,9 @@ from datetime import date from decimal import Decimal -from aind_data_schema_models.organizations import ( - AIND, - ALLIED, - ASUS, - COHERENT_SCIENTIFIC, - CONOPTICS, - EDMUMD_OPTICS, - HAMAMATSU, - INFINITY_PHOTO_OPTICAL, - NATIONAL_INSTRUMENTS, - SEMROCK, - THORLABS -) -from aind_data_schema_models.registry import ResearchOrganizationRegistry +from aind_data_schema_models.organizations import Organization from aind_data_schema_models.units import FrequencyUnit, SizeUnit +from aind_data_schema_models.modalities import Modality from aind_data_schema.base import AindGeneric from aind_data_schema.components.coordinates import Axis, RelativePosition, Rotation3dTransform, Translation3dTransform @@ -41,21 +29,14 @@ 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", + 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 Disk", serial_number=None, - manufacturer=AIND( - name="Allen Institute", - abbreviation="AI", - registry=ResearchOrganizationRegistry( - name="Research Organization Registry", abbreviation="ROR" - ), - registry_identifier="03cpe7c52", - ), + manufacturer=Organization.AIND, model=None, path_to_cad=None, port_index=None, @@ -80,14 +61,7 @@ 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", - ), + manufacturer=Organization.ASUS, model="PA248Q", path_to_cad=None, port_index=None, @@ -147,12 +121,7 @@ device_type="Detector", name="Behavior Camera", serial_number=None, - manufacturer=ALLIED( - name="Allied", - abbreviation=None, - registry=None, - registry_identifier=None, - ), + manufacturer=Organization.ALLIED, model="Mako G-32B", path_to_cad=None, port_index=None, @@ -193,14 +162,7 @@ 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", - ), + manufacturer=Organization.THORLABS, model="MVL6WA", path_to_cad=None, port_index=None, @@ -218,12 +180,7 @@ device_type="Filter", name="Behavior Camera Filter", serial_number=None, - manufacturer=SEMROCK( - name="Semrock", - abbreviation=None, - registry=None, - registry_identifier=None, - ), + manufacturer=Organization.SEMROCK, model="FF01-747/33-25", path_to_cad=None, port_index=None, @@ -287,12 +244,7 @@ device_type="Detector", name="Eye Camera", serial_number=None, - manufacturer=ALLIED( - name="Allied", - abbreviation=None, - registry=None, - registry_identifier=None, - ), + manufacturer=Organization.ALLIED, model="Mako G-32B", path_to_cad=None, port_index=None, @@ -333,12 +285,7 @@ device_type="Lens", name="Eye Camera Lens", serial_number=None, - manufacturer=INFINITY_PHOTO_OPTICAL( - name="Infinity Photo-Optical", - abbreviation=None, - registry=None, - registry_identifier=None, - ), + manufacturer=Organization.INFINITY_PHOTO_OPTICAL, model="213073", path_to_cad=None, port_index=None, @@ -356,12 +303,7 @@ device_type="Filter", name="Eye Camera Filter", serial_number=None, - manufacturer=SEMROCK( - name="Semrock", - abbreviation=None, - registry=None, - registry_identifier=None, - ), + manufacturer=Organization.SEMROCK, model="FF01-850/10-25", path_to_cad=None, port_index=None, @@ -425,12 +367,7 @@ device_type="Detector", name="Face Camera", serial_number=None, - manufacturer=ALLIED( - name="Allied", - abbreviation=None, - registry=None, - registry_identifier=None, - ), + manufacturer=Organization.ALLIED, model="Mako G-32B", path_to_cad=None, port_index=None, @@ -471,14 +408,7 @@ device_type="Lens", name="Face Camera Lens", serial_number=None, - manufacturer=EDMUMD_OPTICS( - name="Edmund Optics", - abbreviation=None, - registry=ResearchOrganizationRegistry( - name="Research Organization Registry", abbreviation="ROR" - ), - registry_identifier="01j1gwp17", - ), + manufacturer=Organization.EDMUND_OPTICS, model="86-604", path_to_cad=None, port_index=None, @@ -496,12 +426,7 @@ device_type="Filter", name="Face Camera Filter", serial_number=None, - manufacturer=SEMROCK( - name="Semrock", - abbreviation=None, - registry=None, - registry_identifier=None, - ), + manufacturer=Organization.SEMROCK, model="FF01-715/LP-25", path_to_cad=None, port_index=None, @@ -572,14 +497,14 @@ wavelength=920, wavelength_unit=SizeUnit.NM, serial_number="GDP.1007S.3490", - manufacturer=COHERENT_SCIENTIFIC(name="Coherent Scientific"), + manufacturer=Organization.COHERENT_SCIENTIFIC, ), ], detectors=[ Detector( name="H11706-40", detector_type="Photomultiplier Tube", - manufacturer=HAMAMATSU(name="Hamamatsu"), + manufacturer=Organization.HAMAMATSU, data_interface=DataInterface.PCIE, ) ], @@ -588,14 +513,7 @@ name="Mesoscope JenOptik Objective", numerical_aperture=0.8, magnification=3.6, - manufacturer=THORLABS( - name="Thorlabs", - abbreviation=None, - registry=ResearchOrganizationRegistry( - name="Research Organization Registry", abbreviation="ROR" - ), - registry_identifier="04gsnvb07", - ), + manufacturer=Organization.THORLABS, immersion="water", notes="Part from JenOptik: 14163000", serial_number="110", @@ -611,7 +529,7 @@ polygonal_scanner="no polygon scanner", on_time=12.0, off_time=13.0, - manufacturer=CONOPTICS(name="Conoptics"), + manufacturer=Organization.CONOPTICS, model="350-80", serial_number="354683BK", ) @@ -622,14 +540,7 @@ device_type="DAQ Device", name="VBEB DAQ", serial_number=None, - manufacturer=NATIONAL_INSTRUMENTS( - name="National Instruments", - abbreviation=None, - registry=ResearchOrganizationRegistry( - name="Research Organization Registry", abbreviation="ROR" - ), - registry_identifier="026exqw73", - ), + manufacturer=Organization.NATIONAL_INSTRUMENTS, model="USB-6001", path_to_cad=None, port_index=None, @@ -645,14 +556,7 @@ device_type="DAQ Device", name="SYNC DAQ", serial_number=None, - manufacturer=NATIONAL_INSTRUMENTS( - name="National Instruments", - abbreviation=None, - registry=ResearchOrganizationRegistry( - name="Research Organization Registry", abbreviation="ROR" - ), - registry_identifier="026exqw73", - ), + manufacturer=Organization.NATIONAL_INSTRUMENTS, model="PCIe-6612", path_to_cad=None, port_index=None, @@ -668,14 +572,7 @@ device_type="DAQ Device", name="STIM DAQ", serial_number=None, - manufacturer=NATIONAL_INSTRUMENTS( - name="National Instruments", - abbreviation=None, - registry=ResearchOrganizationRegistry( - name="Research Organization Registry", abbreviation="ROR" - ), - registry_identifier="026exqw73", - ), + manufacturer=Organization.NATIONAL_INSTRUMENTS, model="PCIe-6321", path_to_cad=None, port_index=None, @@ -702,9 +599,7 @@ ), Axis(name="Y", direction="defined by the right hand rule and the other two axis"), ], - modalities=[ - {"name": "Planar optical physiology"} - ], + modalities=[Modality.POPHYS], notes=None, ) From 6577972887c95e2de26d6f0c419e011eb8a05001 Mon Sep 17 00:00:00 2001 From: Jerome Lecoq Date: Thu, 17 Oct 2024 14:09:30 -0700 Subject: [PATCH 17/41] Fix schema rig --- examples/multiplane_ophys_session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/multiplane_ophys_session.py b/examples/multiplane_ophys_session.py index 6c5411012..7e567a201 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -17,7 +17,7 @@ subject_id="12345", session_type="Mesoscope", iacuc_protocol="12345", - rig_id="429-mesoscope-2022321", + rig_id="429_mesoscope_20220321", mouse_platform_name="disc", active_mouse_platform=True, data_streams=[ From eed5977415ef93798c24b1be06e89092d9ca6f3d Mon Sep 17 00:00:00 2001 From: Jerome Lecoq Date: Thu, 17 Oct 2024 14:20:45 -0700 Subject: [PATCH 18/41] Fx json examples --- examples/multiplane_ophys_rig.json | 24 +++++++++++++++++------- examples/multiplane_ophys_session.json | 12 ++++++------ examples/multiplane_ophys_session.py | 2 +- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/examples/multiplane_ophys_rig.json b/examples/multiplane_ophys_rig.json index 44be43e24..23109b0dd 100644 --- a/examples/multiplane_ophys_rig.json +++ b/examples/multiplane_ophys_rig.json @@ -1,20 +1,20 @@ { "describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/rig.py", - "schema_version": "0.5.3", - "rig_id": "429-mesoscope-2022321", + "schema_version": "1.0.1", + "rig_id": "429_mesoscope_20220321", "modification_date": "2024-10-16", "mouse_platform": { "device_type": "Disc", "name": "MindScope Running Disk", "serial_number": null, "manufacturer": { - "name": "Allen Institute", - "abbreviation": "AI", + "name": "Allen Institute for Neural Dynamics", + "abbreviation": "AIND", "registry": { "name": "Research Organization Registry", "abbreviation": "ROR" }, - "registry_identifier": "03cpe7c52" + "registry_identifier": "04szwah67" }, "model": null, "path_to_cad": null, @@ -144,6 +144,8 @@ "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", @@ -291,6 +293,8 @@ "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", @@ -435,6 +439,8 @@ "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", @@ -619,6 +625,8 @@ "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", @@ -675,7 +683,9 @@ "polygonal_scanner": "no polygon scanner", "on_time": "12.0", "off_time": "13.0", - "time_setting_unit": "fraction of cycle" + "time_setting_unit": "fraction of cycle", + "beam_modulation": null, + "beam_modulation_unit": "Volts" } ], "additional_devices": [], @@ -773,7 +783,7 @@ "modalities": [ { "name": "Planar optical physiology", - "abbreviation": "ophys" + "abbreviation": "pophys" } ], "notes": null diff --git a/examples/multiplane_ophys_session.json b/examples/multiplane_ophys_session.json index e18ea8031..524abf685 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.1", "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", @@ -32,7 +32,7 @@ "light_sources": [ { "device_type": "Laser", - "name": "Laser A", + "name": "Axon 920-2 TPC", "wavelength": 920, "wavelength_unit": "nanometer", "excitation_power": "10", @@ -255,13 +255,13 @@ "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", @@ -282,6 +282,6 @@ "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 7e567a201..c20e6074f 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -34,7 +34,7 @@ ], light_sources=[ LaserConfig( - name="Chameleon laser", + name="Axon 920-2 TPC", wavelength=920, wavelength_unit="nanometer", excitation_power=10, From 8363720c1a146999bcfb5d7f1f20da042aff496e Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 4 Dec 2024 15:59:13 -0800 Subject: [PATCH 19/41] Correct gains listed for behavior cameras.: --- examples/multiplane_ophys_rig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py index 26b32e1c1..4895ab21a 100644 --- a/examples/multiplane_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -268,7 +268,7 @@ bin_width=None, bin_height=None, bin_unit=SizeUnit.PX, - gain=Decimal("4"), + gain=Decimal("22"), crop_width=None, crop_height=None, crop_unit=SizeUnit.PX, @@ -391,7 +391,7 @@ bin_width=None, bin_height=None, bin_unit=SizeUnit.PX, - gain=Decimal("4"), + gain=Decimal("13"), crop_width=None, crop_height=None, crop_unit=SizeUnit.PX, From d1371f97b93baf4b1f6ed3617d58c4cc11d7f08f Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 4 Dec 2024 16:01:16 -0800 Subject: [PATCH 20/41] Correct spelling for disc. --- examples/multiplane_ophys_rig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py index 4895ab21a..91239e5db 100644 --- a/examples/multiplane_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -34,7 +34,7 @@ modification_date=date(2024, 10, 16), mouse_platform=Disc( device_type="Disc", - name="MindScope Running Disk", + name="MindScope Running Disc", serial_number=None, manufacturer=Organization.AIND, model=None, From 7f8e7c74071a1097babdf82e9886b84e1ba5665c Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 4 Dec 2024 16:02:31 -0800 Subject: [PATCH 21/41] Attempt to leave polygonal scanner as an empty str. --- examples/multiplane_ophys_rig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py index 91239e5db..dbe24e3a6 100644 --- a/examples/multiplane_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -526,7 +526,7 @@ pockels_cells=[ PockelsCell( name="Pockels Cell 1", - polygonal_scanner="no polygon scanner", + polygonal_scanner="", on_time=12.0, off_time=13.0, manufacturer=Organization.CONOPTICS, From c3f948f325971c4ae4d16d2c0ec5e31611dd35a6 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 4 Dec 2024 16:09:16 -0800 Subject: [PATCH 22/41] Fix mouse_platform_name in session. --- examples/multiplane_ophys_session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/multiplane_ophys_session.py b/examples/multiplane_ophys_session.py index c20e6074f..f868732f9 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -18,7 +18,7 @@ session_type="Mesoscope", iacuc_protocol="12345", rig_id="429_mesoscope_20220321", - mouse_platform_name="disc", + mouse_platform_name="MindScope Running Disc", active_mouse_platform=True, data_streams=[ Stream( From 798f738f770a36e17863bd717f211ffe2475c4c4 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 4 Dec 2024 16:12:57 -0800 Subject: [PATCH 23/41] Camera names of data streams should match the camera names in from the rig.json. --- examples/multiplane_ophys_session.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/multiplane_ophys_session.py b/examples/multiplane_ophys_session.py index f868732f9..2ae8492f8 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -26,11 +26,9 @@ stream_end_time=t, stream_modalities=[Modality.POPHYS, Modality.BEHAVIOR_VIDEOS, Modality.CONFOCAL], camera_names=[ - "Mesoscope", - "Eye", - "Face", - "Behavior", - "Vasculature", + "Behavior Camera", + "Eye Camera", + "Face Camera", ], light_sources=[ LaserConfig( From fba878868d67f6fc5a5a167677c17927cae45068 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 4 Dec 2024 18:45:18 -0800 Subject: [PATCH 24/41] Add NIDaqs to data streams. --- examples/multiplane_ophys_session.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/multiplane_ophys_session.py b/examples/multiplane_ophys_session.py index 2ae8492f8..59f17049c 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -25,6 +25,12 @@ stream_start_time=t, stream_end_time=t, stream_modalities=[Modality.POPHYS, Modality.BEHAVIOR_VIDEOS, Modality.CONFOCAL], + daq_names = [ + "NI PCIe-6612", + "NI PCIe-6321", + "NI USB-6001", + "NI OEM-6001" + ], camera_names=[ "Behavior Camera", "Eye Camera", From 892a6d51564a38ee0e3f9232beaa6a9e23363568 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 4 Dec 2024 18:45:55 -0800 Subject: [PATCH 25/41] Lint. --- examples/multiplane_ophys_session.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/multiplane_ophys_session.py b/examples/multiplane_ophys_session.py index 59f17049c..223ace8fa 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -24,13 +24,12 @@ Stream( stream_start_time=t, stream_end_time=t, - stream_modalities=[Modality.POPHYS, Modality.BEHAVIOR_VIDEOS, Modality.CONFOCAL], - daq_names = [ - "NI PCIe-6612", - "NI PCIe-6321", - "NI USB-6001", - "NI OEM-6001" + stream_modalities=[ + Modality.POPHYS, + Modality.BEHAVIOR_VIDEOS, + Modality.CONFOCAL, ], + daq_names=["NI PCIe-6612", "NI PCIe-6321", "NI USB-6001", "NI OEM-6001"], camera_names=[ "Behavior Camera", "Eye Camera", From 5fd07f611bb8fe5e9b9faa90b84e4a029fe822a4 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 4 Dec 2024 18:46:21 -0800 Subject: [PATCH 26/41] Lint. --- examples/multiplane_ophys_rig.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py index dbe24e3a6..29bbcd95d 100644 --- a/examples/multiplane_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -8,7 +8,12 @@ from aind_data_schema_models.modalities import Modality from aind_data_schema.base import AindGeneric -from aind_data_schema.components.coordinates import Axis, RelativePosition, Rotation3dTransform, Translation3dTransform +from aind_data_schema.components.coordinates import ( + Axis, + RelativePosition, + Rotation3dTransform, + Translation3dTransform, +) from aind_data_schema.components.devices import ( BinMode, Camera, From fdb83baf58a4450c0921653a40a6a13596243083 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 4 Dec 2024 18:47:00 -0800 Subject: [PATCH 27/41] Sort imports. --- examples/multiplane_ophys_rig.py | 12 +++--------- examples/multiplane_ophys_session.py | 5 +++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py index 29bbcd95d..9be1206d4 100644 --- a/examples/multiplane_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -3,17 +3,12 @@ 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_models.modalities import Modality from aind_data_schema.base import AindGeneric -from aind_data_schema.components.coordinates import ( - Axis, - RelativePosition, - Rotation3dTransform, - Translation3dTransform, -) +from aind_data_schema.components.coordinates import Axis, RelativePosition, Rotation3dTransform, Translation3dTransform from aind_data_schema.components.devices import ( BinMode, Camera, @@ -28,9 +23,8 @@ PockelsCell, Software, ) -from aind_data_schema.core.instrument import DAQDevice +from aind_data_schema.core.instrument import DAQDevice, Objective from aind_data_schema.core.rig import Monitor, Rig -from aind_data_schema.core.instrument import Objective rig = Rig( describedBy="https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/rig.py", # noqa diff --git a/examples/multiplane_ophys_session.py b/examples/multiplane_ophys_session.py index 223ace8fa..48e01c535 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -2,9 +2,10 @@ from datetime import datetime, timezone -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.core.session import FieldOfView, LaserConfig, Session, Stream # If a timezone isn't specified, the timezone of the computer running this # script will be used as default From eb6c33f34dbf31dc07102d8af393cfb7164d4471 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 4 Dec 2024 18:47:55 -0800 Subject: [PATCH 28/41] Fix rig_id name formatting. --- examples/multiplane_ophys_session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/multiplane_ophys_session.py b/examples/multiplane_ophys_session.py index 48e01c535..7daad6211 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -18,7 +18,7 @@ subject_id="12345", session_type="Mesoscope", iacuc_protocol="12345", - rig_id="429_mesoscope_20220321", + rig_id="429-mesoscope-20220321", mouse_platform_name="MindScope Running Disc", active_mouse_platform=True, data_streams=[ From a3fdcf090a2513e29c9ee12360c0f42a31430014 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 4 Dec 2024 18:51:27 -0800 Subject: [PATCH 29/41] Generate multiplane rig.json --- examples/multiplane_ophys_rig.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/multiplane_ophys_rig.json b/examples/multiplane_ophys_rig.json index 23109b0dd..1feb85dbd 100644 --- a/examples/multiplane_ophys_rig.json +++ b/examples/multiplane_ophys_rig.json @@ -5,7 +5,7 @@ "modification_date": "2024-10-16", "mouse_platform": { "device_type": "Disc", - "name": "MindScope Running Disk", + "name": "MindScope Running Disc", "serial_number": null, "manufacturer": { "name": "Allen Institute for Neural Dynamics", @@ -292,7 +292,7 @@ "bin_width": null, "bin_height": null, "bin_unit": "pixel", - "gain": "4", + "gain": "22", "crop_offset_x": null, "crop_offset_y": null, "crop_width": null, @@ -438,7 +438,7 @@ "bin_width": null, "bin_height": null, "bin_unit": "pixel", - "gain": "4", + "gain": "13", "crop_offset_x": null, "crop_offset_y": null, "crop_width": null, @@ -680,7 +680,7 @@ "port_index": null, "additional_settings": {}, "notes": null, - "polygonal_scanner": "no polygon scanner", + "polygonal_scanner": "", "on_time": "12.0", "off_time": "13.0", "time_setting_unit": "fraction of cycle", From 3e83d0df216949844669ecc8f3030c81e2c0e821 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 4 Dec 2024 18:51:47 -0800 Subject: [PATCH 30/41] Generate session.json. --- examples/multiplane_ophys_session.json | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/examples/multiplane_ophys_session.json b/examples/multiplane_ophys_session.json index 524abf685..7478bc1bf 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": "1.0.1", + "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": "429_mesoscope_20220321", + "rig_id": "429-mesoscope-20220321", "calibrations": [], "maintenance": [], "subject_id": "12345", @@ -21,13 +21,16 @@ { "stream_start_time": "2022-07-12T07:00:00Z", "stream_end_time": "2022-07-12T07:00:00Z", - "daq_names": [], + "daq_names": [ + "NI PCIe-6612", + "NI PCIe-6321", + "NI USB-6001", + "NI OEM-6001" + ], "camera_names": [ - "Mesoscope", - "Eye", - "Face", - "Behavior", - "Vasculature" + "Behavior Camera", + "Eye Camera", + "Face Camera" ], "light_sources": [ { @@ -277,7 +280,7 @@ } ], "stimulus_epochs": [], - "mouse_platform_name": "disc", + "mouse_platform_name": "MindScope Running Disc", "active_mouse_platform": true, "headframe_registration": null, "reward_delivery": null, From 4914e1cc6ea0739c088ac53bc2d30802c96cb463 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Wed, 4 Dec 2024 18:53:09 -0800 Subject: [PATCH 31/41] Fix rig_id formatting in rig generator. --- examples/multiplane_ophys_rig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py index 9be1206d4..9a3bfcedc 100644 --- a/examples/multiplane_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -29,7 +29,7 @@ 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", + rig_id="429-mesoscope-20220321", modification_date=date(2024, 10, 16), mouse_platform=Disc( device_type="Disc", From 4a2b84d49eb227a09a5f2412b417875b33e91d8e Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Fri, 17 Jan 2025 11:54:17 -0800 Subject: [PATCH 32/41] Resolve review issues. - Add NI-DAQ componenets; still needs review. - Fixes room name inconsistencies. --- examples/multiplane_ophys_rig.py | 34 ++++++++++++++++++++++++++-- examples/multiplane_ophys_session.py | 3 +-- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py index 9a3bfcedc..91877a03d 100644 --- a/examples/multiplane_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -22,14 +22,17 @@ Lens, PockelsCell, Software, + DAQChannel, + DAQDevice, + DaqChannelType ) -from aind_data_schema.core.instrument import DAQDevice, Objective +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", + rig_id="429_mesoscope_20220321", modification_date=date(2024, 10, 16), mouse_platform=Disc( device_type="Disc", @@ -539,6 +542,15 @@ device_type="DAQ Device", name="VBEB DAQ", serial_number=None, + channel = [DAQChannel( + channel_name="P0.0", + device_name=["MESO1STIM"], + channel_type=DaqChannelType.DI, + port=[0], + channel_index=[5], + sample_rate=[20.0], + sample_rate_unit=FrequencyUnit.KHZ, + )], manufacturer=Organization.NATIONAL_INSTRUMENTS, model="USB-6001", path_to_cad=None, @@ -555,6 +567,15 @@ device_type="DAQ Device", name="SYNC DAQ", serial_number=None, + channel=[DAQChannel( + channel_name="P0.5", + device_name=["MESO1SYNC", "MESO1STIM"], + channel_type=DaqChannelType.DI, + port=[0], + channel_index=[5], + sample_rate=[100.0], + sample_rate_unit=FrequencyUnit.KHZ, + ),], manufacturer=Organization.NATIONAL_INSTRUMENTS, model="PCIe-6612", path_to_cad=None, @@ -570,6 +591,15 @@ DAQDevice( device_type="DAQ Device", name="STIM DAQ", + channel=[DAQChannel( + channel_name="P0.5", + device_name=["MESO1STIM"], + channel_type=DaqChannelType.DI, + port=[0], + channel_index=[5], + sample_rate=[250.0], + sample_rate_unit=FrequencyUnit.KHZ, + ),], serial_number=None, manufacturer=Organization.NATIONAL_INSTRUMENTS, model="PCIe-6321", diff --git a/examples/multiplane_ophys_session.py b/examples/multiplane_ophys_session.py index 7daad6211..9536524d4 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -18,7 +18,7 @@ subject_id="12345", session_type="Mesoscope", iacuc_protocol="12345", - rig_id="429-mesoscope-20220321", + rig_id="429_mesoscope_20220321", mouse_platform_name="MindScope Running Disc", active_mouse_platform=True, data_streams=[ @@ -28,7 +28,6 @@ stream_modalities=[ Modality.POPHYS, Modality.BEHAVIOR_VIDEOS, - Modality.CONFOCAL, ], daq_names=["NI PCIe-6612", "NI PCIe-6321", "NI USB-6001", "NI OEM-6001"], camera_names=[ From 8f5d8851ff2e3197268f49a570e9287285281cdd Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Fri, 17 Jan 2025 12:00:00 -0800 Subject: [PATCH 33/41] Remove channel_name from DAQDevice. --- examples/multiplane_ophys_rig.py | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py index 91877a03d..9221f8c5f 100644 --- a/examples/multiplane_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -542,15 +542,6 @@ device_type="DAQ Device", name="VBEB DAQ", serial_number=None, - channel = [DAQChannel( - channel_name="P0.0", - device_name=["MESO1STIM"], - channel_type=DaqChannelType.DI, - port=[0], - channel_index=[5], - sample_rate=[20.0], - sample_rate_unit=FrequencyUnit.KHZ, - )], manufacturer=Organization.NATIONAL_INSTRUMENTS, model="USB-6001", path_to_cad=None, @@ -567,15 +558,6 @@ device_type="DAQ Device", name="SYNC DAQ", serial_number=None, - channel=[DAQChannel( - channel_name="P0.5", - device_name=["MESO1SYNC", "MESO1STIM"], - channel_type=DaqChannelType.DI, - port=[0], - channel_index=[5], - sample_rate=[100.0], - sample_rate_unit=FrequencyUnit.KHZ, - ),], manufacturer=Organization.NATIONAL_INSTRUMENTS, model="PCIe-6612", path_to_cad=None, @@ -591,15 +573,6 @@ DAQDevice( device_type="DAQ Device", name="STIM DAQ", - channel=[DAQChannel( - channel_name="P0.5", - device_name=["MESO1STIM"], - channel_type=DaqChannelType.DI, - port=[0], - channel_index=[5], - sample_rate=[250.0], - sample_rate_unit=FrequencyUnit.KHZ, - ),], serial_number=None, manufacturer=Organization.NATIONAL_INSTRUMENTS, model="PCIe-6321", From 26683f4b92c2916f7943068beded449b41115f2d Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Fri, 17 Jan 2025 12:00:24 -0800 Subject: [PATCH 34/41] Generate multiplane_ophys_rig.json from python file. --- examples/multiplane_ophys_rig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/multiplane_ophys_rig.json b/examples/multiplane_ophys_rig.json index 1feb85dbd..e40b61e08 100644 --- a/examples/multiplane_ophys_rig.json +++ b/examples/multiplane_ophys_rig.json @@ -1,6 +1,6 @@ { "describedBy": "https://raw.githubusercontent.com/AllenNeuralDynamics/aind-data-schema/main/src/aind_data_schema/core/rig.py", - "schema_version": "1.0.1", + "schema_version": "1.0.4", "rig_id": "429_mesoscope_20220321", "modification_date": "2024-10-16", "mouse_platform": { From c609581343a4d2c58b6e106ead957684dfdf06a9 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Fri, 17 Jan 2025 12:01:17 -0800 Subject: [PATCH 35/41] Lint. --- examples/multiplane_ophys_rig.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py index 9221f8c5f..4c15a64c9 100644 --- a/examples/multiplane_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -14,6 +14,9 @@ Camera, CameraAssembly, Cooling, + DAQChannel, + DaqChannelType, + DAQDevice, DataInterface, Detector, Disc, @@ -22,9 +25,6 @@ Lens, PockelsCell, Software, - DAQChannel, - DAQDevice, - DaqChannelType ) from aind_data_schema.core.instrument import Objective from aind_data_schema.core.rig import Monitor, Rig From 4e286673ae95967874119132cc5ad70f891db30c Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Fri, 17 Jan 2025 12:02:12 -0800 Subject: [PATCH 36/41] Generate multiplane_ophys_session.json from python example. --- examples/multiplane_ophys_session.json | 64 ++++++++++++++++++++------ 1 file changed, 50 insertions(+), 14 deletions(-) diff --git a/examples/multiplane_ophys_session.json b/examples/multiplane_ophys_session.json index 7478bc1bf..d6bc0873d 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": "1.0.3", + "schema_version": "1.1.1", "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": "429-mesoscope-20220321", + "rig_id": "429_mesoscope_20220321", "calibrations": [], "maintenance": [], "subject_id": "12345", @@ -53,7 +53,12 @@ "index": 0, "imaging_depth": 190, "imaging_depth_unit": "micrometer", - "targeted_structure": "VISp", + "targeted_structure": { + "atlas": "CCFv3", + "name": "Primary visual area", + "acronym": "VISp", + "id": "385" + }, "fov_coordinate_ml": "1.5", "fov_coordinate_ap": "1.5", "fov_coordinate_unit": "micrometer", @@ -79,7 +84,12 @@ "index": 1, "imaging_depth": 232, "imaging_depth_unit": "micrometer", - "targeted_structure": "VISp", + "targeted_structure": { + "atlas": "CCFv3", + "name": "Primary visual area", + "acronym": "VISp", + "id": "385" + }, "fov_coordinate_ml": "1.5", "fov_coordinate_ap": "1.5", "fov_coordinate_unit": "micrometer", @@ -105,7 +115,12 @@ "index": 2, "imaging_depth": 136, "imaging_depth_unit": "micrometer", - "targeted_structure": "VISp", + "targeted_structure": { + "atlas": "CCFv3", + "name": "Primary visual area", + "acronym": "VISp", + "id": "385" + }, "fov_coordinate_ml": "1.5", "fov_coordinate_ap": "1.5", "fov_coordinate_unit": "micrometer", @@ -131,7 +146,12 @@ "index": 3, "imaging_depth": 282, "imaging_depth_unit": "micrometer", - "targeted_structure": "VISp", + "targeted_structure": { + "atlas": "CCFv3", + "name": "Primary visual area", + "acronym": "VISp", + "id": "385" + }, "fov_coordinate_ml": "1.5", "fov_coordinate_ap": "1.5", "fov_coordinate_unit": "micrometer", @@ -157,7 +177,12 @@ "index": 4, "imaging_depth": 72, "imaging_depth_unit": "micrometer", - "targeted_structure": "VISp", + "targeted_structure": { + "atlas": "CCFv3", + "name": "Primary visual area", + "acronym": "VISp", + "id": "385" + }, "fov_coordinate_ml": "1.5", "fov_coordinate_ap": "1.5", "fov_coordinate_unit": "micrometer", @@ -183,7 +208,12 @@ "index": 5, "imaging_depth": 326, "imaging_depth_unit": "micrometer", - "targeted_structure": "VISp", + "targeted_structure": { + "atlas": "CCFv3", + "name": "Primary visual area", + "acronym": "VISp", + "id": "385" + }, "fov_coordinate_ml": "1.5", "fov_coordinate_ap": "1.5", "fov_coordinate_unit": "micrometer", @@ -209,7 +239,12 @@ "index": 6, "imaging_depth": 30, "imaging_depth_unit": "micrometer", - "targeted_structure": "VISp", + "targeted_structure": { + "atlas": "CCFv3", + "name": "Primary visual area", + "acronym": "VISp", + "id": "385" + }, "fov_coordinate_ml": "1.5", "fov_coordinate_ap": "1.5", "fov_coordinate_unit": "micrometer", @@ -235,7 +270,12 @@ "index": 7, "imaging_depth": 364, "imaging_depth_unit": "micrometer", - "targeted_structure": "VISp", + "targeted_structure": { + "atlas": "CCFv3", + "name": "Primary visual area", + "acronym": "VISp", + "id": "385" + }, "fov_coordinate_ml": "1.5", "fov_coordinate_ap": "1.5", "fov_coordinate_unit": "micrometer", @@ -269,10 +309,6 @@ { "name": "Behavior videos", "abbreviation": "behavior-videos" - }, - { - "name": "Confocal microscopy", - "abbreviation": "confocal" } ], "software": [], From b4cdbe571044935e7bcbb8794c2635a8ecb60080 Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Fri, 17 Jan 2025 13:04:12 -0800 Subject: [PATCH 37/41] Remove extraneous file. --- status | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 status diff --git a/status b/status deleted file mode 100644 index 41b74b3ef..000000000 --- a/status +++ /dev/null @@ -1,49 +0,0 @@ -COMMAND_MODE=unix2003 -HOME=/Users/jerome.lecoq -LOGNAME=jerome.lecoq -MallocNanoZone=0 -ORIGINAL_XDG_CURRENT_DESKTOP=undefined -PATH=/Users/jerome.lecoq/.docker/bin:/Users/jerome.lecoq/opt/miniconda3/envs/aind-metadata/bin:/Users/jerome.lecoq/opt/miniconda3/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin -SHELL=/bin/zsh -SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.D4G3tDCvrF/Listeners -TMPDIR=/var/folders/j7/xydwnhrs6v9848qxgh69ygmw0000gp/T/ -USER=jerome.lecoq -XPC_FLAGS=0x0 -XPC_SERVICE_NAME=0 -__CFBundleIdentifier=com.microsoft.VSCode -__CF_USER_TEXT_ENCODING=0x1F6:0x0:0x0 -TERM_PROGRAM=vscode -TERM_PROGRAM_VERSION=1.94.2 -LANG=en_US.UTF-8 -COLORTERM=truecolor -GIT_ASKPASS=/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass.sh -VSCODE_GIT_ASKPASS_NODE=/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) -VSCODE_GIT_ASKPASS_EXTRA_ARGS= -VSCODE_GIT_ASKPASS_MAIN=/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass-main.js -VSCODE_GIT_IPC_HANDLE=/var/folders/j7/xydwnhrs6v9848qxgh69ygmw0000gp/T/vscode-git-07f21e107e.sock -VSCODE_INJECTION=1 -ZDOTDIR=/Users/jerome.lecoq -USER_ZDOTDIR=/Users/jerome.lecoq -PWD=/Users/jerome.lecoq/Documents/Work documents/Allen Institute/Projects/2P_pipeline/public_repo/metadata/aind-data-schema -TERM=xterm-256color -SHLVL=1 -OLDPWD=/Users/jerome.lecoq/Documents/Work documents/Allen Institute/Projects/2P_pipeline/public_repo/metadata/aind-data-schema -HOMEBREW_PREFIX=/opt/homebrew -HOMEBREW_CELLAR=/opt/homebrew/Cellar -HOMEBREW_REPOSITORY=/opt/homebrew -MANPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/share/man:/Library/Developer/CommandLineTools/usr/share/man:/Library/Developer/CommandLineTools/Toolchains/XcodeDefault.xctoolchain/usr/share/man:/opt/homebrew/share/man:: -INFOPATH=/opt/homebrew/share/info: -JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.0.5.jdk/Contents/Home -CONDA_EXE=/Users/jerome.lecoq/opt/miniconda3/bin/conda -_CE_M= -_CE_CONDA= -CONDA_PYTHON_EXE=/Users/jerome.lecoq/opt/miniconda3/bin/python -CONDA_SHLVL=2 -CONDA_PREFIX=/Users/jerome.lecoq/opt/miniconda3/envs/aind-metadata -CONDA_DEFAULT_ENV=aind-metadata -CONDA_PROMPT_MODIFIER=(aind-metadata) -CONDA_PREFIX_1=/Users/jerome.lecoq/opt/miniconda3 -_=/usr/bin/python3 -SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -CPATH=/usr/local/include -LIBRARY_PATH=/usr/local/lib From e4a1449d674013d921e4ac5121f20e351444893d Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Fri, 17 Jan 2025 20:02:29 -0800 Subject: [PATCH 38/41] Add DAQ devices and additional devices to rig schema. --- examples/multiplane_ophys_rig.json | 38 ++++++++++++++++++++++++++++-- examples/multiplane_ophys_rig.py | 20 +++++++++++++--- 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/examples/multiplane_ophys_rig.json b/examples/multiplane_ophys_rig.json index e40b61e08..9cf76a16c 100644 --- a/examples/multiplane_ophys_rig.json +++ b/examples/multiplane_ophys_rig.json @@ -688,7 +688,30 @@ "beam_modulation_unit": "Volts" } ], - "additional_devices": [], + "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", @@ -734,7 +757,18 @@ "notes": null, "data_interface": "PCIe", "computer_name": "SYNC", - "channels": [], + "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 }, diff --git a/examples/multiplane_ophys_rig.py b/examples/multiplane_ophys_rig.py index 4c15a64c9..18b585f81 100644 --- a/examples/multiplane_ophys_rig.py +++ b/examples/multiplane_ophys_rig.py @@ -19,6 +19,7 @@ DAQDevice, DataInterface, Detector, + Device, Disc, Filter, Laser, @@ -536,13 +537,17 @@ serial_number="354683BK", ) ], - additional_devices=[], + 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, @@ -550,7 +555,6 @@ notes=None, data_interface="USB", computer_name="STIM", - channels=[], firmware_version=None, hardware_version=None, ), @@ -566,7 +570,17 @@ notes=None, data_interface="PCIe", computer_name="SYNC", - channels=[], + 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, ), From da376ba30408b75c64e1b96c76648d5610c8eadd Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Tue, 21 Jan 2025 10:27:42 -0800 Subject: [PATCH 39/41] Generate multiplane_ophys_session.json. --- examples/multiplane_ophys_session.json | 58 ++++---------------------- 1 file changed, 9 insertions(+), 49 deletions(-) diff --git a/examples/multiplane_ophys_session.json b/examples/multiplane_ophys_session.json index d6bc0873d..48090f598 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": "1.1.1", + "schema_version": "1.0.3", "protocol_id": [], "experimenter_full_name": [ "John Doe" @@ -53,12 +53,7 @@ "index": 0, "imaging_depth": 190, "imaging_depth_unit": "micrometer", - "targeted_structure": { - "atlas": "CCFv3", - "name": "Primary visual area", - "acronym": "VISp", - "id": "385" - }, + "targeted_structure": "VISp", "fov_coordinate_ml": "1.5", "fov_coordinate_ap": "1.5", "fov_coordinate_unit": "micrometer", @@ -84,12 +79,7 @@ "index": 1, "imaging_depth": 232, "imaging_depth_unit": "micrometer", - "targeted_structure": { - "atlas": "CCFv3", - "name": "Primary visual area", - "acronym": "VISp", - "id": "385" - }, + "targeted_structure": "VISp", "fov_coordinate_ml": "1.5", "fov_coordinate_ap": "1.5", "fov_coordinate_unit": "micrometer", @@ -115,12 +105,7 @@ "index": 2, "imaging_depth": 136, "imaging_depth_unit": "micrometer", - "targeted_structure": { - "atlas": "CCFv3", - "name": "Primary visual area", - "acronym": "VISp", - "id": "385" - }, + "targeted_structure": "VISp", "fov_coordinate_ml": "1.5", "fov_coordinate_ap": "1.5", "fov_coordinate_unit": "micrometer", @@ -146,12 +131,7 @@ "index": 3, "imaging_depth": 282, "imaging_depth_unit": "micrometer", - "targeted_structure": { - "atlas": "CCFv3", - "name": "Primary visual area", - "acronym": "VISp", - "id": "385" - }, + "targeted_structure": "VISp", "fov_coordinate_ml": "1.5", "fov_coordinate_ap": "1.5", "fov_coordinate_unit": "micrometer", @@ -177,12 +157,7 @@ "index": 4, "imaging_depth": 72, "imaging_depth_unit": "micrometer", - "targeted_structure": { - "atlas": "CCFv3", - "name": "Primary visual area", - "acronym": "VISp", - "id": "385" - }, + "targeted_structure": "VISp", "fov_coordinate_ml": "1.5", "fov_coordinate_ap": "1.5", "fov_coordinate_unit": "micrometer", @@ -208,12 +183,7 @@ "index": 5, "imaging_depth": 326, "imaging_depth_unit": "micrometer", - "targeted_structure": { - "atlas": "CCFv3", - "name": "Primary visual area", - "acronym": "VISp", - "id": "385" - }, + "targeted_structure": "VISp", "fov_coordinate_ml": "1.5", "fov_coordinate_ap": "1.5", "fov_coordinate_unit": "micrometer", @@ -239,12 +209,7 @@ "index": 6, "imaging_depth": 30, "imaging_depth_unit": "micrometer", - "targeted_structure": { - "atlas": "CCFv3", - "name": "Primary visual area", - "acronym": "VISp", - "id": "385" - }, + "targeted_structure": "VISp", "fov_coordinate_ml": "1.5", "fov_coordinate_ap": "1.5", "fov_coordinate_unit": "micrometer", @@ -270,12 +235,7 @@ "index": 7, "imaging_depth": 364, "imaging_depth_unit": "micrometer", - "targeted_structure": { - "atlas": "CCFv3", - "name": "Primary visual area", - "acronym": "VISp", - "id": "385" - }, + "targeted_structure": "VISp", "fov_coordinate_ml": "1.5", "fov_coordinate_ap": "1.5", "fov_coordinate_unit": "micrometer", From 5b089a69c92d6f4096686de7985f58f03600371d Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Thu, 23 Jan 2025 13:57:57 -0800 Subject: [PATCH 40/41] Sync DAQ names between multiplane-ophys session and rig jsons. --- examples/multiplane_ophys_session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/multiplane_ophys_session.py b/examples/multiplane_ophys_session.py index 9536524d4..06a34e131 100644 --- a/examples/multiplane_ophys_session.py +++ b/examples/multiplane_ophys_session.py @@ -29,7 +29,7 @@ Modality.POPHYS, Modality.BEHAVIOR_VIDEOS, ], - daq_names=["NI PCIe-6612", "NI PCIe-6321", "NI USB-6001", "NI OEM-6001"], + daq_names=["SYNC DAQ", "STIM DAQ", "VBEB DAQ"], camera_names=[ "Behavior Camera", "Eye Camera", From 28fd45623128ef606de6da15a5f3770feab9bb0e Mon Sep 17 00:00:00 2001 From: Arielle Leon Date: Thu, 23 Jan 2025 14:02:18 -0800 Subject: [PATCH 41/41] Generate session.json example from updated python script. --- examples/multiplane_ophys_session.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/multiplane_ophys_session.json b/examples/multiplane_ophys_session.json index 48090f598..c79fd9e75 100644 --- a/examples/multiplane_ophys_session.json +++ b/examples/multiplane_ophys_session.json @@ -22,10 +22,9 @@ "stream_start_time": "2022-07-12T07:00:00Z", "stream_end_time": "2022-07-12T07:00:00Z", "daq_names": [ - "NI PCIe-6612", - "NI PCIe-6321", - "NI USB-6001", - "NI OEM-6001" + "SYNC DAQ", + "STIM DAQ", + "VBEB DAQ" ], "camera_names": [ "Behavior Camera",